From ed95cdba4e0e40cb61611d91c2f312b7b64b83f4 Mon Sep 17 00:00:00 2001 From: Osmo Salomaa Date: Sun, 8 Oct 2023 22:37:55 +0300 Subject: [PATCH] Single-space --- nfoview/about.py | 1 - nfoview/action.py | 2 -- nfoview/application.py | 1 - nfoview/config.py | 1 - nfoview/errors.py | 1 - nfoview/export.py | 1 - nfoview/i18n.py | 2 -- nfoview/open.py | 1 - nfoview/paths.py | 1 - nfoview/preferences.py | 2 -- nfoview/schemes.py | 9 --------- nfoview/test/test_about.py | 1 - nfoview/test/test_config.py | 1 - nfoview/test/test_export.py | 1 - nfoview/test/test_open.py | 1 - nfoview/test/test_preferences.py | 1 - nfoview/test/test_util.py | 1 - nfoview/test/test_view.py | 1 - nfoview/test/test_window.py | 1 - nfoview/unittest.py | 1 - nfoview/util.py | 1 - nfoview/view.py | 1 - nfoview/window.py | 1 - setup-partial.py | 2 -- 24 files changed, 36 deletions(-) diff --git a/nfoview/about.py b/nfoview/about.py index 988e2ea..e4ed5ef 100644 --- a/nfoview/about.py +++ b/nfoview/about.py @@ -21,7 +21,6 @@ from gi.repository import Gtk from nfoview.i18n import _ - class AboutDialog(Gtk.AboutDialog): def __init__(self, parent): diff --git a/nfoview/action.py b/nfoview/action.py index 9706787..ec7f5e2 100644 --- a/nfoview/action.py +++ b/nfoview/action.py @@ -21,7 +21,6 @@ from gi.repository import GLib from gi.repository import GObject - class Action(Gio.SimpleAction): def __init__(self, name): @@ -38,7 +37,6 @@ def update_enabled(self, window): except nfoview.AffirmationError: self.set_enabled(False) - class ToggleAction(Action): # Gio's abstraction makes toggle action instantiation and diff --git a/nfoview/application.py b/nfoview/application.py index 8a8a56e..dca2fc4 100644 --- a/nfoview/application.py +++ b/nfoview/application.py @@ -22,7 +22,6 @@ from gi.repository import GObject from gi.repository import Gtk - class Application(Gtk.Application): def __init__(self, paths): diff --git a/nfoview/config.py b/nfoview/config.py index 4b22e1a..6bfe2f9 100644 --- a/nfoview/config.py +++ b/nfoview/config.py @@ -34,7 +34,6 @@ "visited_link_color": "#215d9c", } - class ConfigurationStore: path = Path(nfoview.CONFIG_HOME_DIR) / "nfoview.conf" diff --git a/nfoview/errors.py b/nfoview/errors.py index dbe2623..1b050ad 100644 --- a/nfoview/errors.py +++ b/nfoview/errors.py @@ -15,7 +15,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - class AffirmationError(Exception): """ diff --git a/nfoview/export.py b/nfoview/export.py index a31d9c6..1ea7f11 100644 --- a/nfoview/export.py +++ b/nfoview/export.py @@ -19,7 +19,6 @@ from gi.repository import Gtk from nfoview.i18n import _ - # XXX: Gtk.FileChooserNative fails on GTK 4.10 with # "The folder contents could not be displayed" # "Operation was cancelled" diff --git a/nfoview/i18n.py b/nfoview/i18n.py index bdcd0fc..9180ae4 100644 --- a/nfoview/i18n.py +++ b/nfoview/i18n.py @@ -21,11 +21,9 @@ _translation = gettext.NullTranslations() - # Wrapper class for marking lazy translations class __(str): pass - def bind(localedir=nfoview.LOCALE_DIR): with nfoview.util.silent(Exception): # Set locale to the user's default setting. diff --git a/nfoview/open.py b/nfoview/open.py index bd8844c..0f96e1b 100644 --- a/nfoview/open.py +++ b/nfoview/open.py @@ -19,7 +19,6 @@ from gi.repository import Gtk from nfoview.i18n import _ - # XXX: Gtk.FileChooserNative fails on GTK 4.10 with # "The folder contents could not be displayed" # "Operation was cancelled" diff --git a/nfoview/paths.py b/nfoview/paths.py index 663c124..fdfa1e6 100644 --- a/nfoview/paths.py +++ b/nfoview/paths.py @@ -20,7 +20,6 @@ from pathlib import Path - def get_config_home_directory(): if sys.platform == "win32": return get_config_home_directory_windows() diff --git a/nfoview/preferences.py b/nfoview/preferences.py index f7049d0..c846792 100644 --- a/nfoview/preferences.py +++ b/nfoview/preferences.py @@ -21,7 +21,6 @@ from gi.repository import Gtk from nfoview.i18n import _ - def boxwrap(widget): # Needed to get widget natural-size left-aligned in grid. box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=0) @@ -34,7 +33,6 @@ def build_label(text): label.set_xalign(1) return label - class PreferencesDialog(Gtk.Dialog): def __init__(self, parent): diff --git a/nfoview/schemes.py b/nfoview/schemes.py index 6adac33..f5f62e1 100644 --- a/nfoview/schemes.py +++ b/nfoview/schemes.py @@ -30,7 +30,6 @@ "WhiteOnBlack", ) - class ColorScheme: name = NotImplementedError @@ -40,7 +39,6 @@ class ColorScheme: link = NotImplementedError visited_link = NotImplementedError - class BlackOnWhite(ColorScheme): name = "black-on-white" @@ -50,7 +48,6 @@ class BlackOnWhite(ColorScheme): link = "#0000ff" visited_link = "#ff00ff" - class Custom(ColorScheme): name = "custom" @@ -60,7 +57,6 @@ class Custom(ColorScheme): link = nfoview.conf.link_color visited_link = nfoview.conf.visited_link_color - class DarkGreyOnLightGray(ColorScheme): name = "dark-grey-on-light-grey" @@ -70,7 +66,6 @@ class DarkGreyOnLightGray(ColorScheme): link = "#5555ff" visited_link = "#ff55ff" - class Default(ColorScheme): # https://github.com/GNOME/gtk/blob/main/gtk/theme/Default/_colors.scss @@ -83,7 +78,6 @@ class Default(ColorScheme): link = "#2a76c6" visited_link = "#215d9c" - class GreyOnBlack(ColorScheme): name = "grey-on-black" @@ -93,7 +87,6 @@ class GreyOnBlack(ColorScheme): link = "#aaaaff" visited_link = "#ffaaff" - class LightGreyOnDarkGray(ColorScheme): name = "light-grey-on-dark-grey" @@ -103,7 +96,6 @@ class LightGreyOnDarkGray(ColorScheme): link = "#aaaaff" visited_link = "#ffaaff" - class WhiteOnBlack(ColorScheme): name = "white-on-black" @@ -113,7 +105,6 @@ class WhiteOnBlack(ColorScheme): link = "#aaaaff" visited_link = "#ffaaff" - def _ensure_translated(): for class_name in __all__: scheme = globals()[class_name] diff --git a/nfoview/test/test_about.py b/nfoview/test/test_about.py index 5eea7e9..e57d815 100644 --- a/nfoview/test/test_about.py +++ b/nfoview/test/test_about.py @@ -19,7 +19,6 @@ from gi.repository import Gtk - class TestAboutDialog(nfoview.TestCase): def run_dialog(self): diff --git a/nfoview/test/test_config.py b/nfoview/test/test_config.py index c930d20..28167d8 100644 --- a/nfoview/test/test_config.py +++ b/nfoview/test/test_config.py @@ -34,7 +34,6 @@ "visited_link_color": "#ffff00", } - class TestConfigurationStore(nfoview.TestCase): def setup_method(self, method): diff --git a/nfoview/test/test_export.py b/nfoview/test/test_export.py index 85882bb..6733025 100644 --- a/nfoview/test/test_export.py +++ b/nfoview/test/test_export.py @@ -19,7 +19,6 @@ from gi.repository import Gtk - class TestExportImageDialog(nfoview.TestCase): def run_dialog(self): diff --git a/nfoview/test/test_open.py b/nfoview/test/test_open.py index b6647d6..48f8b51 100644 --- a/nfoview/test/test_open.py +++ b/nfoview/test/test_open.py @@ -19,7 +19,6 @@ from gi.repository import Gtk - class TestOpenDialog(nfoview.TestCase): def run_dialog(self): diff --git a/nfoview/test/test_preferences.py b/nfoview/test/test_preferences.py index 1a80d9a..d76cea6 100644 --- a/nfoview/test/test_preferences.py +++ b/nfoview/test/test_preferences.py @@ -20,7 +20,6 @@ from gi.repository import Gdk from gi.repository import Gtk - class TestPreferencesDialog(nfoview.TestCase): def run_dialog(self): diff --git a/nfoview/test/test_util.py b/nfoview/test/test_util.py index 453528c..a5bb27d 100644 --- a/nfoview/test/test_util.py +++ b/nfoview/test/test_util.py @@ -23,7 +23,6 @@ from gi.repository import Gtk from unittest.mock import patch - class TestModule(nfoview.TestCase): def test_affirm__false(self): diff --git a/nfoview/test/test_view.py b/nfoview/test/test_view.py index 95bae16..ed752c6 100644 --- a/nfoview/test/test_view.py +++ b/nfoview/test/test_view.py @@ -19,7 +19,6 @@ from gi.repository import Gtk - class TestTextView(nfoview.TestCase): def run_window(self): diff --git a/nfoview/test/test_window.py b/nfoview/test/test_window.py index 928576c..28765f1 100644 --- a/nfoview/test/test_window.py +++ b/nfoview/test/test_window.py @@ -17,7 +17,6 @@ import nfoview - class TestWindow(nfoview.TestCase): def run_window(self): diff --git a/nfoview/unittest.py b/nfoview/unittest.py index ab538d1..e6343a6 100644 --- a/nfoview/unittest.py +++ b/nfoview/unittest.py @@ -23,7 +23,6 @@ from gi.repository import GLib from pathlib import Path - class TestCase: def main_loop(self, window): diff --git a/nfoview/util.py b/nfoview/util.py index 8bdf8f5..48858b4 100644 --- a/nfoview/util.py +++ b/nfoview/util.py @@ -27,7 +27,6 @@ from gi.repository import Gtk from gi.repository import Pango - def affirm(value): if not value: raise nfoview.AffirmationError(f"Not True: {value!r}") diff --git a/nfoview/view.py b/nfoview/view.py index 5d00bee..74ef3f6 100644 --- a/nfoview/view.py +++ b/nfoview/view.py @@ -23,7 +23,6 @@ from gi.repository import Gtk from gi.repository import Pango - class TextView(Gtk.TextView): def __init__(self): diff --git a/nfoview/window.py b/nfoview/window.py index 919f84d..ac06e2c 100644 --- a/nfoview/window.py +++ b/nfoview/window.py @@ -25,7 +25,6 @@ from nfoview.i18n import _ from pathlib import Path - class Window(Gtk.ApplicationWindow): def __init__(self, path=None): diff --git a/setup-partial.py b/setup-partial.py index 02cdc5b..836e1fb 100755 --- a/setup-partial.py +++ b/setup-partial.py @@ -8,7 +8,6 @@ from setuptools import setup from setuptools.command.install_lib import install_lib - class InstallLib(install_lib): def install(self): @@ -29,7 +28,6 @@ def install(self): path.write_text(text, "utf-8") return install_lib.install(self) - def get_version(fm="nfoview/__init__.py"): for line in Path(fm).read_text("utf-8").splitlines(): if line.startswith("__version__ = "):