diff --git a/Build-exe-and-msi.py b/Build-exe-and-msi.py index bc0ec6005..20042ccb6 100644 --- a/Build-exe-and-msi.py +++ b/Build-exe-and-msi.py @@ -70,7 +70,6 @@ APPCMD = 'EDMC.py' PLUGINS = [ 'plugins/coriolis.py', - 'plugins/eddb.py', 'plugins/eddn.py', 'plugins/edsm.py', 'plugins/edsy.py', diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 753fd84f3..bb9ff929c 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -67,7 +67,7 @@ description="Utilises Elite Dangerous Journal files and the Frontier " "Companion API (CAPI) service to gather data about a " "player's state and actions to upload to third-party sites " - "such as EDSM, Inara.cz and EDDB." + "such as EDSM and Inara.cz." ) ########################################################################### @@ -534,7 +534,7 @@ def open_window(systray: 'SysTrayIcon') -> None: self.station_label = tk.Label(frame, name='station_label') self.station = HyperlinkLabel(frame, compound=tk.RIGHT, url=self.station_url, name='station') # system and station text is set/updated by the 'provider' plugins - # eddb, edsm and inara. Look for: + # edsm and inara. Look for: # # parent.nametowidget(f".{appname.lower()}.system") # parent.nametowidget(f".{appname.lower()}.station") @@ -1737,7 +1737,7 @@ def system_url(self, system: str) -> str | None: def station_url(self, station: str) -> str | None: """Despatch a station URL to the configured handler.""" return plug.invoke( - config.get_str('station_provider'), 'eddb', 'station_url', + config.get_str('station_provider'), 'edsm', 'station_url', monitor.state['SystemName'], monitor.state['StationName'] ) diff --git a/L10n/cs.strings b/L10n/cs.strings index 90519f657..ffbc24cb7 100644 --- a/L10n/cs.strings +++ b/L10n/cs.strings @@ -205,9 +205,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Neplatný režim přepisu Coriolis!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Zpracování EDDB deníku je deaktivováno. Zkontrolujte log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Chyba: Nelze se připojit k EDDN"; diff --git a/L10n/de.strings b/L10n/de.strings index 4ba8793d5..898821cbb 100644 --- a/L10n/de.strings +++ b/L10n/de.strings @@ -253,9 +253,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Ungültiger Coriolis-Überschreibungsmodus!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "EDDB Journal-Verarbeitung deaktiviert. Siehe Log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Fehler: Keine Verbindung zum EDDN"; diff --git a/L10n/en.template b/L10n/en.template index 96944a635..d3b265b70 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -253,9 +253,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Invalid Coriolis override mode!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "EDDB Journal processing disabled. See Log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Error: Can't connect to EDDN"; diff --git a/L10n/es.strings b/L10n/es.strings index abced1a92..6377ebc8a 100644 --- a/L10n/es.strings +++ b/L10n/es.strings @@ -211,9 +211,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "¡Modo sobrescritura de Coriolis Inválido!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Procesamiento de Journal para EDDB desactivado. Ver Log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Error: No se puede conectar a EDDN"; diff --git a/L10n/fi.strings b/L10n/fi.strings index c2577e42d..6a7b54af4 100644 --- a/L10n/fi.strings +++ b/L10n/fi.strings @@ -178,9 +178,6 @@ /* l10n.py: The system default language choice in Settings > Appearance; prefs.py: Settings > Configuration - Label on 'reset journal files location to default' button; prefs.py: The system default language choice in Settings > Appearance; prefs.py: Label for 'Default' theme radio button; In files: l10n.py:193; prefs.py:455; prefs.py:709; prefs.py:742; */ "Default" = "Oletus"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "EDDB lokikirjan käsittely ei käytössä. Katso lokitiedot."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Virhe: ei saatu yhteyttä EDDN:ään"; @@ -193,9 +190,6 @@ /* eddn.py: EDDN delay sending until docked option is on, this message notes that a send was skipped due to this; In files: eddn.py:2063; */ "Delay sending until docked" = "Lähetä tiedot vasta telakoitumisen jälkeen"; -/* eddn.py: Killswitch disabled EDDN; In files: eddn.py:2178; */ -"EDDN journal handler disabled. See Log." = "EDDB lokikirjan käsittelijä ei käytössä. Katso lokitiedot."; - /* eddn.py: Status text shown while attempting to send data; In files: eddn.py:2507; */ "Sending data to EDDN..." = "Lähetetään tietoja EDDN:ään..."; diff --git a/L10n/it.strings b/L10n/it.strings index 515b65b7a..09149c99f 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -184,9 +184,6 @@ /* coriolis.py: Settings>Coriolis: Label for selection of using Normal, Beta or 'auto' Coriolis URL; In files: coriolis.py:116; */ "Override Beta/Normal Selection" = "Sovrascrivi selezione Beta/Normale"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Elaborazione di EDDB Journal disabilitata. Guarda il Log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Errore: Non riesco a connettermi a EDDN"; diff --git a/L10n/ja.strings b/L10n/ja.strings index 0695827e7..6b9990885 100644 --- a/L10n/ja.strings +++ b/L10n/ja.strings @@ -253,9 +253,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "無効なCoriolis上書きモードです!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "EDDBジャーナル処理が無効です。ログを確認してください。"; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "エラー: EDDNに接続できません"; diff --git a/L10n/ko.strings b/L10n/ko.strings index d1a195776..2d69243f5 100644 --- a/L10n/ko.strings +++ b/L10n/ko.strings @@ -229,9 +229,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "잘못된 Coriolis 오버라이딩 모드입니다!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "EDDB 저널 처리 비활성화됨. 로그 참고 바람."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "오류: EDDN에 연결할 수 없음"; diff --git a/L10n/pl.strings b/L10n/pl.strings index 9c201f7c3..e772dfe90 100644 --- a/L10n/pl.strings +++ b/L10n/pl.strings @@ -232,9 +232,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Niewłaściwy tryb nadpisania Coriolis!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Wyłączone przetwarzanie dziennika EDDB. Sprawdź logi."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Błąd: Brak połączenia z EDDN"; @@ -257,7 +254,7 @@ "Delay sending until docked" = "Czekaj z wysłaniem na zadokowanie"; /* eddn.py: Killswitch disabled EDDN; In files: eddn.py:2178; */ -"EDDN journal handler disabled. See Log." = "Wyłączona obsługa dziennika EDDB. Sprawdź logi."; +"EDDN journal handler disabled. See Log." = "Wyłączona obsługa dziennika EDDN. Sprawdź logi."; /* eddn.py: Status text shown while attempting to send data; In files: eddn.py:2507; */ "Sending data to EDDN..." = "Wysłanie danych do EDDN..."; @@ -278,7 +275,7 @@ "None" = "Brak"; /* edsm.py: EDSM plugin - Journal handling disabled by killswitch; In files: edsm.py:516; */ -"EDSM Handler disabled. See Log." = "Wyłączona obsługa EDDB. Sprawdź logi."; +"EDSM Handler disabled. See Log." = "Wyłączona obsługa EDSM. Sprawdź logi."; /* edsm.py: EDSM Plugin - Error message from EDSM API; In files: edsm.py:916; edsm.py:1048; */ "Error: EDSM {MSG}" = "Błąd: EDSM {MSG}"; diff --git a/L10n/pt-BR.strings b/L10n/pt-BR.strings index 38998c708..27e9b4748 100644 --- a/L10n/pt-BR.strings +++ b/L10n/pt-BR.strings @@ -253,9 +253,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Modo de substituição Coriolis inválido!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Processamento de Jornais no EDDB desativado. Verifique o Log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Erro: Não é possível conectar-se ao EDDN"; diff --git a/L10n/pt-PT.strings b/L10n/pt-PT.strings index 59d160b28..bd9360590 100644 --- a/L10n/pt-PT.strings +++ b/L10n/pt-PT.strings @@ -253,9 +253,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Modo de sobreposição Coriolis inválido!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Processamento do diário do EDDB desactivado. Verifique o ficheiro de registos."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Erro: Não é possível conectar ao EDDN"; diff --git a/L10n/ru.strings b/L10n/ru.strings index 99c3d70fa..38f3d7a4d 100644 --- a/L10n/ru.strings +++ b/L10n/ru.strings @@ -253,9 +253,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Некорректный режим переопределения URL для coriolis.io"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Обработка журнала EDDB отключена. См. логи."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Ошибка: не удается подключиться к EDDN"; diff --git a/L10n/sr-Latn-BA.strings b/L10n/sr-Latn-BA.strings index e80d4f905..62d372e34 100644 --- a/L10n/sr-Latn-BA.strings +++ b/L10n/sr-Latn-BA.strings @@ -232,9 +232,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Neispravan Coriolis režim rada!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "EDDB obrada journala je deaktivirana. Pogledajte Log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Greška: Nemoguće povezivanje sa EDDN"; diff --git a/L10n/sr-Latn.strings b/L10n/sr-Latn.strings index d6d937cc2..3da6c5b97 100644 --- a/L10n/sr-Latn.strings +++ b/L10n/sr-Latn.strings @@ -253,9 +253,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "Pogrešan Coriolis preinačeni mod!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "Obrada žurnala za EDDB je deaktivirana. Pogledajte Log."; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "Greška: Nemoguće povezivanje na EDDN"; diff --git a/L10n/zh-Hans.strings b/L10n/zh-Hans.strings index d77b8184a..83ad58bd6 100644 --- a/L10n/zh-Hans.strings +++ b/L10n/zh-Hans.strings @@ -232,9 +232,6 @@ /* coriolis.py: Settings>Coriolis - invalid override mode found; In files: coriolis.py:156; */ "Invalid Coriolis override mode!" = "无效的 Coriolis 覆盖模式!"; -/* eddb.py: Journal Processing disabled due to an active killswitch; In files: eddb.py:179; */ -"EDDB Journal processing disabled. See Log." = "EDDB Journal Processing 已禁用。请查看诊断日志。"; - /* eddn.py: Error while trying to send data to EDDN; In files: eddn.py:458; eddn.py:2413; eddn.py:2451; eddn.py:2519; */ "Error: Can't connect to EDDN" = "错误:无法连接到 EDDN"; diff --git a/config/__init__.py b/config/__init__.py index 44fe06e64..9dfe2f404 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -52,7 +52,7 @@ # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.8.2-alpha0' +_static_appversion = '5.9.0-alpha0' _cached_version: Optional[semantic_version.Version] = None copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD' diff --git a/dashboard.py b/dashboard.py index c88f9a216..715fd2306 100644 --- a/dashboard.py +++ b/dashboard.py @@ -7,7 +7,9 @@ import tkinter as tk from calendar import timegm from os.path import getsize, isdir, isfile -from typing import Any, Dict +from typing import Any, Dict, Optional, cast + +from watchdog.observers.api import BaseObserver from config import config from EDMCLogging import get_main_logger @@ -34,9 +36,10 @@ class Dashboard(FileSystemEventHandler): def __init__(self) -> None: FileSystemEventHandler.__init__(self) # futureproofing - not need for current version of watchdog + self.session_start: int = int(time.time()) self.root: tk.Tk = None # type: ignore self.currentdir: str = None # type: ignore # The actual logdir that we're monitoring - self.observer: Observer = None # type: ignore + self.observer: Optional[Observer] = None # type: ignore self.observed = None # a watchdog ObservedWatch, or None if polling self.status: Dict[str, Any] = {} # Current status for communicating status back to main thread @@ -86,7 +89,7 @@ def start(self, root: tk.Tk, started: int) -> bool: if not self.observed and not (sys.platform != 'win32'): logger.debug('Starting observer...') - self.observed = self.observer.schedule(self, self.currentdir) + self.observed = cast(BaseObserver, self.observer).schedule(self, self.currentdir) logger.debug('Done') logger.info(f'{(sys.platform != "win32") and "Polling" or "Monitoring"} Dashboard "{self.currentdir}"') diff --git a/debug_webserver.py b/debug_webserver.py index ace82a33b..48f473a4d 100644 --- a/debug_webserver.py +++ b/debug_webserver.py @@ -22,7 +22,7 @@ class LoggingHandler(server.BaseHTTPRequestHandler): """HTTP Handler implementation that logs to EDMCs logger and writes data to files on disk.""" - def __init__(self, request: bytes, client_address: Tuple[str, int], server) -> None: + def __init__(self, request, client_address: Tuple[str, int], server) -> None: super().__init__(request, client_address, server) def log_message(self, format: str, *args: Any) -> None: diff --git a/docs/Killswitches.md b/docs/Killswitches.md index bae03c2db..91eccf9f0 100644 --- a/docs/Killswitches.md +++ b/docs/Killswitches.md @@ -162,13 +162,13 @@ in older versions will simply become unconditional kills in the new version. The current recognised (to EDMC and its internal plugins) killswitch strings are as follows: -| Kill Switch | Supported Plugins | Description | -| :------------------------------------------- | :---------------------: | :---------------------------------------------------------------------------------------- | -| `plugins.eddn.send` | eddn | Disables all use of the send method on EDDN (effectively disables EDDN updates) | -| `plugins..journal` | eddn, inara, edsm, eddb | Disables all journal processing for the plugin | -| `plugins..worker` | edsm, *inara | Disables the plugins worker thread (effectively disables updates) (does not close thread) | -| `plugins..worker.` | edsm, inara | Disables the plugin worker for the given eventname | -| `plugins..journal.event.` | eddn, inara, edsm | Specific events to disable processing for. | +| Kill Switch | Supported Plugins | Description | +| :------------------------------------------- |:-----------------:| :---------------------------------------------------------------------------------------- | +| `plugins.eddn.send` | eddn | Disables all use of the send method on EDDN (effectively disables EDDN updates) | +| `plugins..journal` | eddn, inara, edsm | Disables all journal processing for the plugin | +| `plugins..worker` | edsm, *inara | Disables the plugins worker thread (effectively disables updates) (does not close thread) | +| `plugins..worker.` | edsm, inara | Disables the plugin worker for the given eventname | +| `plugins..journal.event.` | eddn, inara, edsm | Specific events to disable processing for. | Killswitches marked with `*` do **not** support modification of their values via set/redact/delete. And as such any match will simply stop processing. diff --git a/io.edcd.EDMarketConnector.desktop b/io.edcd.EDMarketConnector.desktop index 472c7add4..1fd72ae40 100644 --- a/io.edcd.EDMarketConnector.desktop +++ b/io.edcd.EDMarketConnector.desktop @@ -7,7 +7,7 @@ Name=E:D Market Connector Comment=Utilise Elite Dangerous Journal and CAPI data Icon=io.edcd.EDMarketConnector Categories=Game; -Keywords=Elite;Dangerous;EDDN;EDSM;EDDB;Inara;Spansh; +Keywords=Elite;Dangerous;EDDN;EDSM;Inara;Spansh; Exec=edmarketconnector Terminal=false SingleMainWindow=true diff --git a/monitor.py b/monitor.py index 15cd72c4a..bbbfc190f 100644 --- a/monitor.py +++ b/monitor.py @@ -43,6 +43,7 @@ def _(x: str) -> str: from AppKit import NSWorkspace from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer + from watchdog.observers.api import BaseObserver F_GLOBAL_NOCACHE = 55 elif sys.platform == 'win32': @@ -51,6 +52,7 @@ def _(x: str) -> str: from watchdog.events import FileCreatedEvent, FileSystemEventHandler from watchdog.observers import Observer + from watchdog.observers.api import BaseObserver EnumWindows = ctypes.windll.user32.EnumWindows EnumWindowsProc = ctypes.WINFUNCTYPE(BOOL, HWND, LPARAM) @@ -70,6 +72,7 @@ def _(x: str) -> str: # this isn't ever used, but this will make type checking happy from watchdog.events import FileCreatedEvent from watchdog.observers import Observer + from watchdog.observers.api import BaseObserver # Journal handler @@ -91,7 +94,7 @@ def __init__(self) -> None: self.root: 'tkinter.Tk' = None # type: ignore # Don't use Optional[] - mypy thinks no methods self.currentdir: str | None = None # The actual logdir that we're monitoring self.logfile: str | None = None - self.observer: 'Observer' | None = None + self.observer: BaseObserver | None = None self.observed = None # a watchdog ObservedWatch, or None if polling self.thread: threading.Thread | None = None # For communicating journal entries back to main thread diff --git a/plugins/eddb.py b/plugins/eddb.py deleted file mode 100644 index 5638ddb49..000000000 --- a/plugins/eddb.py +++ /dev/null @@ -1,255 +0,0 @@ -"""Station display and eddb.io lookup.""" -# Tests: -# -# As there's a lot of state tracking in here, need to ensure (at least) -# the URL text and link follow along correctly with: -# -# 1) Game not running, EDMC started. -# 2) Then hit 'Update' for CAPI data pull -# 3) Login fully to game, and whether #2 happened or not: -# a) If docked then update Station -# b) Either way update System -# 4) Undock, SupercruiseEntry, FSDJump should change Station text to 'x' -# and link to system one. -# 5) RequestDocking should populate Station, no matter if the request -# succeeded or not. -# 6) FSDJump should update System text+link. -# 7) Switching to a different provider and then back... combined with -# any of the above in the interim. -# - - -# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# -# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# -# -# This is an EDMC 'core' plugin. -# -# All EDMC plugins are *dynamically* loaded at run-time. -# -# We build for Windows using `py2exe`. -# -# `py2exe` can't possibly know about anything in the dynamically loaded -# core plugins. -# -# Thus you **MUST** check if any imports you add in this file are only -# referenced in this file (or only in any other core plugin), and if so... -# -# YOU MUST ENSURE THAT PERTINENT ADJUSTMENTS ARE MADE IN -# `Build-exe-and-msi.py` SO AS TO ENSURE THE FILES ARE ACTUALLY PRESENT IN -# AN END-USER INSTALLATION ON WINDOWS. -# -# -# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# -# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# ! $# -import tkinter -from typing import TYPE_CHECKING, Any, Mapping - -import requests - -import EDMCLogging -import killswitch -import plug -from companion import CAPIData -from config import appname, config - -if TYPE_CHECKING: - from tkinter import Tk - - def _(x: str) -> str: - return x - -logger = EDMCLogging.get_main_logger() - - -class This: - """Holds module globals.""" - - STATION_UNDOCKED: str = '×' # "Station" name to display when not docked = U+00D7 - - def __init__(self) -> None: - # Main window clicks - self.system_link: tkinter.Widget - self.system_name: str | None = None - self.system_address: str | None = None - self.system_population: int | None = None - self.station_link: tkinter.Widget - self.station_name: str | None = None - self.station_marketid: int | None = None - self.on_foot = False - - -this = This() - - -def system_url(system_name: str) -> str: - """ - Construct an appropriate EDDB.IO URL for the provided system. - - :param system_name: Will be overridden with `this.system_address` if that - is set. - :return: The URL, empty if no data was available to construct it. - """ - if this.system_address: - return requests.utils.requote_uri(f'https://eddb.io/system/ed-address/{this.system_address}') - - if system_name: - return requests.utils.requote_uri(f'https://eddb.io/system/name/{system_name}') - - return '' - - -def station_url(system_name: str, station_name: str) -> str: - """ - Construct an appropriate EDDB.IO URL for a station. - - Ignores `station_name` in favour of `this.station_marketid`. - - :param system_name: Name of the system the station is in. - :param station_name: **NOT USED** - :return: The URL, empty if no data was available to construct it. - """ - if this.station_marketid: - return requests.utils.requote_uri(f'https://eddb.io/station/market-id/{this.station_marketid}') - - return system_url(system_name) - - -def plugin_start3(plugin_dir: str) -> str: - """ - Start the plugin. - - :param plugin_dir: NAme of directory this was loaded from. - :return: Identifier string for this plugin. - """ - return 'eddb' - - -def plugin_app(parent: 'Tk'): - """ - Construct this plugin's main UI, if any. - - :param parent: The tk parent to place our widgets into. - :return: See PLUGINS.md#display - """ - # system label in main window - this.system_link = parent.nametowidget(f".{appname.lower()}.system") - this.system_name = None - this.system_address = None - this.station_name = None - this.station_marketid = None # Frontier MarketID - # station label in main window - this.station_link = parent.nametowidget(f".{appname.lower()}.station") - this.station_link['popup_copy'] = lambda x: x != this.STATION_UNDOCKED - - -def prefs_changed(cmdr: str, is_beta: bool) -> None: - """ - Update any saved configuration after Settings is closed. - - :param cmdr: Name of Commander. - :param is_beta: If game beta was detected. - """ - # Do *NOT* set 'url' here, as it's set to a function that will call - # through correctly. We don't want a static string. - pass - - -def journal_entry( - cmdr: str, is_beta: bool, system: str, station: str, - entry: dict[str, Any], - state: Mapping[str, Any] -): - """ - Handle a new Journal event. - - :param cmdr: Name of Commander. - :param is_beta: Whether game beta was detected. - :param system: Name of current tracked system. - :param station: Name of current tracked station location. - :param entry: The journal event. - :param state: `monitor.state` - :return: None if no error, else an error string. - """ - should_return: bool - new_entry: dict[str, Any] = {} - - should_return, new_entry = killswitch.check_killswitch('plugins.eddb.journal', entry) - if should_return: - # LANG: Journal Processing disabled due to an active killswitch - plug.show_error(_('EDDB Journal processing disabled. See Log.')) - return - - should_return, new_entry = killswitch.check_killswitch(f'plugins.eddb.journal.event.{entry["event"]}', new_entry) - if should_return: - return - - this.on_foot = state['OnFoot'] - this.system_address = state['SystemAddress'] - this.system_name = state['SystemName'] - this.system_population = state['SystemPopulation'] - this.station_name = state['StationName'] - this.station_marketid = state['MarketID'] - - # Only change URL text if we are current provider. - if config.get_str('station_provider') == 'eddb': - this.system_link['text'] = this.system_name - # Do *NOT* set 'url' here, as it's set to a function that will call - # through correctly. We don't want a static string. - this.system_link.update_idletasks() - - if this.station_name: - this.station_link['text'] = this.station_name - - else: - if this.system_population is not None and this.system_population > 0: - this.station_link['text'] = this.STATION_UNDOCKED - - else: - this.station_link['text'] = '' - - # Do *NOT* set 'url' here, as it's set to a function that will call - # through correctly. We don't want a static string. - this.station_link.update_idletasks() - - -def cmdr_data(data: CAPIData, is_beta: bool) -> str | None: - """ - Process new CAPI data. - - :param data: The latest merged CAPI data. - :param is_beta: Whether game beta was detected. - :return: Optional error string. - """ - # Always store initially, even if we're not the *current* system provider. - if not this.station_marketid and data['commander']['docked']: - this.station_marketid = data['lastStarport']['id'] - - # Only trust CAPI if these aren't yet set - if not this.system_name: - this.system_name = data['lastSystem']['name'] - - if not this.station_name and data['commander']['docked']: - this.station_name = data['lastStarport']['name'] - - # Override standard URL functions - if config.get_str('system_provider') == 'eddb': - this.system_link['text'] = this.system_name - # Do *NOT* set 'url' here, as it's set to a function that will call - # through correctly. We don't want a static string. - this.system_link.update_idletasks() - - if config.get_str('station_provider') == 'eddb': - if data['commander']['docked'] or this.on_foot and this.station_name: - this.station_link['text'] = this.station_name - - elif data['lastStarport']['name'] and data['lastStarport']['name'] != "": - this.station_link['text'] = this.STATION_UNDOCKED - - else: - this.station_link['text'] = '' - - # Do *NOT* set 'url' here, as it's set to a function that will call - # through correctly. We don't want a static string. - this.station_link.update_idletasks() - - return '' diff --git a/plugins/eddn.py b/plugins/eddn.py index 4577aba5a..c7c5ca3e7 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -692,8 +692,8 @@ def export_commodities(self, data: CAPIData, is_beta: bool) -> None: # noqa: CC # not send an empty commodities list, as the EDDN Schema doesn't allow # it (as of 2020-09-28). # BUT, Fleet Carriers can go from having buy/sell orders to having - # none and that really does need to be recorded over EDDN so that, e.g. - # EDDB can update in a timely manner. + # none and that really does need to be recorded over EDDN so that + # tools can update in a timely manner. if this.commodities != commodities: message: OrderedDictT[str, Any] = OrderedDict([ ('timestamp', data['timestamp']), @@ -929,8 +929,8 @@ def export_journal_commodities(self, cmdr: str, is_beta: bool, entry: Mapping[st # not send an empty commodities list, as the EDDN Schema doesn't allow # it (as of 2020-09-28). # BUT, Fleet Carriers can go from having buy/sell orders to having - # none and that really does need to be recorded over EDDN so that, e.g. - # EDDB can update in a timely manner. + # none and that really does need to be recorded over EDDN so that + # tools can update in a timely manner. if this.commodities != commodities: self.send_message(cmdr, { '$schemaRef': f'https://eddn.edcd.io/schemas/commodity/3{"/test" if is_beta else ""}', diff --git a/prefs.py b/prefs.py index 48d049750..d10ab29ed 100644 --- a/prefs.py +++ b/prefs.py @@ -625,7 +625,7 @@ def __setup_config_tab(self, notebook: ttk.Notebook) -> None: # noqa: CCR001 with row as cur_row: station_provider = config.get_str('station_provider') self.station_provider = tk.StringVar( - value=str(station_provider if station_provider in plug.provides('station_url') else 'eddb') + value=str(station_provider if station_provider in plug.provides('station_url') else 'edsm') ) # LANG: Configuration - Label for selection of 'Station' provider website diff --git a/requirements-dev.txt b/requirements-dev.txt index b7189c535..d9ad4abec 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,51 +5,51 @@ wheel # We can't rely on just picking this up from either the base (not venv), # or venv-init-time version. Specify here so that dependabot will prod us # about new versions. -setuptools==66.0.0 +setuptools==68.0.0 # Static analysis tools flake8==6.0.0 flake8-annotations-coverage==0.0.6 flake8-cognitive-complexity==0.1.0 -flake8-comprehensions==3.10.1 -flake8-docstrings==1.6.0 -isort==5.11.4 +flake8-comprehensions==3.14.0 +flake8-docstrings==1.7.0 +isort==5.12.0 flake8-isort==6.0.0 -flake8-json==21.7.0 -flake8-noqa==1.3.0 +flake8-json==23.7.0 +flake8-noqa==1.3.2 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 -mypy==0.991 +mypy==1.4.1 pep8-naming==0.13.3 safety==2.3.5 -types-requests==2.28.11.7 +types-requests==2.31.0.2 types-pkg-resources==0.1.3 # Code formatting tools -autopep8==2.0.1 +autopep8==2.0.2 # Git pre-commit checking -pre-commit==2.21.0 +pre-commit==3.3.3 # HTML changelogs grip==4.6.1 # Packaging # Used to put together a WiX configuration from template/auto-gen -lxml==4.9.2 +lxml==4.9.3 # We only need py2exe on windows. # Pre-release version addressing semantic_version 2.9.0+ issues: # py2exe==0.13.0.0; sys_platform == 'win32' # Testing -pytest==7.2.1 -pytest-cov==4.0.0 # Pytest code coverage support -coverage[toml]==7.0.5 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs -coverage-conditional-plugin==0.8.0 +pytest==7.4.0 +pytest-cov==4.1.0 # Pytest code coverage support +coverage[toml]==7.2.7 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs +coverage-conditional-plugin==0.9.0 # For manipulating folder permissions and the like. -pywin32==305; sys_platform == 'win32' +pywin32==306; sys_platform == 'win32' # All of the normal requirements diff --git a/requirements.txt b/requirements.txt index 069eb227d..4f35c1406 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ -certifi==2022.12.7 -requests==2.28.2 +certifi==2023.7.22 +requests==2.31.0 # requests depends on this now ? charset-normalizer==2.1.1 -watchdog==2.2.1 +watchdog==3.0.0 # Commented out because this doesn't package well with py2exe infi.systray==0.1.12; sys_platform == 'win32' # argh==0.26.2 watchdog dep diff --git a/scripts/killswitch_test.py b/scripts/killswitch_test.py index b6874e508..b85b341e8 100644 --- a/scripts/killswitch_test.py +++ b/scripts/killswitch_test.py @@ -23,10 +23,6 @@ 'plugins.eddn.send', 'plugins.eddn.journal', 'plugins.eddn.journal.event.$event', - - # eddb - 'plugins.eddb.journal', - 'plugins.eddb.journal.event.$event' ] SPLIT_KNOWN_NAMES = [x.split('.') for x in KNOWN_KILLSWITCH_NAMES] diff --git a/wix/static-EDMarketConnector.wxs b/wix/static-EDMarketConnector.wxs index d19dfa670..a0178579a 100644 --- a/wix/static-EDMarketConnector.wxs +++ b/wix/static-EDMarketConnector.wxs @@ -543,9 +543,6 @@ - - - @@ -709,7 +706,6 @@ -