1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Fixes __debug__ dump/ file writing.

Similarly to the 'Save Raw Data' fix in 9ccca42b31102fd713b26a7a8223472d364772ab
This commit is contained in:
Athanasius 2019-09-12 12:20:33 +01:00
parent a56c48437b
commit 8237a94f72

View File

@ -440,7 +440,7 @@ class AppWindow(object):
if __debug__: # Recording if __debug__: # Recording
if isdir('dump'): if isdir('dump'):
with open('dump/%s%s.%s.json' % (data['lastSystem']['name'], data['commander'].get('docked') and '.'+data['lastStarport']['name'] or '', strftime('%Y-%m-%dT%H.%M.%S', localtime())), 'wt') as h: with open('dump/%s%s.%s.json' % (data['lastSystem']['name'], data['commander'].get('docked') and '.'+data['lastStarport']['name'] or '', strftime('%Y-%m-%dT%H.%M.%S', localtime())), 'wb') as h:
h.write(json.dumps(data, ensure_ascii=False, indent=2, sort_keys=True, separators=(',', ': ')).encode('utf-8')) h.write(json.dumps(data, ensure_ascii=False, indent=2, sort_keys=True, separators=(',', ': ')).encode('utf-8'))
if not monitor.state['ShipType']: # Started game in SRV or fighter if not monitor.state['ShipType']: # Started game in SRV or fighter