Skip to content

Commit

Permalink
fix first pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Stunkymonkey committed Dec 29, 2023
1 parent e997479 commit e36d49d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ ignore_missing_imports = true
[tool.pylint]
max-line-length = 120
ignored-modules = "gi"
disable = "global-statement"
11 changes: 5 additions & 6 deletions src/nautilus_open_any_terminal.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -195,20 +195,20 @@ 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":
# It's called like this on fedora
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):
Expand Down Expand Up @@ -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):
Expand All @@ -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)

Expand Down

0 comments on commit e36d49d

Please sign in to comment.