mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-08 19:32:15 +03:00
Don't lookup system in EDSM unless the option to send flight log is
selected. Addresses #56.
This commit is contained in:
parent
8b04b3490b
commit
259249bba8
@ -284,14 +284,12 @@ class AppWindow:
|
|||||||
coriolis.export(data)
|
coriolis.export(data)
|
||||||
if config.getint('output') & config.OUT_LOG_FILE:
|
if config.getint('output') & config.OUT_LOG_FILE:
|
||||||
flightlog.export(data)
|
flightlog.export(data)
|
||||||
try:
|
|
||||||
# Catch any EDSM errors here so that they don't prevent station update
|
|
||||||
if config.getint('output') & config.OUT_LOG_EDSM:
|
if config.getint('output') & config.OUT_LOG_EDSM:
|
||||||
|
# Catch any EDSM errors here so that they don't prevent station update
|
||||||
|
try:
|
||||||
self.status['text'] = _('Sending data to EDSM...')
|
self.status['text'] = _('Sending data to EDSM...')
|
||||||
self.w.update_idletasks()
|
self.w.update_idletasks()
|
||||||
edsm.export(data, lambda:self.edsm.lookup(self.system['text'], EDDB.system(self.system['text']))) # Do EDSM lookup during EDSM export
|
edsm.export(data, lambda:self.edsm.lookup(self.system['text'], EDDB.system(self.system['text']))) # Do EDSM lookup during EDSM export
|
||||||
else:
|
|
||||||
self.edsm.start_lookup(self.system['text'], EDDB.system(self.system['text']))
|
|
||||||
self.status['text'] = ''
|
self.status['text'] = ''
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if __debug__: print_exc()
|
if __debug__: print_exc()
|
||||||
@ -424,19 +422,17 @@ class AppWindow:
|
|||||||
timestamp, system = monitor.last_event # would like to use event user_data to carry this, but not accessible in Tkinter
|
timestamp, system = monitor.last_event # would like to use event user_data to carry this, but not accessible in Tkinter
|
||||||
|
|
||||||
if self.system['text'] != system:
|
if self.system['text'] != system:
|
||||||
try:
|
|
||||||
self.system['text'] = system
|
self.system['text'] = system
|
||||||
self.system['image'] = ''
|
self.system['image'] = ''
|
||||||
self.station['text'] = EDDB.system(system) and self.STATION_UNDOCKED or ''
|
self.station['text'] = EDDB.system(system) and self.STATION_UNDOCKED or ''
|
||||||
|
self.status['text'] = strftime(_('Last updated at {HH}:{MM}:{SS}').format(HH='%H', MM='%M', SS='%S').encode('utf-8'), localtime(timestamp)).decode('utf-8')
|
||||||
if config.getint('output') & config.OUT_LOG_FILE:
|
if config.getint('output') & config.OUT_LOG_FILE:
|
||||||
flightlog.writelog(timestamp, system)
|
flightlog.writelog(timestamp, system)
|
||||||
if config.getint('output') & config.OUT_LOG_EDSM:
|
if config.getint('output') & config.OUT_LOG_EDSM:
|
||||||
|
try:
|
||||||
self.status['text'] = _('Sending data to EDSM...')
|
self.status['text'] = _('Sending data to EDSM...')
|
||||||
self.w.update_idletasks()
|
self.w.update_idletasks()
|
||||||
edsm.writelog(timestamp, system, lambda:self.edsm.lookup(system, EDDB.system(system))) # Do EDSM lookup during EDSM export
|
edsm.writelog(timestamp, system, lambda:self.edsm.lookup(system, EDDB.system(system))) # Do EDSM lookup during EDSM export
|
||||||
else:
|
|
||||||
self.edsm.start_lookup(system, EDDB.system(system))
|
|
||||||
self.status['text'] = strftime(_('Last updated at {HH}:{MM}:{SS}').format(HH='%H', MM='%M', SS='%S').encode('utf-8'), localtime(timestamp)).decode('utf-8')
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
if __debug__: print_exc()
|
if __debug__: print_exc()
|
||||||
self.status['text'] = unicode(e)
|
self.status['text'] = unicode(e)
|
||||||
@ -444,7 +440,6 @@ class AppWindow:
|
|||||||
hotkeymgr.play_bad()
|
hotkeymgr.play_bad()
|
||||||
self.edsmpoll()
|
self.edsmpoll()
|
||||||
|
|
||||||
|
|
||||||
def edsmpoll(self):
|
def edsmpoll(self):
|
||||||
result = self.edsm.result
|
result = self.edsm.result
|
||||||
if result['done']:
|
if result['done']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user