Skip to content

Commit

Permalink
Merge pull request #2032 from EDCD/enhancement/2031/remove-eddb-code
Browse files Browse the repository at this point in the history
#2031 Remove EDDB Code
# Added
- Imported temporary type hints per gorakhargosh/watchdog#982

# Changed
- A few defaults for URL settings
- Updated Dependencies to latest working versions
- Minor documentation updates

# Removed
- Removes EDDB Plugin and References
  • Loading branch information
C1701D committed Jul 23, 2023
2 parents d633795 + bd822f7 commit 5131f82
Show file tree
Hide file tree
Showing 30 changed files with 49 additions and 355 deletions.
1 change: 0 additions & 1 deletion Build-exe-and-msi.py
Expand Up @@ -70,7 +70,6 @@
APPCMD = 'EDMC.py'
PLUGINS = [
'plugins/coriolis.py',
'plugins/eddb.py',
'plugins/eddn.py',
'plugins/edsm.py',
'plugins/edsy.py',
Expand Down
6 changes: 3 additions & 3 deletions EDMarketConnector.py
Expand Up @@ -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."
)

###########################################################################
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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']
)

Expand Down
3 changes: 0 additions & 3 deletions L10n/cs.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/de.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/en.template
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/es.strings
Expand Up @@ -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";

Expand Down
6 changes: 0 additions & 6 deletions L10n/fi.strings
Expand Up @@ -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";

Expand All @@ -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...";

Expand Down
3 changes: 0 additions & 3 deletions L10n/it.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/ja.strings
Expand Up @@ -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に接続できません";

Expand Down
3 changes: 0 additions & 3 deletions L10n/ko.strings
Expand Up @@ -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에 연결할 수 없음";

Expand Down
7 changes: 2 additions & 5 deletions L10n/pl.strings
Expand Up @@ -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";

Expand All @@ -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...";
Expand All @@ -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}";
Expand Down
3 changes: 0 additions & 3 deletions L10n/pt-BR.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/pt-PT.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/ru.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/sr-Latn-BA.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/sr-Latn.strings
Expand Up @@ -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";

Expand Down
3 changes: 0 additions & 3 deletions L10n/zh-Hans.strings
Expand Up @@ -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";

Expand Down
2 changes: 1 addition & 1 deletion config/__init__.py
Expand Up @@ -52,7 +52,7 @@
# <https://semver.org/#semantic-versioning-specification-semver>
# 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'

Expand Down
9 changes: 6 additions & 3 deletions dashboard.py
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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}"')
Expand Down
2 changes: 1 addition & 1 deletion debug_webserver.py
Expand Up @@ -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:
Expand Down
14 changes: 7 additions & 7 deletions docs/Killswitches.md
Expand Up @@ -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.<plugin>.journal` | eddn, inara, edsm, eddb | Disables all journal processing for the plugin |
| `plugins.<plugin>.worker` | edsm, *inara | Disables the plugins worker thread (effectively disables updates) (does not close thread) |
| `plugins.<plugin>.worker.<eventname>` | edsm, inara | Disables the plugin worker for the given eventname |
| `plugins.<plugin>.journal.event.<eventname>` | 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.<plugin>.journal` | eddn, inara, edsm | Disables all journal processing for the plugin |
| `plugins.<plugin>.worker` | edsm, *inara | Disables the plugins worker thread (effectively disables updates) (does not close thread) |
| `plugins.<plugin>.worker.<eventname>` | edsm, inara | Disables the plugin worker for the given eventname |
| `plugins.<plugin>.journal.event.<eventname>` | 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.
Expand Down
2 changes: 1 addition & 1 deletion io.edcd.EDMarketConnector.desktop
Expand Up @@ -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
5 changes: 4 additions & 1 deletion monitor.py
Expand Up @@ -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':
Expand All @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5131f82

Please sign in to comment.