mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-17 17:42:20 +03:00
Move debug mode json dumps to subdirectory
This commit is contained in:
parent
ee28daacc9
commit
d1756ebcf5
@ -361,7 +361,8 @@ class AppWindow:
|
||||
else:
|
||||
|
||||
if __debug__: # Recording
|
||||
with open('%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:
|
||||
if not isdir('dump'): mkdir('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:
|
||||
h.write(json.dumps(data, ensure_ascii=False, indent=2, sort_keys=True).encode('utf-8'))
|
||||
|
||||
self.cmdr['text'] = data.get('commander') and data.get('commander').get('name') or ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user