From d9c7a791553f12489ed47f74f6275b533ca7ca22 Mon Sep 17 00:00:00 2001 From: David Sangrey Date: Sat, 6 Apr 2024 16:59:49 -0400 Subject: [PATCH] [Minor] Update Type Hintings No Content Changes, Shuts Up MyPy --- docs/examples/click_counter/load.py | 4 ++-- myNotebook.py | 2 +- plug.py | 2 +- plugins/coriolis.py | 2 +- plugins/eddn.py | 4 ++-- plugins/edsm.py | 2 +- plugins/inara.py | 2 +- prefs.py | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/examples/click_counter/load.py b/docs/examples/click_counter/load.py index f7f23837..a3b8cac6 100644 --- a/docs/examples/click_counter/load.py +++ b/docs/examples/click_counter/load.py @@ -49,7 +49,7 @@ class ClickCounter: """ self.on_preferences_closed("", False) # Save our prefs - def setup_preferences(self, parent: nb.Notebook, cmdr: str, is_beta: bool) -> tk.Frame | None: + def setup_preferences(self, parent: nb.Notebook, cmdr: str, is_beta: bool) -> nb.Frame | None: """ setup_preferences is called by plugin_prefs below. @@ -128,7 +128,7 @@ def plugin_stop() -> None: return cc.on_unload() -def plugin_prefs(parent: nb.Notebook, cmdr: str, is_beta: bool) -> tk.Frame | None: +def plugin_prefs(parent: nb.Notebook, cmdr: str, is_beta: bool) -> nb.Frame | None: """ Handle preferences tab for the plugin. diff --git a/myNotebook.py b/myNotebook.py index e8f8779b..0eeb96a4 100644 --- a/myNotebook.py +++ b/myNotebook.py @@ -120,7 +120,7 @@ class EntryMenu(ttk.Entry): pass -class Entry(ttk.Entry or EntryMenu): +class Entry(ttk.Entry or EntryMenu): # type: ignore """Custom t(t)k.Entry class to fix some display issues.""" # DEPRECATED: Migrate to ttk.Entry or EntryMenu. Will remove in 5.12 or later. diff --git a/plug.py b/plug.py index 15e7cfaa..dad08bc6 100644 --- a/plug.py +++ b/plug.py @@ -126,7 +126,7 @@ class Plugin: return None - def get_prefs(self, parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Frame | None: + def get_prefs(self, parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> nb.Frame | None: """ If the plugin provides a prefs frame, create and return it. diff --git a/plugins/coriolis.py b/plugins/coriolis.py index a97eb6c6..cc7e965a 100644 --- a/plugins/coriolis.py +++ b/plugins/coriolis.py @@ -84,7 +84,7 @@ def plugin_start3(path: str) -> str: return 'Coriolis' -def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Frame: +def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> nb.Frame: """Set up plugin preferences.""" PADX = 10 # noqa: N806 PADY = 1 # noqa: N806 diff --git a/plugins/eddn.py b/plugins/eddn.py index c5a978db..9504d1ab 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -1898,7 +1898,7 @@ class EDDN: :param cmdr: the commander under which this upload is made :param is_beta: whether or not we are in beta mode :param entry: the journal entry to send - + ___ Example: { "timestamp":"2022-06-10T10:09:41Z", @@ -1932,7 +1932,7 @@ class EDDN: :param cmdr: the commander under which this upload is made :param is_beta: whether or not we are in beta mode :param entry: the journal entry to send - + ___ Example: { "timestamp":"2023-10-01T14:56:34Z", diff --git a/plugins/edsm.py b/plugins/edsm.py index 146dd5ab..55aae7b8 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -279,7 +279,7 @@ def toggle_password_visibility(): this.apikey.config(show="*") # type: ignore -def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> tk.Frame: +def plugin_prefs(parent: ttk.Notebook, cmdr: str | None, is_beta: bool) -> nb.Frame: """ Plugin preferences setup hook. diff --git a/plugins/inara.py b/plugins/inara.py index d96e05ef..29bfaaf2 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -244,7 +244,7 @@ def toggle_password_visibility(): this.apikey.config(show="*") -def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> tk.Frame: +def plugin_prefs(parent: ttk.Notebook, cmdr: str, is_beta: bool) -> nb.Frame: """Plugin Preferences UI hook.""" PADX = 10 # noqa: N806 BUTTONX = 12 # noqa: N806 # indent Checkbuttons and Radiobuttons diff --git a/prefs.py b/prefs.py index 9e0459b6..5e0f946b 100644 --- a/prefs.py +++ b/prefs.py @@ -376,7 +376,7 @@ class PreferencesDialog(tk.Toplevel): ) self.outbutton.grid(column=1, padx=self.PADX, pady=self.PADY, sticky=tk.EW, row=row.get()) - nb.Frame(output_frame).grid(row=row.get()) # bottom spacer # TODO: does nothing? + nb.Frame(output_frame).grid(row=row.get()) # type: ignore # bottom spacer # TODO: does nothing? # LANG: Label for 'Output' Settings/Preferences tab root_notebook.add(output_frame, text=_('Output')) # Tab heading in settings