mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-06-07 02:43:22 +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,19 +284,17 @@ 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:
|
if config.getint('output') & config.OUT_LOG_EDSM:
|
||||||
# Catch any EDSM errors here so that they don't prevent station update
|
# Catch any EDSM errors here so that they don't prevent station update
|
||||||
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.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.status['text'] = ''
|
||||||
self.edsm.start_lookup(self.system['text'], EDDB.system(self.system['text']))
|
except Exception as e:
|
||||||
self.status['text'] = ''
|
if __debug__: print_exc()
|
||||||
except Exception as e:
|
self.status['text'] = unicode(e)
|
||||||
if __debug__: print_exc()
|
self.edsmpoll()
|
||||||
self.status['text'] = unicode(e)
|
|
||||||
self.edsmpoll()
|
|
||||||
|
|
||||||
if not (config.getint('output') & (config.OUT_CSV|config.OUT_TD|config.OUT_BPC|config.OUT_EDDN)):
|
if not (config.getint('output') & (config.OUT_CSV|config.OUT_TD|config.OUT_BPC|config.OUT_EDDN)):
|
||||||
# no station data requested - we're done
|
# no station data requested - we're done
|
||||||
@ -424,26 +422,23 @@ 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:
|
except Exception as e:
|
||||||
self.edsm.start_lookup(system, EDDB.system(system))
|
if __debug__: print_exc()
|
||||||
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')
|
self.status['text'] = unicode(e)
|
||||||
except Exception as e:
|
if not config.getint('hotkey_mute'):
|
||||||
if __debug__: print_exc()
|
hotkeymgr.play_bad()
|
||||||
self.status['text'] = unicode(e)
|
self.edsmpoll()
|
||||||
if not config.getint('hotkey_mute'):
|
|
||||||
hotkeymgr.play_bad()
|
|
||||||
self.edsmpoll()
|
|
||||||
|
|
||||||
|
|
||||||
def edsmpoll(self):
|
def edsmpoll(self):
|
||||||
result = self.edsm.result
|
result = self.edsm.result
|
||||||
|
Loading…
x
Reference in New Issue
Block a user