From 5fa8f689ba3fd69798c9ee5860fb289053a4b347 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Mon, 27 May 2024 10:16:05 -0400 Subject: [PATCH 1/6] [5.11.0-rc1] Update Changelog, Init --- ChangeLog.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++ config/__init__.py | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) diff --git a/ChangeLog.md b/ChangeLog.md index 7d14ca9c6..8c810a53d 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,6 +6,70 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- +Release 5.11.0-rc1 +=== + +This release includes a number of new features and improvements, including a new Beta Update Track for testing future updates, enhanced context menus for text entry fields and UI elements, a revamp to the existing translation system and logging capabilities, and more. This release includes the Python Image Library (PIL) into our core bundle, adds a number of stability and configuration checks to the tool, and adds new schemas and configuration values to senders. + +This release also includes a number of bug fixes, performance enhancements, and updates to various aspects of the code to enhance maintainability are included. Notably, MacOS support has been removed due to a lack of support for this OS in Elite, and a number of functions have been deprecated and will be removed in later versions. Plugin developers, take note! + +**Changes and Enhancements** +* Established a Beta Update Track to allow users to assist in future update testing +* Added a global context menu for text entry fields that includes cut, copy, and paste options +* Added a context menu for Ship, System, and Station UI elements which allows opening the respective link in any of the available resource providers. +* Added translation hooks to the update available status string +* Added additional status logging when we're awaiting game log-in +* Added the Python Image Library (PIL) to the core EDMC library bundle +* Added respect for EDSM API limits to the default plugin +* Added EDDN stationType and carrierDockingAccess schemas to the sent events +* Added MaxJumpRange and CargoCapacity events to the Inara sender +* Added a high-level critical error handler to gracefully terminate the program in the event of a catastrophic error +* Added the ability to override the default language for a translation by adding the optional 'lang' parameter to the translate function for individual functions +* Added an updated template and new security reporting guidance to the documentation +* Added a new updater for the FDevID Files to keep the dependency up to date without requiring a new patch version push +* Added a System Profiler Utility to assist with gathering system and environment information for bug report purposes +* Added a new security policy for responsible disclosure of identified security issues +* Enabled security code scanning on the GitHub repository +* Updates the look and feel of the "Already Running" popup to reduce overhead and improve the look of the popup +* Updated translations to latest versions +* Updated documentation to reflect certain changes to the code +* Updated the GitHub Bug Report template +* Updated the GitHub Pull Request template +* Updated internal workflows to more recent versions +* Updated util_ships to avoid using Windows reserved file names as output +* Converted all usages of the unnecessary OrderedDict to use the standard dict +* Clarifies the hierarchy of parent classes for custom MyNotebook classes +* Renamed the default translation function from `_()` to `tr.tl()` +* Renamed the Translations base class to conform to Pythonic standards +* Deprecated the `_Translations` class +* Deprecated the `Translations` singleton in favor of `translations` +* Unpinned several dependencies that were already dependencies of other dependencies to prevent dependency conflicts (say that 5 times fast) +* Updated a few type hints to allow updates to more updated dependencies +* Changed the translation function import to no longer rely on forcing it into Python's builtins +* Handed over a few tk classes to their ttk equivalents for better styling +* Reworked the Plugin system to no longer use the deprecated importlib.load_module() +* Deprecated nb.Entry and nb.ColoredButton as they simply point toward other classes with no processing +* Removed macOS support +* Removed deprecated modules.p and ships.p files +* Removed deprecated openurl() function + +**Bug Fixes** +* Fixed a bug where certain types of exceptions from the Requests module wouldn't be handled properly regarding killswitches +* Fixed a rare bug where source builds running on 64-bit Python could generate an OverflowError in the monitor system +* Fixed a bug where EDMC would open directories in the webbrowser instead of the file explorer on Linux +* Fixed a rare bug that could cause the EDSM plugin to crash due to missing configuration values + +**Plugin Developers** +* nb.Entry is deprecated, and is slated for removal in 6.0 or later. Please migrate to nb.EntryMenu +* nb.ColoredButton is deprecated, and is slated for removal in 6.0 or later. Please migrate to tk.Button +* Calling internal translations with `_()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to importing `translations` and calling `translations.translate` or `translations.tl` directly +* `Translations` as the translate system singleton is deprecated, and is slated for removal in 6.0 or later. Please migrate to the `translations` singleton +* `help_open_log_folder()` is deprecated, and is slated for removal in 6.0 or later. Please migrate to open_folder() +* `update_feed` is deprecated, and is slated for removal in 6.0 or later. Please migrate to `get_update_feed()`. +* modules.p and ships.p are deprecated, and have been removed +* The `openurl()` function in ttkHyperlinkLabel has been removed. Please migrate to `webbrowser.open()` + + Release 5.10.6 === This release contains the data information for the new SCO modules added in Elite update 18.04. diff --git a/config/__init__.py b/config/__init__.py index 2fca7922a..7a08d9635 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -54,7 +54,7 @@ # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.11.0-alpha3' +_static_appversion = '5.11.0-rc1' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD' From 6660ab77f917e5dc0eee676247656c84efb42879 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 28 May 2024 08:27:36 -0400 Subject: [PATCH 2/6] [#1293][#1124] Resize Settings Window, Reorder Plugins --- prefs.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/prefs.py b/prefs.py index 5567e0942..8904eb5bb 100644 --- a/prefs.py +++ b/prefs.py @@ -232,7 +232,7 @@ class PreferencesDialog(tk.Toplevel): """The EDMC preferences dialog.""" def __init__(self, parent: tk.Tk, callback: Optional[Callable]): - tk.Toplevel.__init__(self, parent) + super().__init__(parent) self.parent = parent self.callback = callback @@ -242,25 +242,30 @@ def __init__(self, parent: tk.Tk, callback: Optional[Callable]): if parent.winfo_viewable(): self.transient(parent) - # position over parent - # http://core.tcl.tk/tk/tktview/c84f660833546b1b84e7 - # TODO this is fixed supposedly. + # Position over parent self.geometry(f'+{parent.winfo_rootx()}+{parent.winfo_rooty()}') - # remove decoration + # Remove decoration if sys.platform == 'win32': self.attributes('-toolwindow', tk.TRUE) - self.resizable(tk.FALSE, tk.FALSE) + # Allow the window to be resizable + self.resizable(tk.TRUE, tk.TRUE) self.cmdr: str | bool | None = False # Note if Cmdr changes in the Journal self.is_beta: bool = False # Note if Beta status changes in the Journal self.cmdrchanged_alarm: Optional[str] = None # This stores an ID that can be used to cancel a scheduled call + # Set up the main frame frame = ttk.Frame(self) frame.grid(sticky=tk.NSEW) + self.columnconfigure(0, weight=1) + self.rowconfigure(0, weight=1) + frame.columnconfigure(0, weight=1) + frame.rowconfigure(0, weight=1) + frame.rowconfigure(1, weight=0) - notebook: ttk.Notebook = nb.Notebook(frame) + notebook: nb.Notebook = nb.Notebook(frame) notebook.bind('<>', self.tabchanged) # Recompute on tab change self.PADX = 10 @@ -268,16 +273,17 @@ def __init__(self, parent: tk.Tk, callback: Optional[Callable]): self.LISTX = 25 # indent listed items self.PADY = 1 # close spacing self.BOXY = 2 # box spacing - self.SEPY = 10 # seperator line spacing + self.SEPY = 10 # separator line spacing # Set up different tabs - self.__setup_output_tab(notebook) - self.__setup_plugin_tabs(notebook) self.__setup_config_tab(notebook) - self.__setup_privacy_tab(notebook) self.__setup_appearance_tab(notebook) + self.__setup_output_tab(notebook) + self.__setup_privacy_tab(notebook) self.__setup_plugin_tab(notebook) + self.__setup_plugin_tabs(notebook) + # Set up the button frame buttonframe = ttk.Frame(frame) buttonframe.grid(padx=self.PADX, pady=self.PADX, sticky=tk.NSEW) buttonframe.columnconfigure(0, weight=1) @@ -298,7 +304,7 @@ def __init__(self, parent: tk.Tk, callback: Optional[Callable]): # wait for window to appear on screen before calling grab_set self.parent.update_idletasks() - self.parent.wm_attributes('-topmost', 0) # needed for dialog to appear ontop of parent on Linux + self.parent.wm_attributes('-topmost', 0) # needed for dialog to appear on top of parent on Linux self.wait_visibility() self.grab_set() From 6e6a6814be2b7905305f92a6d53efff648e5cdfa Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 28 May 2024 08:40:28 -0400 Subject: [PATCH 3/6] [1283] Enforce Minimum Size --- prefs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/prefs.py b/prefs.py index 8904eb5bb..0e3e3dead 100644 --- a/prefs.py +++ b/prefs.py @@ -322,6 +322,12 @@ def __init__(self, parent: tk.Tk, callback: Optional[Callable]): # Set Log Directory self.logfile_loc = pathlib.Path(tempfile.gettempdir()) / appname + # Set minimum size to prevent content cut-off + self.update_idletasks() # Update "requested size" from geometry manager + min_width = self.winfo_reqwidth() + min_height = self.winfo_reqheight() + self.wm_minsize(min_width, min_height) + def __setup_output_tab(self, root_notebook: ttk.Notebook) -> None: output_frame = nb.Frame(root_notebook) output_frame.columnconfigure(0, weight=1) From f53388e2117b048d53e7a8e45be4f98c9bb58a83 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 28 May 2024 08:53:18 -0400 Subject: [PATCH 4/6] [Minor] Update System Profiler Logging --- EDMarketConnector.py | 2 +- prefs.py | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/EDMarketConnector.py b/EDMarketConnector.py index 7f870108f..249b842f2 100755 --- a/EDMarketConnector.py +++ b/EDMarketConnector.py @@ -620,7 +620,7 @@ def open_window(systray: 'SysTrayIcon') -> None: self.help_menu.add_command(command=lambda: not self.HelpAbout.showing and self.HelpAbout(self.w)) logfile_loc = pathlib.Path(tempfile.gettempdir()) / appname self.help_menu.add_command(command=lambda: prefs.open_folder(logfile_loc)) # Open Log Folder - self.help_menu.add_command(command=prefs.help_open_system_profiler) # Open Log Folde + self.help_menu.add_command(command=lambda: prefs.help_open_system_profiler(self)) # Open Log Folde self.menubar.add_cascade(menu=self.help_menu) if sys.platform == 'win32': diff --git a/prefs.py b/prefs.py index 5567e0942..08d8c6a06 100644 --- a/prefs.py +++ b/prefs.py @@ -57,14 +57,18 @@ def open_folder(file: pathlib.Path) -> None: system(f'xdg-open "{file}"') -def help_open_system_profiler() -> None: +def help_open_system_profiler(parent) -> None: """Open the EDMC System Profiler.""" profiler_path = pathlib.Path(config.respath_path) - if getattr(sys, 'frozen', False): - profiler_path /= 'EDMCSystemProfiler.exe' - subprocess.run(profiler_path) - else: - subprocess.run(['python', "EDMCSystemProfiler.py"], shell=True) + try: + if getattr(sys, 'frozen', False): + profiler_path /= 'EDMCSystemProfiler.exe' + subprocess.run(profiler_path, check=True) + else: + subprocess.run(['python', "EDMCSystemProfiler.py"], shell=True, check=True) + except Exception as err: + parent.status["text"] = "Unable to Launch System Profiler" + logger.exception(err) class PrefsVersion: @@ -927,7 +931,7 @@ def __setup_plugin_tab(self, notebook: ttk.Notebook) -> None: # noqa: CCR001 ).grid(column=1, padx=self.PADX, pady=self.PADY, sticky=tk.N, row=cur_row) enabled_plugins = list(filter(lambda x: x.folder and x.module, plug.PLUGINS)) - if len(enabled_plugins): + if enabled_plugins: ttk.Separator(plugins_frame, orient=tk.HORIZONTAL).grid( columnspan=3, padx=self.PADX, pady=self.SEPY, sticky=tk.EW, row=row.get() ) @@ -949,7 +953,7 @@ def __setup_plugin_tab(self, notebook: ttk.Notebook) -> None: # noqa: CCR001 ############################################################ # Show which plugins don't have Python 3.x support ############################################################ - if len(plug.PLUGINS_not_py3): + if plug.PLUGINS_not_py3: ttk.Separator(plugins_frame, orient=tk.HORIZONTAL).grid( columnspan=3, padx=self.PADX, pady=self.SEPY, sticky=tk.EW, row=row.get() ) @@ -975,7 +979,7 @@ def __setup_plugin_tab(self, notebook: ttk.Notebook) -> None: # noqa: CCR001 # Show disabled plugins ############################################################ disabled_plugins = list(filter(lambda x: x.folder and not x.module, plug.PLUGINS)) - if len(disabled_plugins): + if disabled_plugins: ttk.Separator(plugins_frame, orient=tk.HORIZONTAL).grid( columnspan=3, padx=self.PADX, pady=self.SEPY, sticky=tk.EW, row=row.get() ) @@ -992,7 +996,7 @@ def __setup_plugin_tab(self, notebook: ttk.Notebook) -> None: # noqa: CCR001 ############################################################ # Show plugins that failed to load ############################################################ - if len(plug.PLUGINS_broken): + if plug.PLUGINS_broken: ttk.Separator(plugins_frame, orient=tk.HORIZONTAL).grid( columnspan=3, padx=self.PADX, pady=self.SEPY, sticky=tk.EW, row=row.get() ) From 8a27ca266d945af528165d7f0ce5c767a3c13ea4 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 28 May 2024 09:02:58 -0400 Subject: [PATCH 5/6] [Minor] Add Translation --- L10n/en.template | 3 +++ prefs.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/L10n/en.template b/L10n/en.template index b45dfed9e..3906b8978 100644 --- a/L10n/en.template +++ b/L10n/en.template @@ -489,6 +489,9 @@ /* prefs.py: Lable on list of user-disabled plugins; In files: prefs.py:977; */ "Disabled Plugins" = "Disabled Plugins"; +/* prefs.py: Catch & Record Profiler Errors; */ +"Error in System Profiler" = "Error in System Profiler"; + /* stats.py: Cmdr stats; In files: stats.py:58; */ "Balance" = "Balance"; diff --git a/prefs.py b/prefs.py index 08d8c6a06..7e15bc3b2 100644 --- a/prefs.py +++ b/prefs.py @@ -67,7 +67,7 @@ def help_open_system_profiler(parent) -> None: else: subprocess.run(['python', "EDMCSystemProfiler.py"], shell=True, check=True) except Exception as err: - parent.status["text"] = "Unable to Launch System Profiler" + parent.status["text"] = tr.tl("Error in System Profiler") # LANG: Catch & Record Profiler Errors logger.exception(err) From bc2adfa655a7531761a79a6c24d33e5be1b7b7cc Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Tue, 28 May 2024 11:28:18 -0400 Subject: [PATCH 6/6] [5.11.0-rc2] Update Changelog and Init --- ChangeLog.md | 14 +++++++++++++- config/__init__.py | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 8c810a53d..5d480fb8e 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -6,8 +6,20 @@ This is the master changelog for Elite Dangerous Market Connector. Entries are in the source (not distributed with the Windows installer) for the currently used version. --- -Release 5.11.0-rc1 +Pre-Release 5.11.0-rc2 === +This is a release candidate for 5.11.0. + +This release is identical to 5.11.0-rc1, with a few additions: + +**Changes and Enhancements** +* Adds Additional Error Processing to the System Profiler when launched from EDMC +* Adds the ability to resize the Settings window to larger than the initial default size +* Tweaked a few list length checks that could just be boolean to be bool + +Pre-Release 5.11.0-rc1 +=== +This is a release candidate for 5.11.0. This release includes a number of new features and improvements, including a new Beta Update Track for testing future updates, enhanced context menus for text entry fields and UI elements, a revamp to the existing translation system and logging capabilities, and more. This release includes the Python Image Library (PIL) into our core bundle, adds a number of stability and configuration checks to the tool, and adds new schemas and configuration values to senders. diff --git a/config/__init__.py b/config/__init__.py index 7a08d9635..ab0bdd0a3 100644 --- a/config/__init__.py +++ b/config/__init__.py @@ -54,7 +54,7 @@ # # Major.Minor.Patch(-prerelease)(+buildmetadata) # NB: Do *not* import this, use the functions appversion() and appversion_nobuild() -_static_appversion = '5.11.0-rc1' +_static_appversion = '5.11.0-rc2' _cached_version: semantic_version.Version | None = None copyright = '© 2015-2019 Jonathan Harris, 2020-2024 EDCD'