diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index 163e904f..50962bbd 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -126,6 +126,10 @@ jobs: with: filepath: './EDMC_Installer_Config.iss' + - name: Rename Installer + run: | + Get-ChildItem -Path . -Filter "EDMarketConnector_Installer_*.exe" | Rename-Item -NewName {"EDMarketConnector_Installer_Unsigned_$($_.Name -replace '^EDMarketConnector_Installer_', '')"} + - name: Upload build files uses: actions/upload-artifact@v3 with: diff --git a/ChangeLog.md b/ChangeLog.md index 0ff76f1a..e4932683 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,38 +1,51 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in reverse chronological order (latest first). --- - -Copyrights +* We currently test against, and package with, Python 3.11.7, 32-bit. + * As a result, we do not support Windows 7, 8, or 8.1. + * Developers can check the contents of the `.python-version` file + in the source (not distributed with the Windows installer) for the + currently used version. +--- +Release 5.10.2 === -Please see the [docs/Licenses](docs/Licenses/) directory for copies of any -licenses for software we use with EDMarketConnector, either at runtime, or to -produce the Windows executables and installer. +This release contains updated dependencies, some bug fixes, a few minor enhancements to some supporting files, +and some resorted resources as well as a new image for some of the built EXEs. ---- +We now sign our code! This does mean that built EXEs are now slightly modified on our developer's machines. +For information on what this means, and opt-out options, please visit https://github.com/EDCD/EDMarketConnector/wiki/Code-Signing-and-EDMC -* We now test against, and package with, Python 3.11.7, 32-bit. +**Changes and Enhancements** +* Added additional logging to the Python build string in the case of missing files +* Added a new icon to EDMC's Command-Line EXE +* Added additional logging to the build system +* Updated several dependencies +* Updated FDEV IDs +* Updated relevant copyright dates +* Updated automatic build script to support code signing workflow +* Updated translations to the latest versions +* Moved a few unused files to the resources folder. These files have no references in the code - **As a consequence of this we no longer support Windows 7. - This is due to - [Python 3.10.x and later not supporting Windows 7](https://www.python.org/downloads/windows/). - The application (both EDMarketConnector.exe and EDMC.exe) will crash on - startup due to a missing DLL.** +**Bug Fixes** +* Fixed a bug that could cause EDMC to handle SIGINT signals improperly +* Fixed a bug that could result in URL providers to be set to invalid values +* Fixed a bug that could result in Coriolis URL providers to revert back to "Auto" on language translations +* Fixed a bug where Inara didn't understand being blown up by a Thargoid, and blew itself up instead +* Fixed a printing issue for the localization system for unused strings - As [Windows 8.1 is now End-Of-Life](https://learn.microsoft.com/en-us/lifecycle/faq/windows#windows-8-1) - we no longer explicitly support it, but for the time being it will likely - continue to work. This is dependent on future Python releases not dropping - support for Windows 8.1 in a manner that prevents it working. Any bug report - made against Windows 8.1 use may be ignored unless reproduced on a supported - OS. +**Removed Files** +* Removed two unused manifest and MacOS icon files which are no longer in use. - This should have no other impact on users or plugin developers, other - than the latter now being free to use features that were introduced since the - Python 3.7 series. +**Known Issues** +* Some users of TCE have reported issues with newer versions of EDMC with TCE. + * We have been unable to replicate this issue. If you are able to assist, please + add your information here: https://github.com/EDCD/EDMarketConnector/issues/2176 - Developers can check the contents of the `.python-version` file - in the source (it's not distributed with the Windows installer) for the - currently used version in a given branch. +**Plugin Developers** +* modules.p and ships.p are deprecated, and slated +for removal in the next major release! Please look for that change coming soon. +* Note to plugin developers: The `openurl()` function in ttkHyperlinkLabel has been deprecated, +and slated for removal in the next major release! Please migrate to `webbrowser.open()`. ---- Release 5.10.1 === This release contains a number of bugfixes, minor performance enhancements, diff --git a/EDMarketConnector.VisualElementsManifest.xml b/EDMarketConnector.VisualElementsManifest.xml deleted file mode 100644 index f0088658..00000000 --- a/EDMarketConnector.VisualElementsManifest.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - diff --git a/EDMarketConnector.icns b/EDMarketConnector.icns deleted file mode 100644 index bdc87423..00000000 Binary files a/EDMarketConnector.icns and /dev/null differ diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 690300e6..8fcab4ba 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -353,7 +353,12 @@ if __name__ == '__main__': # noqa: C901 button = ttk.Button(frame, text='OK', command=lambda: sys.exit(0)) button.grid(row=2, column=0, sticky=tk.S) - root.mainloop() + try: + root.mainloop() + except KeyboardInterrupt: + logger.info("Ctrl+C Detected, Attempting Clean Shutdown") + sys.exit() + logger.info('Exiting') journal_lock = JournalLock() locked = journal_lock.obtain_lock() @@ -802,6 +807,9 @@ class AppWindow: self.w.bind_all('<>', self.auth) # cAPI auth self.w.bind_all('<>', self.onexit) # Updater + # Check for Valid Providers + validate_providers() + # Start a protocol handler to handle cAPI registration. Requires main loop to be running. self.w.after_idle(lambda: protocol.protocolhandler.start(self.w)) @@ -2110,6 +2118,51 @@ def show_killswitch_poppup(root=None): ok_button.grid(columnspan=2, sticky=tk.EW) +def validate_providers(): + """Check if Config has an invalid provider set, and reset to default if we do.""" + reset_providers = {} + station_provider: str = config.get_str("station_provider") + if station_provider not in plug.provides('station_url'): + logger.error("Station Provider Not Valid. Setting to Default.") + config.set('station_provider', 'EDSM') + reset_providers["Station"] = (station_provider, "EDSM") + + shipyard_provider: str = config.get_str("shipyard_provider") + if shipyard_provider not in plug.provides('shipyard_url'): + logger.error("Shipyard Provider Not Valid. Setting to Default.") + config.set('shipyard_provider', 'EDSY') + reset_providers["Shipyard"] = (shipyard_provider, "EDSY") + + system_provider: str = config.get_str("system_provider") + if system_provider not in plug.provides('system_url'): + logger.error("System Provider Not Valid. Setting to Default.") + config.set('system_provider', 'EDSM') + reset_providers["System"] = (system_provider, "EDSM") + + if not reset_providers: + return + + # LANG: Popup-text about Reset Providers + popup_text = _(r'One or more of your URL Providers were invalid, and have been reset:\r\n\r\n') + for provider in reset_providers: + # LANG: Text About What Provider Was Reset + popup_text += _(r'{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n') + popup_text = popup_text.format( + PROVIDER=provider, + OLDPROV=reset_providers[provider][0], + NEWPROV=reset_providers[provider][1] + ) + # And now we do need these to be actual \r\n + popup_text = popup_text.replace('\\n', '\n') + popup_text = popup_text.replace('\\r', '\r') + + tk.messagebox.showinfo( + # LANG: Popup window title for Reset Providers + _('EDMC: Default Providers Reset'), + popup_text + ) + + # Run the app if __name__ == "__main__": # noqa: C901 logger.info(f'Startup v{appversion()} : Running on Python v{sys.version}') @@ -2365,6 +2418,9 @@ sys.path: {sys.path}''' # Check for FDEV IDs root.after(3, check_fdev_ids) # Start the main event loop - root.mainloop() - + try: + root.mainloop() + except KeyboardInterrupt: + logger.info("Ctrl+C Detected, Attempting Clean Shutdown") + app.onexit() logger.info('Exiting') diff --git a/FDevIDs b/FDevIDs index 069b09b1..7205c793 160000 --- a/FDevIDs +++ b/FDevIDs @@ -1 +1 @@ -Subproject commit 069b09b1afbd2001248ad93b1481d6f6a309c6f5 +Subproject commit 7205c79331f42c1a28b757b27467f79ff106716b diff --git a/L10n/en.template b/L10n/en.template index 3aed0952..14bbf10d 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -231,6 +231,15 @@ /* EDMarketConnector.py: Popup-text about 'broken' plugins that failed to load; In files: EDMarketConnector.py:2266; */ "One or more of your enabled plugins failed to load. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. This could be caused by a wrong folder structure. The load.py file should be located under plugins/PLUGIN_NAME/load.py.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "One or more of your enabled plugins failed to load. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. This could be caused by a wrong folder structure. The load.py file should be located under plugins/PLUGIN_NAME/load.py.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name."; +/* EDMarketConnector.py: Popup-text about Reset Providers; In files: EDMarketConnector.py:2146; */ +"One or more of your URL Providers were invalid, and have been reset:\r\n\r\n" = "One or more of your URL Providers were invalid, and have been reset:\r\n\r\n"; + +/* EDMarketConnector.py: Text About What Provider Was Reset; In files: EDMarketConnector.py:2148; */ +"{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n" = "{PROVIDER} was set to {OLDPROV}, and has been reset to {NEWPROV}\r\n"; + +/* EDMarketConnector.py: Popup window title for Reset Providers; In files: EDMarketConnector.py:2161; */ +"EDMC: Default Providers Reset" = "EDMC: Default Providers Reset"; + /* journal_lock.py: Title text on popup when Journal directory already locked; In files: journal_lock.py:208; */ "Journal directory already locked" = "Journal directory already locked"; @@ -246,13 +255,13 @@ /* 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" = "Default"; -/* coriolis.py: 'Auto' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - auto; In files: coriolis.py:74; coriolis.py:77; coriolis.py:123; coriolis.py:139; coriolis.py:145; */ +/* coriolis.py: 'Auto' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - auto; In files: coriolis.py:48; coriolis.py:74; coriolis.py:77; coriolis.py:94; coriolis.py:123; coriolis.py:139; coriolis.py:145; coriolis.py:179; coriolis.py:182; */ "Auto" = "Auto"; -/* coriolis.py: 'Normal' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - normal; In files: coriolis.py:75; coriolis.py:121; coriolis.py:137; */ +/* coriolis.py: 'Normal' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - normal; In files: coriolis.py:49; coriolis.py:75; coriolis.py:95; coriolis.py:121; coriolis.py:137; coriolis.py:180; */ "Normal" = "Normal"; -/* coriolis.py: 'Beta' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - beta; In files: coriolis.py:76; coriolis.py:122; coriolis.py:138; */ +/* coriolis.py: 'Beta' label for Coriolis site override selection; coriolis.py: Coriolis normal/beta selection - beta; In files: coriolis.py:50; coriolis.py:76; coriolis.py:96; coriolis.py:122; coriolis.py:138; coriolis.py:181; */ "Beta" = "Beta"; /* coriolis.py: Settings>Coriolis: Help/hint for changing coriolis URLs; In files: coriolis.py:91:93; */ diff --git a/L10n/it.strings b/L10n/it.strings index a9d11049..e5f6ece6 100644 --- a/L10n/it.strings +++ b/L10n/it.strings @@ -1,3 +1,11 @@ +/* edsm.py:Settings>EDSM - Label on checkbox for 'send data'; In files: edsm.py:316; */ +"Send flight log and CMDR status to EDSM" = "Invia il registro di volo e lo stato del CMDR a EDSM"; + +/* prefs.py:Label on button used to open a filesystem folder; In files: prefs.py:706; */ +"Open Log Folder" = "Cartella Log"; + +/* inara.py:Text Inara Show API key; In files: inara.py:305; */ +"Show API Key" = "Mostra API Key"; /* Language name */ "!Language" = "Italiano"; @@ -205,12 +213,24 @@ /* EDMarketConnector.py: Popup-text about 'active' plugins without Python 3.x support; In files: EDMarketConnector.py:2253:2259; */ "One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. You should check if there is an updated version available, else alert the developer that they need to update the code for Python 3.x.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "Uno o più dei tuoi plugin non ha ancora il supporto per Python 3.x. Per favore guarda la lista '{PLUGINS}' nella tab a '{FILE}' > '{SETTINGS}'. Dovresti controllare se ci sono aggiornamenti, altrimenti avvisa gli sviluppatori che devono aggiornare il codice a Python 3.x.\n\nPuoi disabilitare il plugin rinominando la cartella aggiungendo '{DISABLED}' alla fine del nome."; +/* EDMarketConnector.py: Popup-text about missing FDEVID Files; In files: EDMarketConnector.py:2329; */ +"FDevID Files not found! Some functionality regarding commodities may be disabled.\r\n\r\n Do you want to open the Wiki page on how to set up submodules?" = "File FDevID non trovati! Alcune funzionalità relative alle commodities potrebbero essere disabilitate.\n\n Vuoi aprire la pagina Wiki su come impostare i sottomoduli?"; + +/* EDMarketConnector.py: Popup window title for missing FDEVID files; In files: EDMarketConnector.py:2340; */ +"FDevIDs: Missing Commodity Files" = "FDevID: file delle Commodity mancanti"; + /* EDMarketConnector.py: Settings > Plugins tab; prefs.py: Label on Settings > Plugins tab; In files: EDMarketConnector.py:2263; prefs.py:986; */ "Plugins" = "Plugins"; /* EDMarketConnector.py: Popup window title for list of 'enabled' plugins that don't work with Python 3.x; In files: EDMarketConnector.py:2274; */ "EDMC: Plugins Without Python 3.x Support" = "EDMC: Plugins senza Supporto Python 3.x"; +/* EDMarketConnector.py: Popup window title for list of 'broken' plugins that failed to load; In files: EDMarketConnector.py:2285; */ +"EDMC: Broken Plugins" = "EDMC: plugin non funzionanti"; + +/* EDMarketConnector.py: Popup-text about 'broken' plugins that failed to load; In files: EDMarketConnector.py:2266; */ +"One or more of your enabled plugins failed to load. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. This could be caused by a wrong folder structure. The load.py file should be located under plugins/PLUGIN_NAME/load.py.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "Impossibile caricare uno o più plugin abilitati. Consulta l'elenco nella scheda '{PLUGINS}' di '{FILE}' > '{SETTINGS}'. Ciò potrebbe essere causato da un'errata struttura delle cartelle. Il file load.py dovrebbe trovarsi in plugins/PLUGIN_NAME/load.py.\n\nPuoi disabilitare un plugin rinominando la sua cartella in modo che abbia '{DISABLED}' alla fine del nome."; + /* journal_lock.py: Title text on popup when Journal directory already locked; In files: journal_lock.py:208; */ "Journal directory already locked" = "cartella Journal già bloccata"; @@ -463,6 +483,9 @@ /* prefs.py: Plugins - Label on URL to documentation about migrating plugins from Python 2.7; In files: prefs.py:962; */ "Information on migrating plugins" = "Informazioni sulla migrazione dei plugins"; +/* prefs.py: Plugins - Label for list of 'broken' plugins that failed to load; In files: prefs.py:1039; */ +"Broken Plugins" = "Plugin non funzionanti"; + /* prefs.py: Lable on list of user-disabled plugins; In files: prefs.py:977; */ "Disabled Plugins" = "Plugin disabilitati"; diff --git a/L10n/sr-Latn.strings b/L10n/sr-Latn.strings index 5f2c01c5..83da541a 100644 --- a/L10n/sr-Latn.strings +++ b/L10n/sr-Latn.strings @@ -213,12 +213,24 @@ /* EDMarketConnector.py: Popup-text about 'active' plugins without Python 3.x support; In files: EDMarketConnector.py:2253:2259; */ "One or more of your enabled plugins do not yet have support for Python 3.x. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. You should check if there is an updated version available, else alert the developer that they need to update the code for Python 3.x.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "Jedan ili više aktiviranih dodataka (plugins) nemaju podršku za Python 3.x. Pogledajte listu u '{PLUGINS}' tabu u '{FILE}' > '{SETTINGS}'. Proverite da li postoji nadograđena verzija ili obavesite autora da treba da promeni kod za Python 3.x.\n\nMožete deaktivirati dodatak (plugin) dodavanjem '{DISABLED}' na kraju imena njegovog foldera."; +/* EDMarketConnector.py: Popup-text about missing FDEVID Files; In files: EDMarketConnector.py:2329; */ +"FDevID Files not found! Some functionality regarding commodities may be disabled.\r\n\r\n Do you want to open the Wiki page on how to set up submodules?" = "FDevID fajlovi nisu pronađeni! Neke funkcionalnosti vezane za artikle će možda biti deaktivirane.\n\nDa li želite da otvorite Wiki stranu koja objašnjava kako da podesite pod-module?"; + +/* EDMarketConnector.py: Popup window title for missing FDEVID files; In files: EDMarketConnector.py:2340; */ +"FDevIDs: Missing Commodity Files" = "FDevIDs: Nedostaju fajlovi za robu"; + /* EDMarketConnector.py: Settings > Plugins tab; prefs.py: Label on Settings > Plugins tab; In files: EDMarketConnector.py:2263; prefs.py:986; */ "Plugins" = "Dodaci (plugins)"; /* EDMarketConnector.py: Popup window title for list of 'enabled' plugins that don't work with Python 3.x; In files: EDMarketConnector.py:2274; */ "EDMC: Plugins Without Python 3.x Support" = "EDMC: Dodaci (plugins) bez Python 3.x podrške"; +/* EDMarketConnector.py: Popup window title for list of 'broken' plugins that failed to load; In files: EDMarketConnector.py:2285; */ +"EDMC: Broken Plugins" = "EDMC: Pokvareni Pluginovi"; + +/* EDMarketConnector.py: Popup-text about 'broken' plugins that failed to load; In files: EDMarketConnector.py:2266; */ +"One or more of your enabled plugins failed to load. Please see the list on the '{PLUGINS}' tab of '{FILE}' > '{SETTINGS}'. This could be caused by a wrong folder structure. The load.py file should be located under plugins/PLUGIN_NAME/load.py.\r\n\r\nYou can disable a plugin by renaming its folder to have '{DISABLED}' on the end of the name." = "Jedan ili više vaših aktivnih pluginova se nije učitao. Molimo pogledajte listu na '{PLUGINS}' tabu u okviru '{FILE}' > '{SETTINGS}'. Obo vi moglo da se desi zbog pogrešne strukture foldera. load.py fajl bi trebao da se nalazi unutar plugins/PLUGIN_NAME/load.py.\n\nPojedinačni plugin možete deaktivirati promenom imena njegovog foldera dodavanjem '{DISABLED}' na kraju."; + /* journal_lock.py: Title text on popup when Journal directory already locked; In files: journal_lock.py:208; */ "Journal directory already locked" = "Žurnal direktorijum je već zaključan"; @@ -471,6 +483,9 @@ /* prefs.py: Plugins - Label on URL to documentation about migrating plugins from Python 2.7; In files: prefs.py:962; */ "Information on migrating plugins" = "Informacije o migraciji dodataka (plugins)"; +/* prefs.py: Plugins - Label for list of 'broken' plugins that failed to load; In files: prefs.py:1039; */ +"Broken Plugins" = "Pokvareni pluginovi"; + /* prefs.py: Lable on list of user-disabled plugins; In files: prefs.py:977; */ "Disabled Plugins" = "Deaktivirani dodaci (plugins)"; diff --git a/README.md b/README.md index 1d297395..600df075 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,6 @@ Please see the [Acknowledgements](https://github.com/EDCD/EDMarketConnector/wiki License ------- -Copyright © 2015-2019 Jonathan Harris, 2020-2021 EDCD +Copyright © 2015-2019 Jonathan Harris, 2020-2024 EDCD Licensed under the [GNU Public License (GPL)](http://www.gnu.org/licenses/gpl-2.0.html) version 2 or later. diff --git a/build.py b/build.py index a86689a7..1bc96765 100644 --- a/build.py +++ b/build.py @@ -80,8 +80,8 @@ def generate_data_files( "modules.json", "ships.json", "ships.p", # TODO: Remove in 6.0 - f"{app_name}.VisualElementsManifest.xml", f"{app_name}.ico", + f"resources/{appcmdname}.ico", "EDMarketConnector - TRACE.bat", "EDMarketConnector - localserver-auth.bat", "EDMarketConnector - reset-ui.bat", @@ -165,15 +165,16 @@ def build() -> None: "script": "EDMarketConnector.py", "icon_resources": [(0, f"{appname}.ico")], "other_resources": [ - (24, 1, pathlib.Path(f"{appname}.manifest").read_text(encoding="UTF8")) + (24, 1, pathlib.Path(f"resources/{appname}.manifest").read_text(encoding="UTF8")) ], } console_config: dict = { "dest_base": appcmdname, "script": "EDMC.py", + "icon_resources": [(0, f"resources/{appcmdname}.ico")], "other_resources": [ - (24, 1, pathlib.Path(f"{appcmdname}.manifest").read_text(encoding="UTF8")) + (24, 1, pathlib.Path(f"resources/{appcmdname}.manifest").read_text(encoding="UTF8")) ], } @@ -185,7 +186,8 @@ def build() -> None: data_files=data_files, options=options, ) - except FileNotFoundError: + except FileNotFoundError as err: + print(err) sys.exit( "Build Failed due to Missing Files! Have you set up your submodules? \n" "https://github.com/EDCD/EDMarketConnector/wiki/Running-from-source" diff --git a/config/__init__.py b/config/__init__.py index 7e5025a6..0d16693c 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -54,10 +54,10 @@ appcmdname = 'EDMC' # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.10.1' +_static_appversion = '5.10.2' _cached_version: semantic_version.Version | None = None -copyright = '© 2015-2019 Jonathan Harris, 2020-2023 EDCD' +copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' update_feed = 'https://raw.githubusercontent.com/EDCD/EDMarketConnector/releases/edmarketconnector.xml' update_interval = 8*60*60 # 8 Hours diff --git a/plugins/coriolis.py b/plugins/coriolis.py index 9de635d0..c142c686 100644 --- a/plugins/coriolis.py +++ b/plugins/coriolis.py @@ -45,6 +45,9 @@ class CoriolisConfig: self.normal_url = '' self.beta_url = '' self.override_mode = '' + self.override_text_old_auto = _('Auto') # LANG: Coriolis normal/beta selection - auto + self.override_text_old_normal = _('Normal') # LANG: Coriolis normal/beta selection - normal + self.override_text_old_beta = _('Beta') # LANG: Coriolis normal/beta selection - beta self.normal_textvar = tk.StringVar() self.beta_textvar = tk.StringVar() @@ -87,6 +90,11 @@ def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Fr PADY = 1 # noqa: N806 BOXY = 2 # noqa: N806 # box spacing + # Save the old text values for the override mode, so we can update them if the language is changed + coriolis_config.override_text_old_auto = _('Auto') # LANG: Coriolis normal/beta selection - auto + coriolis_config.override_text_old_normal = _('Normal') # LANG: Coriolis normal/beta selection - normal + coriolis_config.override_text_old_beta = _('Beta') # LANG: Coriolis normal/beta selection - beta + conf_frame = nb.Frame(parent) conf_frame.columnconfigure(index=1, weight=1) cur_row = 0 @@ -157,6 +165,25 @@ def prefs_changed(cmdr: str | None, is_beta: bool) -> None: _('Auto'): 'auto', # LANG: Coriolis normal/beta selection - auto }.get(coriolis_config.override_mode, coriolis_config.override_mode) + # Check if the language was changed and the override_mode was valid before the change + if coriolis_config.override_mode not in ('beta', 'normal', 'auto'): + coriolis_config.override_mode = { + coriolis_config.override_text_old_normal: 'normal', + coriolis_config.override_text_old_beta: 'beta', + coriolis_config.override_text_old_auto: 'auto', + }.get(coriolis_config.override_mode, coriolis_config.override_mode) + # Language was seemingly changed, so we need to update the textvars + if coriolis_config.override_mode in ('beta', 'normal', 'auto'): + coriolis_config.override_textvar.set( + value={ + 'auto': _('Auto'), # LANG: 'Auto' label for Coriolis site override selection + 'normal': _('Normal'), # LANG: 'Normal' label for Coriolis site override selection + 'beta': _('Beta') # LANG: 'Beta' label for Coriolis site override selection + # LANG: 'Auto' label for Coriolis site override selection + }.get(coriolis_config.override_mode, _('Auto')) + ) + + # If the override mode is still invalid, default to auto if coriolis_config.override_mode not in ('beta', 'normal', 'auto'): logger.warning(f'Unexpected value {coriolis_config.override_mode=!r}. Defaulting to "auto"') coriolis_config.override_mode = 'auto' diff --git a/plugins/inara.py b/plugins/inara.py index d523bb2e..c82a073d 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -997,7 +997,18 @@ def journal_entry( # noqa: C901, CCR001 elif 'KillerName' in entry: data['opponentName'] = entry['KillerName'] - new_add_event('addCommanderCombatDeath', entry['timestamp'], data) + elif 'KillerShip' in entry: + data['opponentName'] = entry['KillerShip'] + + # Paranoia in case of e.g. Thargoid activity not having complete data + opponent_name_issue = 'opponentName' not in data or data['opponentName'] == "" + wing_opponent_names_issue = 'wingOpponentNames' not in data or data['wingOpponentNames'] == [] + if opponent_name_issue and wing_opponent_names_issue: + logger.warning('Dropping addCommanderCombatDeath message' + 'because opponentName and wingOpponentNames came out as ""') + + else: + new_add_event('addCommanderCombatDeath', entry['timestamp'], data) elif event_name == 'Interdicted': data = OrderedDict([('starsystemName', system), @@ -1014,8 +1025,11 @@ def journal_entry( # noqa: C901, CCR001 elif 'Power' in entry: data['opponentName'] = entry['Power'] + elif 'IsThargoid' in entry and entry['IsThargoid']: + data['opponentName'] = 'Thargoid' + # Paranoia in case of e.g. Thargoid activity not having complete data - if data['opponentName'] == "": + if 'opponentName' not in data or data['opponentName'] == "": logger.warning('Dropping addCommanderCombatInterdicted message because opponentName came out as ""') else: @@ -1037,31 +1051,42 @@ def journal_entry( # noqa: C901, CCR001 elif 'Power' in entry: data['opponentName'] = entry['Power'] + # Shouldn't be needed here as Interdiction events can't target Thargoids (yet) + # but done just in case of future changes or so + elif 'IsThargoid' in entry and entry['IsThargoid']: + data['opponentName'] = 'Thargoid' + # Paranoia in case of e.g. Thargoid activity not having complete data - if data['opponentName'] == "": + if 'opponentName' not in data or data['opponentName'] == "": logger.warning('Dropping addCommanderCombatInterdiction message because opponentName came out as ""') else: new_add_event('addCommanderCombatInterdiction', entry['timestamp'], data) elif event_name == 'EscapeInterdiction': + data = OrderedDict([ + ('starsystemName', system), + ('isPlayer', entry['IsPlayer']), + ]) + + if 'Interdictor' in entry: + data['opponentName'] = entry['Interdictor'] + + elif 'Faction' in entry: + data['opponentName'] = entry['Faction'] + + elif 'Power' in entry: + data['opponentName'] = entry['Power'] + + elif 'isThargoid' in entry and entry['isThargoid']: + data['opponentName'] = 'Thargoid' + # Paranoia in case of e.g. Thargoid activity not having complete data - if entry.get('Interdictor') is None or entry['Interdictor'] == "": - logger.warning( - 'Dropping addCommanderCombatInterdictionEscape message' - 'because opponentName came out as ""' - ) + if 'opponentName' not in data or data['opponentName'] == "": + logger.warning('Dropping addCommanderCombatInterdiction message because opponentName came out as ""') else: - new_add_event( - 'addCommanderCombatInterdictionEscape', - entry['timestamp'], - { - 'starsystemName': system, - 'opponentName': entry['Interdictor'], - 'isPlayer': entry['IsPlayer'], - } - ) + new_add_event('addCommanderCombatInterdictionEscape', entry['timestamp'], data) elif event_name == 'PVPKill': new_add_event( diff --git a/requirements-dev.txt b/requirements-dev.txt index f8d701ff..73ab5465 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -5,30 +5,30 @@ 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==69.0.3 +setuptools==69.1.1 # Static analysis tools -flake8==6.1.0 +flake8==7.0.0 flake8-annotations-coverage==0.0.6 flake8-cognitive-complexity==0.1.0 flake8-comprehensions==3.14.0 flake8-docstrings==1.7.0 flake8-json==23.7.0 -flake8-noqa==1.3.2 +flake8-noqa==1.4.0 flake8-polyfill==1.0.2 flake8-use-fstring==1.4 mypy==1.8.0 pep8-naming==0.13.3 safety==2.3.5 -types-requests==2.31.0.20231231 +types-requests==2.31.0.20240125 types-pkg-resources==0.1.3 # Code formatting tools autopep8==2.0.4 # Git pre-commit checking -pre-commit==3.6.0 +pre-commit==3.6.2 # HTML changelogs grip==4.6.2 @@ -38,9 +38,9 @@ grip==4.6.2 py2exe==0.13.0.1; sys_platform == 'win32' # Testing -pytest==7.4.3 +pytest==8.0.2 pytest-cov==4.1.0 # Pytest code coverage support -coverage[toml]==7.3.4 # pytest-cov dep. This is here to ensure that it includes TOML support for pyproject.toml configs +coverage[toml]==7.4.1 # 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==306; sys_platform == 'win32' diff --git a/EDMC.manifest b/resources/EDMC.manifest similarity index 100% rename from EDMC.manifest rename to resources/EDMC.manifest diff --git a/resources/EDMC_Installer_Config_template.txt b/resources/EDMC_Installer_Config_template.txt index b72ed507..de40630c 100644 --- a/resources/EDMC_Installer_Config_template.txt +++ b/resources/EDMC_Installer_Config_template.txt @@ -16,7 +16,7 @@ AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#SuppURL} AppUpdatesURL={#SuppURL} -AppCopyright=Copyright (C) 2015-2019 Jonathan Harris, 2020-2023 EDCD +AppCopyright=Copyright (C) 2015-2019 Jonathan Harris, 2020-2024 EDCD AllowUNCPath=no AllowNetworkDrive=no DefaultDirName={autopf}\{#MyAppName} diff --git a/EDMarketConnector-dpiaware+gdiscaling.manifest b/resources/EDMarketConnector-dpiaware+gdiscaling.manifest similarity index 100% rename from EDMarketConnector-dpiaware+gdiscaling.manifest rename to resources/EDMarketConnector-dpiaware+gdiscaling.manifest diff --git a/EDMarketConnector-dpiaware.manifest b/resources/EDMarketConnector-dpiaware.manifest similarity index 100% rename from EDMarketConnector-dpiaware.manifest rename to resources/EDMarketConnector-dpiaware.manifest diff --git a/EDMarketConnector-gdiscaling.manifest b/resources/EDMarketConnector-gdiscaling.manifest similarity index 100% rename from EDMarketConnector-gdiscaling.manifest rename to resources/EDMarketConnector-gdiscaling.manifest diff --git a/EDMarketConnector.manifest b/resources/EDMarketConnector.manifest similarity index 100% rename from EDMarketConnector.manifest rename to resources/EDMarketConnector.manifest diff --git a/EDMarketConnector.xcf b/resources/EDMarketConnector.xcf similarity index 100% rename from EDMarketConnector.xcf rename to resources/EDMarketConnector.xcf diff --git a/resources/edmc.ico b/resources/edmc.ico new file mode 100644 index 00000000..8f3f9ff4 Binary files /dev/null and b/resources/edmc.ico differ diff --git a/resources/io.edcd.EDMarketConnector.cmd.psd b/resources/io.edcd.EDMarketConnector.cmd.psd new file mode 100644 index 00000000..6bebc572 Binary files /dev/null and b/resources/io.edcd.EDMarketConnector.cmd.psd differ diff --git a/scripts/find_localised_strings.py b/scripts/find_localised_strings.py index 1d1da826..ef861bb7 100644 --- a/scripts/find_localised_strings.py +++ b/scripts/find_localised_strings.py @@ -291,7 +291,7 @@ if __name__ == '__main__': print(f'NEW! {file}:{c.lineno}: {arg!r}') for old in set(template) ^ seen: - print(f'No longer used: {old}') + print(f'No longer used: {old!r}') elif args.json: to_print_data = [