From e36d49d78e9e2b5c39763792195bf590333b0736 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Fri, 29 Dec 2023 13:10:52 +0100 Subject: [PATCH] fix first pylint errors --- pyproject.toml | 1 + src/nautilus_open_any_terminal.py | 11 +++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8544d5d..af25acd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,3 +34,4 @@ ignore_missing_imports = true [tool.pylint] max-line-length = 120 ignored-modules = "gi" +disable = "global-statement" diff --git a/src/nautilus_open_any_terminal.py b/src/nautilus_open_any_terminal.py index 0fdfe1d..8996d28 100644 --- a/src/nautilus_open_any_terminal.py +++ b/src/nautilus_open_any_terminal.py @@ -180,7 +180,7 @@ def set_terminal_args(*args): flatpak = FLATPAK_PARMS[_gsettings.get_enum(GSETTINGS_FLATPAK)] new_terminal_data = TERMINALS.get(value) if not new_terminal_data: - print('open-any-terminal: unknown terminal "{0}"'.format(value)) + print(f'open-any-terminal: unknown terminal "{value}"') return global terminal @@ -195,7 +195,7 @@ def set_terminal_args(*args): new_tab_text += " (terminal does not support tabs)" if flatpak != FLATPAK_PARMS[0] and terminal_data.flatpak_package is not None: terminal_cmd = ["flatpak", "run", "--" + flatpak, terminal_data.flatpak_package] - flatpak_text = "with flatpak as {0}".format(flatpak) + flatpak_text = f"with flatpak as {flatpak}" else: terminal_cmd = [terminal] if terminal == "blackbox" and distro_id() == "fedora": @@ -203,12 +203,12 @@ def set_terminal_args(*args): terminal_cmd[0] = "blackbox-terminal" flatpak = FLATPAK_PARMS[0] flatpak_text = "" - print('open-any-terminal: terminal is set to "{0}" {1} {2}'.format(terminal, new_tab_text, flatpak_text)) + print(f'open-any-terminal: terminal is set to "{terminal}" {new_tab_text} {flatpak_text}') if Nautilus._version == "3.0": - class OpenAnyTerminalShortcutProvider(GObject.GObject, Nautilus.LocationWidgetProvider): + class OpenAnyTerminalShortcutProvider(GObject.GObject, Nautilus.LocationWidgetProvider): # pylint: disable=too-few-public-methods def __init__(self): source = Gio.SettingsSchemaSource.get_default() if source.lookup(GSETTINGS_PATH, True): @@ -240,7 +240,6 @@ def get_widget(self, uri, window): if self._gsettings: window.add_accel_group(self._accel_group) self._window = window - return None class OpenAnyTerminalExtension(GObject.GObject, Nautilus.MenuProvider): @@ -252,7 +251,7 @@ def _open_terminal(self, file_): cmd.extend(terminal_data.command_arguments) cmd.extend(["ssh", "-t"]) if result.username: - cmd.append("{0}@{1}".format(result.username, result.hostname)) + cmd.append(f"{result.username}@{result.hostname}") else: cmd.append(result.hostname)