1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

config/EDDN: Rename OUT_MKT_EDDN to OUT_EDDN_SEND_STATION_DATA

This flag controls whether commodity, outfitting or shipyard schema messages
are sent.  Thus 'MKT' ('market') is misleading.  Rename it so the intent when
used is clear.
This commit is contained in:
Athanasius 2022-10-05 15:29:11 +01:00 committed by Athanasius
parent 9f02f18408
commit 0d35f8874a
No known key found for this signature in database
GPG Key ID: 772697E181BB2767
4 changed files with 11 additions and 10 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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(