1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 00:30:33 +03:00

Record station data in interactive mode.

This commit is contained in:
Jonathan Harris 2015-06-11 16:38:22 +01:00
parent 163bb09b40
commit 460e6099bc

View File

@ -11,6 +11,7 @@ from os.path import dirname, join
from requests.packages import urllib3
import sys
from sys import platform
import time
if __debug__:
from traceback import print_exc
@ -131,6 +132,12 @@ class Session:
except:
self.dump(r)
raise ServerError()
# Recording
if __debug__:
with open('%s.%s.%s.json' % (data['lastSystem']['name'].strip(), data['lastStarport']['name'].strip(), time.strftime('%Y-%m-%dT%H.%M.%S', time.localtime())), 'wt') as h:
h.write(json.dumps(data, indent=2))
return self.fixup(data)
def close(self):