Fixes by autopep8 action (#225)

This commit is contained in:
0xMRTT 2022-08-20 13:39:34 +02:00 committed by GitHub
commit e2d64779f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -105,9 +105,11 @@ class GradienceMainWindow(Adw.ApplicationWindow):
def get_default_wallpaper(self): def get_default_wallpaper(self):
background_settings = Gio.Settings("org.gnome.desktop.background") background_settings = Gio.Settings("org.gnome.desktop.background")
if self.style_manager.get_dark(): if self.style_manager.get_dark():
self.monet_image_file = background_settings.get_string("picture-uri-dark") self.monet_image_file = background_settings.get_string(
"picture-uri-dark")
else: else:
self.monet_image_file = background_settings.get_string("picture-uri-dark") self.monet_image_file = background_settings.get_string(
"picture-uri-dark")
print(self.monet_image_file) print(self.monet_image_file)
self.monet_image_file = Gio.File.new_for_uri(self.monet_image_file) self.monet_image_file = Gio.File.new_for_uri(self.monet_image_file)
@ -116,7 +118,6 @@ class GradienceMainWindow(Adw.ApplicationWindow):
self.monet_image_file = self.monet_image_file.get_path() self.monet_image_file = self.monet_image_file.get_path()
self.on_apply_button() self.on_apply_button()
def on_file_picker_button_clicked(self, *args): def on_file_picker_button_clicked(self, *args):
self.monet_file_chooser_dialog.show() self.monet_file_chooser_dialog.show()
@ -144,7 +145,6 @@ class GradienceMainWindow(Adw.ApplicationWindow):
self.monet_pref_group.set_description( self.monet_pref_group.set_description(
_("Monet is an engine that generates Material Design 3 palette from backgrounds color.")) _("Monet is an engine that generates Material Design 3 palette from backgrounds color."))
self.apply_button = Gtk.Button() self.apply_button = Gtk.Button()
self.apply_button.set_label(_("Apply")) self.apply_button.set_label(_("Apply"))
self.apply_button.connect("clicked", self.on_apply_button) self.apply_button.connect("clicked", self.on_apply_button)
@ -214,10 +214,10 @@ class GradienceMainWindow(Adw.ApplicationWindow):
self.monet_pref_group.add(self.monet_theme_row) self.monet_pref_group.add(self.monet_theme_row)
self.content_monet.add(self.monet_pref_group) self.content_monet.add(self.monet_pref_group)
def on_apply_button(self, *_args): def on_apply_button(self, *_args):
if self.monet_image_file: if self.monet_image_file:
if self.monet_image_file.endswith(".svg"): if self.monet_image_file.endswith(".svg"):
drawing = svg2rlg(self.monet_image_file) drawing = svg2rlg(self.monet_image_file)
self.monet_image_file = os.path.join( self.monet_image_file = os.path.join(