Skip to content

Commit

Permalink
Format changed files
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbende committed Dec 3, 2024
1 parent 7215575 commit 69a2e3b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 21 deletions.
3 changes: 1 addition & 2 deletions cozy/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import platform
import sys
import threading
from pathlib import Path
from traceback import format_exception

import distro
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion cozy/ui/main_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
2 changes: 1 addition & 1 deletion cozy/ui/widgets/book_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
22 changes: 11 additions & 11 deletions cozy/ui/widgets/error_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()

10 changes: 4 additions & 6 deletions cozy/ui/widgets/welcome_dialog.py
Original file line number Diff line number Diff line change
@@ -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"

Expand Down

0 comments on commit 69a2e3b

Please sign in to comment.