diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 283c3bf5..041f7331 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -922,7 +922,7 @@ class AppWindow(object): return False # Ignore possibly missing shipyard info - elif (config.get_int('output') & config.OUT_MKT_EDDN) \ + elif (config.get_int('output') & config.OUT_EDDN_SEND_STATION_DATA) \ and not (data['lastStarport'].get('commodities') or data['lastStarport'].get('modules')): if not self.status['text']: # LANG: Status - Either no market or no modules data for station from Frontier CAPI diff --git a/config/__init__.py b/config/__init__.py index d57412c4..98056504 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -162,7 +162,7 @@ def appversion_nobuild() -> semantic_version.Version: class AbstractConfig(abc.ABC): """Abstract root class of all platform specific Config implementations.""" - OUT_MKT_EDDN = 1 + OUT_EDDN_SEND_STATION_DATA = 1 # OUT_MKT_BPC = 2 # No longer supported OUT_MKT_TD = 4 OUT_MKT_CSV = 8 @@ -171,7 +171,7 @@ class AbstractConfig(abc.ABC): # OUT_SYS_FILE = 32 # No longer supported # OUT_STAT = 64 # No longer available # OUT_SHIP_CORIOLIS = 128 # Replaced by OUT_SHIP - OUT_STATION_ANY = OUT_MKT_EDDN | OUT_MKT_TD | OUT_MKT_CSV + OUT_STATION_ANY = OUT_EDDN_SEND_STATION_DATA | OUT_MKT_TD | OUT_MKT_CSV # OUT_SYS_EDSM = 256 # Now a plugin # OUT_SYS_AUTO = 512 # Now always automatic OUT_MKT_MANUAL = 1024 diff --git a/plugins/eddn.py b/plugins/eddn.py index ab7e7ef9..b0f28a27 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -1824,7 +1824,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame: BUTTONX = 12 # noqa: N806 # indent Checkbuttons and Radiobuttons if prefsVersion.shouldSetDefaults('0.0.0.0', not bool(config.get_int('output'))): - output: int = (config.OUT_MKT_EDDN | config.OUT_EDDN_SEND_NON_STATION) # default settings + output: int = (config.OUT_EDDN_SEND_STATION_DATA | config.OUT_EDDN_SEND_NON_STATION) # default settings else: output = config.get_int('output') @@ -1839,7 +1839,7 @@ def plugin_prefs(parent, cmdr: str, is_beta: bool) -> Frame: underline=True ).grid(padx=PADX, sticky=tk.W) # Don't translate - this.eddn_station = tk.IntVar(value=(output & config.OUT_MKT_EDDN) and 1) + this.eddn_station = tk.IntVar(value=(output & config.OUT_EDDN_SEND_STATION_DATA) and 1) this.eddn_station_button = nb.Checkbutton( eddnframe, # LANG: Enable EDDN support for station data checkbox label @@ -1895,7 +1895,7 @@ def prefs_changed(cmdr: str, is_beta: bool) -> None: 'output', (config.get_int('output') & (config.OUT_MKT_TD | config.OUT_MKT_CSV | config.OUT_SHIP | config.OUT_MKT_MANUAL)) + - (this.eddn_station.get() and config.OUT_MKT_EDDN) + + (this.eddn_station.get() and config.OUT_EDDN_SEND_STATION_DATA) + (this.eddn_system.get() and config.OUT_EDDN_SEND_NON_STATION) + (this.eddn_delay.get() and config.OUT_EDDN_DO_NOT_DELAY) ) @@ -2208,11 +2208,12 @@ def journal_entry( # noqa: C901, CCR001 return _("Error: Can't connect to EDDN") # LANG: Error while trying to send data to EDDN except Exception as e: + return logger.debug('Failed in export_journal_entry', exc_info=e) return str(e) - elif (config.get_int('output') & config.OUT_MKT_EDDN and not state['Captain'] and - event_name in ('market', 'outfitting', 'shipyard')): + elif (config.get_int('output') & config.OUT_EDDN_SEND_STATION_DATA and not state['Captain'] and + event_name in ('market', 'outfitting', 'shipyard')): # Market.json, Outfitting.json or Shipyard.json to process try: @@ -2263,7 +2264,7 @@ def cmdr_data(data: CAPIData, is_beta: bool) -> Optional[str]: # noqa: CCR001 :return: str - Error message, or `None` if no errors. """ if (data['commander'].get('docked') or (this.on_foot and monitor.station) - and config.get_int('output') & config.OUT_MKT_EDDN): + and config.get_int('output') & config.OUT_EDDN_SEND_STATION_DATA): try: if this.marketId != data['lastStarport']['id']: this.commodities = this.outfitting = this.shipyard = None diff --git a/prefs.py b/prefs.py index d2fb69b0..dd52c78b 100644 --- a/prefs.py +++ b/prefs.py @@ -1221,7 +1221,7 @@ class PreferencesDialog(tk.Toplevel): (self.out_csv.get() and config.OUT_MKT_CSV) + (config.OUT_MKT_MANUAL if not self.out_auto.get() else 0) + (self.out_ship.get() and config.OUT_SHIP) + - (config.get_int('output') & (config.OUT_MKT_EDDN | config.OUT_EDDN_SEND_NON_STATION | config.OUT_EDDN_DO_NOT_DELAY)) + (config.get_int('output') & (config.OUT_EDDN_SEND_STATION_DATA | config.OUT_EDDN_SEND_NON_STATION | config.OUT_EDDN_DO_NOT_DELAY)) ) config.set(