1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-19 18:37:39 +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 07c52ee9ab
commit c932bee929

View File

@ -441,7 +441,7 @@ class AppWindow(object):
if __debug__: # Recording
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'))
if not monitor.state['ShipType']: # Started game in SRV or fighter