1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-24 12:40:52 +03:00

Perform basic update before invoking plugins.

Update display and fixup commodities.
This commit is contained in:
Jonathan Harris 2016-01-09 13:23:26 +00:00
parent 4e9f875567
commit 4f16215720

View File

@ -289,8 +289,6 @@ class AppWindow:
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:
h.write(json.dumps(data, ensure_ascii=False, indent=2, sort_keys=True).encode('utf-8'))
plug.notify_newdata(data)
self.cmdr['text'] = data.get('commander') and data.get('commander').get('name') or ''
self.system['text'] = data.get('lastSystem') and data.get('lastSystem').get('name') or ''
self.station['text'] = data.get('commander') and data.get('commander').get('docked') and data.get('lastStarport') and data.get('lastStarport').get('name') or (EDDB.system(self.system['text']) and self.STATION_UNDOCKED or '')
@ -298,7 +296,12 @@ class AppWindow:
self.edit_menu.entryconfigure(_('Copy'), state=tk.NORMAL)
self.view_menu.entryconfigure(_('Status'), state=tk.NORMAL)
if data['lastStarport'].get('commodities'):
# Fixup anomalies in the commodity data
self.session.fixup(data['lastStarport']['commodities'])
# stuff we can do when not docked
plug.notify_newdata(data)
if config.getint('output') & config.OUT_SHIP_EDS:
loadout.export(data)
if config.getint('output') & config.OUT_SHIP_CORIOLIS:
@ -355,9 +358,6 @@ class AppWindow:
else:
if data['lastStarport'].get('commodities'):
# Fixup anomalies in the commodity data
self.session.fixup(data['lastStarport']['commodities'])
if config.getint('output') & config.OUT_CSV:
bpc.export(data, True)
if config.getint('output') & config.OUT_TD:
@ -447,10 +447,11 @@ class AppWindow:
if self.system['text'] != system:
self.system['text'] = system
plug.notify_system_changed(timestamp, system)
self.system['image'] = ''
self.station['text'] = EDDB.system(system) and self.STATION_UNDOCKED or ''
plug.notify_system_changed(timestamp, system)
if config.getint('output') & config.OUT_LOG_FILE:
flightlog.writelog(timestamp, system)
if config.getint('output') & config.OUT_LOG_EDSM: