diff --git a/cozy/application.py b/cozy/application.py index cd85e7ff..45768e30 100644 --- a/cozy/application.py +++ b/cozy/application.py @@ -2,7 +2,6 @@ import platform import sys import threading -from pathlib import Path from traceback import format_exception import distro @@ -27,7 +26,7 @@ class Application(Adw.Application): def __init__(self, pkgdatadir: str): self.pkgdatadir = pkgdatadir - super().__init__(application_id='com.github.geigi.cozy') + super().__init__(application_id="com.github.geigi.cozy") self.init_custom_widgets() GLib.setenv("PULSE_PROP_media.role", "music", True) diff --git a/cozy/ui/main_view.py b/cozy/ui/main_view.py index 87bb92eb..076664b9 100644 --- a/cozy/ui/main_view.py +++ b/cozy/ui/main_view.py @@ -19,11 +19,11 @@ from cozy.ui.book_detail_view import BookDetailView from cozy.ui.library_view import LibraryView from cozy.ui.preferences_window import PreferencesWindow +from cozy.ui.widgets.storages import ask_storage_location from cozy.ui.widgets.welcome_dialog import WelcomeDialog from cozy.view_model.playback_control_view_model import PlaybackControlViewModel from cozy.view_model.playback_speed_view_model import PlaybackSpeedViewModel from cozy.view_model.storages_view_model import StoragesViewModel -from cozy.ui.widgets.storages import ask_storage_location log = logging.getLogger("ui") diff --git a/cozy/ui/widgets/book_card.py b/cozy/ui/widgets/book_card.py index 5d56f343..d8a6ad58 100644 --- a/cozy/ui/widgets/book_card.py +++ b/cozy/ui/widgets/book_card.py @@ -49,7 +49,7 @@ def do_snapshot(self, snapshot: Gtk.Snapshot) -> None: context.stroke() -@Gtk.Template.from_resource('/com/github/geigi/cozy/ui/book_card.ui') +@Gtk.Template.from_resource("/com/github/geigi/cozy/ui/book_card.ui") class BookCard(Gtk.FlowBoxChild): __gtype_name__ = "BookCard" diff --git a/cozy/ui/widgets/error_reporting.py b/cozy/ui/widgets/error_reporting.py index 880c75ec..1be4a51e 100644 --- a/cozy/ui/widgets/error_reporting.py +++ b/cozy/ui/widgets/error_reporting.py @@ -9,28 +9,29 @@ _("Disabled"), _("Basic error reporting"), _("Detailed error reporting"), - _("Detailed, with media types") + _("Detailed, with media types"), ] LEVEL_DESCRIPTION = [ _("No error or crash reporting."), - _("The following information will be sent in case of an error or crash:") + _("The following information will be sent in case of an error or crash:"), ] LEVEL_DETAILS = [ [], - [_("Which type of error occurred"), + [ + _("Which type of error occurred"), _("Line of code where an error occurred"), - _("Cozy's version"), ], - [_("Linux distribution"), - _("Desktop environment")], - [_("Media type of files that Cozy couldn't import")] + _("Cozy's version"), + ], + [_("Linux distribution"), _("Desktop environment")], + [_("Media type of files that Cozy couldn't import")], ] -@Gtk.Template.from_resource('/com/github/geigi/cozy/ui/error_reporting.ui') +@Gtk.Template.from_resource("/com/github/geigi/cozy/ui/error_reporting.ui") class ErrorReporting(Gtk.Box): - __gtype_name__ = 'ErrorReporting' + __gtype_name__ = "ErrorReporting" description: Adw.ActionRow = Gtk.Template.Child() detail_combo: Adw.ComboRow = Gtk.Template.Child() @@ -61,10 +62,9 @@ def _level_selected(self, obj, param) -> None: def _update_description(self, level: int): self.description.set_title(LEVEL_DESCRIPTION[min(level, 1)]) - details = "\n".join(["• " + i for i in chain(*LEVEL_DETAILS[:level+1])]) + details = "\n".join(["• " + i for i in chain(*LEVEL_DETAILS[: level + 1])]) self.description.set_subtitle(details) def _on_app_setting_changed(self, event, _): if event == "report-level": self._load_report_level() - diff --git a/cozy/ui/widgets/welcome_dialog.py b/cozy/ui/widgets/welcome_dialog.py index 155bf5f8..8a273c08 100644 --- a/cozy/ui/widgets/welcome_dialog.py +++ b/cozy/ui/widgets/welcome_dialog.py @@ -1,17 +1,15 @@ +import os.path from pathlib import Path + import inject -import os.path from gi.repository import Adw, Gtk -from cozy.view_model.playback_speed_view_model import PlaybackSpeedViewModel -from cozy.ui.widgets.error_reporting import ErrorReporting from cozy.settings import ApplicationSettings -from cozy.view_model.storages_view_model import StoragesViewModel - from cozy.ui.widgets.storages import ask_storage_location +from cozy.view_model.storages_view_model import StoragesViewModel -@Gtk.Template.from_resource('/com/github/geigi/cozy/ui/welcome_dialog.ui') +@Gtk.Template.from_resource("/com/github/geigi/cozy/ui/welcome_dialog.ui") class WelcomeDialog(Adw.Dialog): __gtype_name__ = "WelcomeDialog"