From ad26c04ad5b3cc45575f6bda7cb2ddf966f10f1c Mon Sep 17 00:00:00 2001 From: rdbende Date: Tue, 26 Mar 2024 13:19:43 +0100 Subject: [PATCH] Format everything with isort --- cozy/app_controller.py | 21 ++++++++++----------- cozy/architecture/observable.py | 2 +- cozy/architecture/profiler.py | 4 ++-- cozy/control/artwork_cache.py | 2 +- cozy/control/db.py | 1 - cozy/control/db_updater.py | 2 +- cozy/control/filesystem_monitor.py | 2 +- cozy/control/offline_cache.py | 8 +++----- cozy/db/artwork_cache.py | 2 +- cozy/db/book.py | 3 ++- cozy/db/offline_cache.py | 4 ++-- cozy/db/settings.py | 4 ++-- cozy/db/storage.py | 2 +- cozy/db/track.py | 4 ++-- cozy/media/gst_player.py | 4 ++-- cozy/media/importer.py | 4 ++-- cozy/media/media_detector.py | 5 ++--- cozy/media/player.py | 2 +- cozy/media/tag_reader.py | 3 +-- cozy/model/book.py | 4 ++-- cozy/model/database_importer.py | 2 +- cozy/model/track.py | 2 +- cozy/report/report_to_loki.py | 16 +++++++--------- cozy/report/reporter.py | 4 +--- cozy/tools.py | 9 +++++---- cozy/ui/app_view.py | 4 ++-- cozy/ui/book_detail_view.py | 7 +++---- cozy/ui/chapter_element.py | 2 +- cozy/ui/headerbar.py | 6 ++---- cozy/ui/import_failed_dialog.py | 1 - cozy/ui/library_view.py | 4 ++-- cozy/ui/main_view.py | 5 ++--- cozy/ui/media_controller.py | 3 +-- cozy/ui/search_view.py | 2 +- cozy/ui/widgets/album_element.py | 5 ++--- cozy/ui/widgets/book_element.py | 2 +- cozy/ui/widgets/error_reporting.py | 3 +-- cozy/ui/widgets/first_import_button.py | 4 ++-- cozy/ui/widgets/playback_speed_popover.py | 4 ++-- cozy/ui/widgets/sleep_timer.py | 4 ++-- cozy/view_model/library_view_model.py | 2 +- pyproject.toml | 1 + 42 files changed, 80 insertions(+), 95 deletions(-) diff --git a/cozy/app_controller.py b/cozy/app_controller.py index 6d94e952..a81193d5 100644 --- a/cozy/app_controller.py +++ b/cozy/app_controller.py @@ -1,36 +1,35 @@ from gi.repository import Gio - -import cozy.ext.inject as inject from peewee import SqliteDatabase -from cozy.control.offline_cache import OfflineCache -from cozy.media.files import Files -from cozy.media.gst_player import GstPlayer -from cozy.media.player import Player -from cozy.model.database_importer import DatabaseImporter -from cozy.power_manager import PowerManager -from cozy.report import reporter +import cozy.ext.inject as inject from cozy.application_settings import ApplicationSettings from cozy.architecture.singleton import Singleton from cozy.control.db import get_db from cozy.control.filesystem_monitor import FilesystemMonitor +from cozy.control.offline_cache import OfflineCache +from cozy.media.files import Files +from cozy.media.gst_player import GstPlayer +from cozy.media.player import Player from cozy.model.book import Book +from cozy.model.database_importer import DatabaseImporter from cozy.model.library import Library from cozy.model.settings import Settings from cozy.open_view import OpenView +from cozy.power_manager import PowerManager +from cozy.report import reporter from cozy.ui.app_view import AppView from cozy.ui.book_detail_view import BookDetailView from cozy.ui.headerbar import Headerbar -from cozy.ui.toaster import ToastNotifier from cozy.ui.library_view import LibraryView from cozy.ui.main_view import CozyUI from cozy.ui.media_controller import MediaController from cozy.ui.search_view import SearchView +from cozy.ui.toaster import ToastNotifier from cozy.view import View from cozy.view_model.app_view_model import AppViewModel from cozy.view_model.book_detail_view_model import BookDetailViewModel from cozy.view_model.headerbar_view_model import HeaderbarViewModel -from cozy.view_model.library_view_model import LibraryViewModel, LibraryViewMode +from cozy.view_model.library_view_model import LibraryViewMode, LibraryViewModel from cozy.view_model.playback_control_view_model import PlaybackControlViewModel from cozy.view_model.playback_speed_view_model import PlaybackSpeedViewModel from cozy.view_model.search_view_model import SearchViewModel diff --git a/cozy/architecture/observable.py b/cozy/architecture/observable.py index 9380d4f7..bbf2c7ea 100644 --- a/cozy/architecture/observable.py +++ b/cozy/architecture/observable.py @@ -1,9 +1,9 @@ +import logging from typing import Callable from gi.repository import GLib from cozy.report import reporter -import logging log = logging.getLogger("observable") diff --git a/cozy/architecture/profiler.py b/cozy/architecture/profiler.py index ca85f029..dd99b446 100644 --- a/cozy/architecture/profiler.py +++ b/cozy/architecture/profiler.py @@ -1,6 +1,6 @@ -import time -import logging import functools +import logging +import time log = logging.getLogger("timing") diff --git a/cozy/control/artwork_cache.py b/cozy/control/artwork_cache.py index 64446063..020862f1 100644 --- a/cozy/control/artwork_cache.py +++ b/cozy/control/artwork_cache.py @@ -1,6 +1,6 @@ +import logging import os import uuid -import logging from gi.repository import Gdk, GdkPixbuf diff --git a/cozy/control/db.py b/cozy/control/db.py index 0e84647e..cce7ff17 100644 --- a/cozy/control/db.py +++ b/cozy/control/db.py @@ -1,7 +1,6 @@ import logging import time - from cozy.control.db_updater import update_db from cozy.db.artwork_cache import ArtworkCache from cozy.db.book import Book diff --git a/cozy/control/db_updater.py b/cozy/control/db_updater.py index c31e82c7..962a659f 100644 --- a/cozy/control/db_updater.py +++ b/cozy/control/db_updater.py @@ -3,7 +3,7 @@ import shutil from datetime import datetime -from peewee import IntegerField, BooleanField, FloatField, ForeignKeyField, fn +from peewee import BooleanField, FloatField, ForeignKeyField, IntegerField, fn from playhouse.migrate import SqliteMigrator, migrate from playhouse.reflection import generate_models diff --git a/cozy/control/filesystem_monitor.py b/cozy/control/filesystem_monitor.py index 96d745fd..c33599ff 100644 --- a/cozy/control/filesystem_monitor.py +++ b/cozy/control/filesystem_monitor.py @@ -1,8 +1,8 @@ import logging -import cozy.ext.inject as inject from gi.repository import Gio +import cozy.ext.inject as inject from cozy.architecture.event_sender import EventSender from cozy.model.book import Book from cozy.model.settings import Settings diff --git a/cozy/control/offline_cache.py b/cozy/control/offline_cache.py index 339aea95..593e6053 100644 --- a/cozy/control/offline_cache.py +++ b/cozy/control/offline_cache.py @@ -1,14 +1,12 @@ import logging -import uuid import os +import uuid +from gi.repository import Gio +import cozy.tools as tools from cozy.architecture.event_sender import EventSender from cozy.control.application_directories import get_cache_dir -import cozy.tools as tools - -from gi.repository import Gio - from cozy.db.file import File from cozy.db.offline_cache import OfflineCache as OfflineCacheModel from cozy.db.track_to_file import TrackToFile diff --git a/cozy/db/artwork_cache.py b/cozy/db/artwork_cache.py index a0744490..e7d98773 100644 --- a/cozy/db/artwork_cache.py +++ b/cozy/db/artwork_cache.py @@ -1,4 +1,4 @@ -from peewee import ForeignKeyField, CharField +from peewee import CharField, ForeignKeyField from cozy.db.book import Book from cozy.db.model_base import ModelBase diff --git a/cozy/db/book.py b/cozy/db/book.py index 99623efd..eae82ecf 100644 --- a/cozy/db/book.py +++ b/cozy/db/book.py @@ -1,5 +1,6 @@ +from peewee import BlobField, BooleanField, CharField, FloatField, IntegerField + from cozy.db.model_base import ModelBase -from peewee import CharField, IntegerField, BlobField, FloatField, BooleanField class Book(ModelBase): diff --git a/cozy/db/offline_cache.py b/cozy/db/offline_cache.py index a71adb81..4607fa6f 100644 --- a/cozy/db/offline_cache.py +++ b/cozy/db/offline_cache.py @@ -1,7 +1,7 @@ -from peewee import ForeignKeyField, BooleanField, CharField +from peewee import BooleanField, CharField, ForeignKeyField -from cozy.db.model_base import ModelBase from cozy.db.file import File +from cozy.db.model_base import ModelBase class OfflineCache(ModelBase): diff --git a/cozy/db/settings.py b/cozy/db/settings.py index e50944aa..851e0f23 100644 --- a/cozy/db/settings.py +++ b/cozy/db/settings.py @@ -1,7 +1,7 @@ -from peewee import CharField, BooleanField, ForeignKeyField, IntegerField +from peewee import BooleanField, CharField, ForeignKeyField, IntegerField -from cozy.db.model_base import ModelBase from cozy.db.book import Book +from cozy.db.model_base import ModelBase DB_VERSION = 10 diff --git a/cozy/db/storage.py b/cozy/db/storage.py index 77c17c36..96d1480a 100644 --- a/cozy/db/storage.py +++ b/cozy/db/storage.py @@ -1,4 +1,4 @@ -from peewee import CharField, IntegerField, BooleanField +from peewee import BooleanField, CharField, IntegerField from cozy.db.model_base import ModelBase diff --git a/cozy/db/track.py b/cozy/db/track.py index 9a4e7619..c89cc8be 100644 --- a/cozy/db/track.py +++ b/cozy/db/track.py @@ -1,7 +1,7 @@ -from peewee import CharField, IntegerField, ForeignKeyField, FloatField +from peewee import CharField, FloatField, ForeignKeyField, IntegerField -from cozy.db.model_base import ModelBase from cozy.db.book import Book +from cozy.db.model_base import ModelBase class Track(ModelBase): diff --git a/cozy/media/gst_player.py b/cozy/media/gst_player.py index 6d57d553..cea6c53c 100644 --- a/cozy/media/gst_player.py +++ b/cozy/media/gst_player.py @@ -5,11 +5,11 @@ from enum import Enum, auto from typing import Optional +from gi.repository import Gst + from cozy.architecture.event_sender import EventSender from cozy.report import reporter -from gi.repository import Gst - log = logging.getLogger("gst_player") diff --git a/cozy/media/importer.py b/cozy/media/importer.py index dd36c92b..d6e044af 100644 --- a/cozy/media/importer.py +++ b/cozy/media/importer.py @@ -4,13 +4,13 @@ import time from enum import Enum, auto from multiprocessing.pool import Pool as Pool -from urllib.parse import urlparse, unquote +from urllib.parse import unquote, urlparse from cozy.architecture.event_sender import EventSender from cozy.architecture.profiler import timing from cozy.control.filesystem_monitor import FilesystemMonitor, StorageNotFound from cozy.ext import inject -from cozy.media.media_detector import MediaDetector, NotAnAudioFile, AudioFileCouldNotBeDiscovered +from cozy.media.media_detector import AudioFileCouldNotBeDiscovered, MediaDetector, NotAnAudioFile from cozy.media.media_file import MediaFile from cozy.model.database_importer import DatabaseImporter from cozy.model.library import Library diff --git a/cozy/media/media_detector.py b/cozy/media/media_detector.py index fb21993a..63a894cb 100644 --- a/cozy/media/media_detector.py +++ b/cozy/media/media_detector.py @@ -1,13 +1,12 @@ import logging import pathlib -from cozy.architecture.event_sender import EventSender +from gi.repository import Gst, GstPbutils +from cozy.architecture.event_sender import EventSender from cozy.media.media_file import MediaFile from cozy.media.tag_reader import TagReader -from gi.repository import Gst, GstPbutils - log = logging.getLogger("media_detector") diff --git a/cozy/media/player.py b/cozy/media/player.py index 40fe24bf..5db7ac63 100644 --- a/cozy/media/player.py +++ b/cozy/media/player.py @@ -3,7 +3,6 @@ import time from threading import Thread from typing import Optional -from cozy.media.importer import Importer, ScanStatus from gi.repository import GLib, Gst @@ -12,6 +11,7 @@ from cozy.control.offline_cache import OfflineCache from cozy.ext import inject from cozy.media.gst_player import GstPlayer, GstPlayerState +from cozy.media.importer import Importer, ScanStatus from cozy.model.book import Book from cozy.model.chapter import Chapter from cozy.model.library import Library diff --git a/cozy/media/tag_reader.py b/cozy/media/tag_reader.py index 1ef07dd4..8cf83096 100644 --- a/cozy/media/tag_reader.py +++ b/cozy/media/tag_reader.py @@ -2,10 +2,9 @@ from urllib.parse import unquote, urlparse import mutagen +from gi.repository import GLib, Gst, GstPbutils from mutagen.mp4 import MP4 -from gi.repository import GstPbutils, Gst, GLib - from cozy.media.chapter import Chapter from cozy.media.media_file import MediaFile diff --git a/cozy/model/book.py b/cozy/model/book.py index 12684da0..8d7e359a 100644 --- a/cozy/model/book.py +++ b/cozy/model/book.py @@ -1,13 +1,13 @@ import logging from contextlib import suppress -from peewee import SqliteDatabase, DoesNotExist +from peewee import DoesNotExist, SqliteDatabase from cozy.application_settings import ApplicationSettings from cozy.architecture.event_sender import EventSender from cozy.architecture.observable import Observable -from cozy.db.collation import collate_natural from cozy.db.book import Book as BookModel +from cozy.db.collation import collate_natural from cozy.db.track import Track as TrackModel from cozy.db.track_to_file import TrackToFile from cozy.ext import inject diff --git a/cozy/model/database_importer.py b/cozy/model/database_importer.py index 6af23d02..64ebd43c 100644 --- a/cozy/model/database_importer.py +++ b/cozy/model/database_importer.py @@ -1,6 +1,6 @@ import logging -from peewee import fn, SqliteDatabase +from peewee import SqliteDatabase, fn from cozy.db.book import Book as BookModel from cozy.db.file import File diff --git a/cozy/model/track.py b/cozy/model/track.py index 7048142e..6a6b74a0 100644 --- a/cozy/model/track.py +++ b/cozy/model/track.py @@ -1,6 +1,6 @@ import logging -from peewee import SqliteDatabase, DoesNotExist +from peewee import DoesNotExist, SqliteDatabase from cozy.db.file import File from cozy.db.track import Track as TrackModel diff --git a/cozy/report/report_to_loki.py b/cozy/report/report_to_loki.py index fc23e2aa..efa98455 100644 --- a/cozy/report/report_to_loki.py +++ b/cozy/report/report_to_loki.py @@ -1,21 +1,19 @@ +import datetime import os - +import platform from contextlib import suppress -import requests -import datetime -import pytz import distro -import platform +import pytz +import requests +from gi.repository import Gtk +from mutagen import version_string as MutagenVersion +from peewee import __version__ as PeeweeVersion from cozy.application_settings import ApplicationSettings from cozy.ext import inject from cozy.report.log_level import LogLevel from cozy.version import __version__ as CozyVersion -from peewee import __version__ as PeeweeVersion -from mutagen import version_string as MutagenVersion - -from gi.repository import Gtk URL = 'https://errors.cozy.sh:3100/api/prom/push' ENABLE = '@INSTALLED@' diff --git a/cozy/report/reporter.py b/cozy/report/reporter.py index 71be3fd6..c5e6849b 100644 --- a/cozy/report/reporter.py +++ b/cozy/report/reporter.py @@ -1,9 +1,7 @@ import traceback - -from cozy.report.log_level import LogLevel - from multiprocessing.pool import ThreadPool as Pool +from cozy.report.log_level import LogLevel from cozy.report.report_to_loki import report report_pool = Pool(5) diff --git a/cozy/tools.py b/cozy/tools.py index cb06d06a..f5607da8 100644 --- a/cozy/tools.py +++ b/cozy/tools.py @@ -1,10 +1,11 @@ -from datetime import datetime -import time +import logging as log import threading -from platform import system as get_system +import time +from datetime import datetime from enum import Enum from gettext import ngettext -import logging as log +from platform import system as get_system + import distro diff --git a/cozy/ui/app_view.py b/cozy/ui/app_view.py index 09d5ca89..feb69606 100644 --- a/cozy/ui/app_view.py +++ b/cozy/ui/app_view.py @@ -1,8 +1,8 @@ -from gi.repository import Gtk, Adw +from gi.repository import Adw, Gtk from cozy.ext import inject -from cozy.view_model.app_view_model import AppViewModel from cozy.view import View +from cozy.view_model.app_view_model import AppViewModel LIBRARY = "main" EMPTY_STATE = "welcome" diff --git a/cozy/ui/book_detail_view.py b/cozy/ui/book_detail_view.py index 3d28f121..7952594c 100644 --- a/cozy/ui/book_detail_view.py +++ b/cozy/ui/book_detail_view.py @@ -1,9 +1,10 @@ import logging -from contextlib import suppress import time +from contextlib import suppress from threading import Event, Thread -from typing import Optional, Callable +from typing import Callable, Optional +from gi.repository import Adw, GLib, Gtk from cozy.control.artwork_cache import ArtworkCache from cozy.ext import inject @@ -14,8 +15,6 @@ from cozy.ui.disk_element import DiskElement from cozy.view_model.book_detail_view_model import BookDetailViewModel -from gi.repository import Adw, GLib, Gtk - log = logging.getLogger("BookDetailView") diff --git a/cozy/ui/chapter_element.py b/cozy/ui/chapter_element.py index 30f247ee..66343c1d 100644 --- a/cozy/ui/chapter_element.py +++ b/cozy/ui/chapter_element.py @@ -1,4 +1,4 @@ -from gi.repository import Gtk, GObject, Gdk +from gi.repository import Gdk, GObject, Gtk from cozy.control.string_representation import seconds_to_str from cozy.model.chapter import Chapter diff --git a/cozy/ui/headerbar.py b/cozy/ui/headerbar.py index 0beceeb3..b7063aa0 100644 --- a/cozy/ui/headerbar.py +++ b/cozy/ui/headerbar.py @@ -1,12 +1,10 @@ import logging +from gi.repository import Adw, GObject, Gtk from cozy.ext import inject from cozy.ui.widgets.progress_popover import ProgressPopover -from cozy.view_model.headerbar_view_model import HeaderbarViewModel, HeaderBarState - -from gi.repository import Adw, Gtk, GObject - +from cozy.view_model.headerbar_view_model import HeaderBarState, HeaderbarViewModel log = logging.getLogger("Headerbar") diff --git a/cozy/ui/import_failed_dialog.py b/cozy/ui/import_failed_dialog.py index 980745ad..1cbefca5 100644 --- a/cozy/ui/import_failed_dialog.py +++ b/cozy/ui/import_failed_dialog.py @@ -4,7 +4,6 @@ from cozy.ext import inject - HEADER = _("This can have multiple reasons:") POSSIBILITIES = "\n • ".join(( # yes, it is a hack, because \t would be too wide "", diff --git a/cozy/ui/library_view.py b/cozy/ui/library_view.py index 5d6141bc..717173f1 100644 --- a/cozy/ui/library_view.py +++ b/cozy/ui/library_view.py @@ -3,10 +3,10 @@ from gi.repository import Adw, Gtk from cozy.ext import inject -from cozy.ui.widgets.book_element import BookElement from cozy.ui.delete_book_view import DeleteBookView +from cozy.ui.widgets.book_element import BookElement from cozy.ui.widgets.filter_list_box import FilterListBox -from cozy.view_model.library_view_model import LibraryViewModel, LibraryViewMode +from cozy.view_model.library_view_model import LibraryViewMode, LibraryViewModel READER_PAGE = "reader" AUTHOR_PAGE = "author" diff --git a/cozy/ui/main_view.py b/cozy/ui/main_view.py index fc2263d9..ecdd53e7 100644 --- a/cozy/ui/main_view.py +++ b/cozy/ui/main_view.py @@ -15,12 +15,11 @@ from cozy.media.importer import Importer, ScanStatus from cozy.media.player import Player from cozy.model.settings import Settings as SettingsModel -from cozy.view_model.storages_view_model import StoragesViewModel -from cozy.ui.library_view import LibraryView from cozy.ui.about_window import AboutWindow +from cozy.ui.library_view import LibraryView from cozy.ui.preferences_window import PreferencesWindow from cozy.ui.widgets.first_import_button import FirstImportButton - +from cozy.view_model.storages_view_model import StoragesViewModel log = logging.getLogger("ui") diff --git a/cozy/ui/media_controller.py b/cozy/ui/media_controller.py index a35163f8..5007ba68 100644 --- a/cozy/ui/media_controller.py +++ b/cozy/ui/media_controller.py @@ -1,5 +1,6 @@ import logging +from gi.repository import Adw, Gdk, Gtk from cozy.control.artwork_cache import ArtworkCache from cozy.db.book import Book @@ -9,8 +10,6 @@ from cozy.ui.widgets.sleep_timer import SleepTimer from cozy.view_model.playback_control_view_model import PlaybackControlViewModel -from gi.repository import Adw, Gtk, Gdk - log = logging.getLogger("MediaController") COVER_SIZE = 46 diff --git a/cozy/ui/search_view.py b/cozy/ui/search_view.py index 0343cba8..bfc22b8b 100644 --- a/cozy/ui/search_view.py +++ b/cozy/ui/search_view.py @@ -1,6 +1,6 @@ import threading -from typing import Callable from collections.abc import Sequence +from typing import Callable from gi.repository import Adw, Gtk diff --git a/cozy/ui/widgets/album_element.py b/cozy/ui/widgets/album_element.py index 80ba95eb..875a8a41 100644 --- a/cozy/ui/widgets/album_element.py +++ b/cozy/ui/widgets/album_element.py @@ -2,12 +2,11 @@ import math import cairo +from gi.repository import GObject, Gtk from cozy.control.artwork_cache import ArtworkCache -from cozy.model.book import Book from cozy.ext import inject - -from gi.repository import Gtk, GObject +from cozy.model.book import Book ALBUM_ART_SIZE = 200 PLAY_BUTTON_ICON_SIZE = Gtk.IconSize.NORMAL diff --git a/cozy/ui/widgets/book_element.py b/cozy/ui/widgets/book_element.py index efeb965a..0d6c13e0 100644 --- a/cozy/ui/widgets/book_element.py +++ b/cozy/ui/widgets/book_element.py @@ -1,4 +1,4 @@ -from gi.repository import Gtk, GObject, Gdk, Gio +from gi.repository import Gdk, Gio, GObject, Gtk from cozy.model.book import Book from cozy.ui.widgets.album_element import AlbumElement diff --git a/cozy/ui/widgets/error_reporting.py b/cozy/ui/widgets/error_reporting.py index ec2f8d7b..28e37eac 100644 --- a/cozy/ui/widgets/error_reporting.py +++ b/cozy/ui/widgets/error_reporting.py @@ -1,11 +1,10 @@ from gettext import gettext as _ +from gi.repository import Gtk from cozy.application_settings import ApplicationSettings from cozy.ext import inject -from gi.repository import Gtk - LEVELS = [ _("Disabled"), _("Basic error reporting"), diff --git a/cozy/ui/widgets/first_import_button.py b/cozy/ui/widgets/first_import_button.py index 00615a7f..3160fcf2 100644 --- a/cozy/ui/widgets/first_import_button.py +++ b/cozy/ui/widgets/first_import_button.py @@ -1,9 +1,9 @@ +from typing import Callable + from gi.repository import Adw, Gtk from .storages import ask_storage_location -from typing import Callable - @Gtk.Template.from_resource('/com/github/geigi/cozy/ui/first_import_button.ui') class FirstImportButton(Gtk.Button): diff --git a/cozy/ui/widgets/playback_speed_popover.py b/cozy/ui/widgets/playback_speed_popover.py index ead36f56..2ffa2413 100644 --- a/cozy/ui/widgets/playback_speed_popover.py +++ b/cozy/ui/widgets/playback_speed_popover.py @@ -1,8 +1,8 @@ +from gi.repository import Gtk + from cozy.ext import inject from cozy.view_model.playback_speed_view_model import PlaybackSpeedViewModel -from gi.repository import Gtk - @Gtk.Template.from_resource('/com/github/geigi/cozy/ui/playback_speed_popover.ui') class PlaybackSpeedPopover(Gtk.Popover): diff --git a/cozy/ui/widgets/sleep_timer.py b/cozy/ui/widgets/sleep_timer.py index c2ae3aea..20f650da 100644 --- a/cozy/ui/widgets/sleep_timer.py +++ b/cozy/ui/widgets/sleep_timer.py @@ -1,8 +1,8 @@ +from gi.repository import Gtk + from cozy.ext import inject from cozy.view_model.sleep_timer_view_model import SleepTimerViewModel, SystemPowerControl -from gi.repository import Gtk - @Gtk.Template.from_resource('/com/github/geigi/cozy/ui/timer_popover.ui') class SleepTimer(Gtk.Popover): diff --git a/cozy/view_model/library_view_model.py b/cozy/view_model/library_view_model.py index 87f4bfda..116ab552 100644 --- a/cozy/view_model/library_view_model.py +++ b/cozy/view_model/library_view_model.py @@ -15,8 +15,8 @@ from cozy.model.library import Library from cozy.open_view import OpenView from cozy.report import reporter -from cozy.ui.widgets.book_element import BookElement from cozy.ui.import_failed_dialog import ImportFailedDialog +from cozy.ui.widgets.book_element import BookElement from cozy.view_model.storages_view_model import StoragesViewModel log = logging.getLogger("library_view_model") diff --git a/pyproject.toml b/pyproject.toml index 763385ad..a07b2df2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,6 +6,7 @@ skip-magic-trailing-comma = true line_length = 100 profile = "black" multi_line_output = 3 +skip = ["cozy/ext/inject/"] [tool.ruff] line-length = 100