From 315d7dec4e237cf2d219d7a1ba6a24df4caf3415 Mon Sep 17 00:00:00 2001 From: linkfrg Date: Tue, 6 Aug 2024 02:08:22 +0500 Subject: [PATCH] lint --- ignis/app.py | 1 - ignis/base_widget.py | 1 + ignis/dbus.py | 14 ++++++++++++-- ignis/dbus_menu.py | 2 ++ ignis/main.py | 4 +--- ignis/services/mpris.py | 4 +++- ignis/widgets/icon.py | 2 +- 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ignis/app.py b/ignis/app.py index 41cb1208..c6384d39 100644 --- a/ignis/app.py +++ b/ignis/app.py @@ -353,5 +353,4 @@ def __Quit(self, invocation) -> None: self.quit() - app = IgnisApp() diff --git a/ignis/base_widget.py b/ignis/base_widget.py index 602b8acc..811a665a 100644 --- a/ignis/base_widget.py +++ b/ignis/base_widget.py @@ -10,6 +10,7 @@ class BaseWidget(Gtk.Widget, IgnisGObject): The base class for all widgets. Provides ``style`` property and allows overriding enums. """ + gproperties = __gproperties__ = {} _overrided_enums = {} diff --git a/ignis/dbus.py b/ignis/dbus.py index 746f0f70..addb752b 100644 --- a/ignis/dbus.py +++ b/ignis/dbus.py @@ -91,7 +91,9 @@ def methods(self) -> dict: def properties(self) -> dict: return self._properties - def __export_object(self, connection: Gio.DBusConnection, info: Gio.DBusInterfaceInfo) -> None: + def __export_object( + self, connection: Gio.DBusConnection, info: Gio.DBusInterfaceInfo + ) -> None: self._connection = connection self._connection.register_object( self._object_path, @@ -124,7 +126,14 @@ def callback(func: callable, unpacked_params) -> None: target=params.unpack, callback=lambda result: callback(func, result) ) - def __handle_get_property(self, connection: Gio.DBusConnection, sender: str, object_path: str, interface: str, value: str) -> GLib.Variant: + def __handle_get_property( + self, + connection: Gio.DBusConnection, + sender: str, + object_path: str, + interface: str, + value: str, + ) -> GLib.Variant: func = self._properties.get(value, None) if func: return func() @@ -213,6 +222,7 @@ class DBusProxy(IgnisGObject): value = proxy.MyValue print(value) """ + def __init__( self, name: str, diff --git a/ignis/dbus_menu.py b/ignis/dbus_menu.py index fb0925fa..0903a41f 100644 --- a/ignis/dbus_menu.py +++ b/ignis/dbus_menu.py @@ -8,6 +8,7 @@ class MenuItem(GObject.Object): """ :meta private: """ + def __init__( self, proxy: DBusProxy, @@ -42,6 +43,7 @@ class DBusMenu(Gtk.PopoverMenu): name (``str``): A bus name (well-known or unique). object_path(``str``): An object path to menu. """ + def __init__(self, name: str, object_path: str): super().__init__() self.__proxy = DBusProxy( diff --git a/ignis/main.py b/ignis/main.py index 8e85e28a..b7c6d3fa 100644 --- a/ignis/main.py +++ b/ignis/main.py @@ -24,9 +24,7 @@ def set_process_name(name): def print_version(ctx, param, value): if value: - ctx.exit( - print(f"Ignis {Utils.get_ignis_version()} {Utils.get_ignis_commit()}") - ) + ctx.exit(print(f"Ignis {Utils.get_ignis_version()} {Utils.get_ignis_commit()}")) def call_client_func(name: str, *args) -> None: diff --git a/ignis/services/mpris.py b/ignis/services/mpris.py index 2bcc773d..34513d9f 100644 --- a/ignis/services/mpris.py +++ b/ignis/services/mpris.py @@ -90,7 +90,9 @@ def __init__(self, name: str): self.__player_proxy.proxy.connect("g-properties-changed", self.__sync) - self.__mpris_proxy.watch_name(on_name_vanished=lambda *args: self.emit("closed")) + self.__mpris_proxy.watch_name( + on_name_vanished=lambda *args: self.emit("closed") + ) self.__ready() diff --git a/ignis/widgets/icon.py b/ignis/widgets/icon.py index b10f1a56..c79209aa 100644 --- a/ignis/widgets/icon.py +++ b/ignis/widgets/icon.py @@ -30,7 +30,7 @@ class Icon(Gtk.Image, BaseWidget): def __init__(self, pixel_size: int = -1, **kwargs): Gtk.Image.__init__(self) - self.pixel_size = pixel_size # this need to set pixel_size BEFORE image + self.pixel_size = pixel_size # this need to set pixel_size BEFORE image BaseWidget.__init__(self, **kwargs) @GObject.Property