mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-10-01 07:47:53 +00:00
Format code with black and autopep8
This commit fixes the style issues introduced in 358cd41
according to the output
from black and autopep8.
Details: https://deepsource.io/gh/GradienceTeam/Gradience/transform/936b0b83-12eb-4103-a3f4-3f142542db0a/
This commit is contained in:
parent
358cd41f9f
commit
d5501996a5
1 changed files with 44 additions and 30 deletions
|
@ -85,7 +85,6 @@ class FirefoxGnomeThemePlugin(IPlugin):
|
||||||
css = BASE
|
css = BASE
|
||||||
browser_row = Adw.EntryRow(
|
browser_row = Adw.EntryRow(
|
||||||
title="Path to the profile directory",
|
title="Path to the profile directory",
|
||||||
|
|
||||||
)
|
)
|
||||||
profile_dir = None
|
profile_dir = None
|
||||||
|
|
||||||
|
@ -135,18 +134,18 @@ class FirefoxGnomeThemePlugin(IPlugin):
|
||||||
# Browser
|
# Browser
|
||||||
self.browser_pref = Adw.PreferencesGroup()
|
self.browser_pref = Adw.PreferencesGroup()
|
||||||
self.browser_pref.set_title("Browser")
|
self.browser_pref.set_title("Browser")
|
||||||
self.browser_pref.set_description("Choose where profiles are stored. If you don't know what this is, leave it as default, it will work in most cases.")
|
self.browser_pref.set_description(
|
||||||
|
"Choose where profiles are stored. If you don't know what this is, leave it as default, it will work in most cases."
|
||||||
|
)
|
||||||
|
|
||||||
self.browser_row = Adw.EntryRow(
|
self.browser_row = Adw.EntryRow(
|
||||||
title="Path to the directory where profiles are stored",
|
title="Path to the directory where profiles are stored",
|
||||||
|
|
||||||
)
|
)
|
||||||
self.browser_row.set_text("~/.mozilla/firefox")
|
self.browser_row.set_text("~/.mozilla/firefox")
|
||||||
self.browser_row.set_show_apply_button(True)
|
self.browser_row.set_show_apply_button(True)
|
||||||
self.browser_row.connect("apply", self.on_apply)
|
self.browser_row.connect("apply", self.on_apply)
|
||||||
self.browser_pref.add(self.browser_row)
|
self.browser_pref.add(self.browser_row)
|
||||||
|
|
||||||
|
|
||||||
self.main_page.add(self.browser_pref)
|
self.main_page.add(self.browser_pref)
|
||||||
|
|
||||||
self.window.add(self.main_page)
|
self.window.add(self.main_page)
|
||||||
|
@ -161,12 +160,10 @@ class FirefoxGnomeThemePlugin(IPlugin):
|
||||||
else:
|
else:
|
||||||
self.browser_row.remove_css_class("error")
|
self.browser_row.remove_css_class("error")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def on_overwrite(self, widget, _):
|
def on_overwrite(self, widget, _):
|
||||||
# This is called when the user changes the overwrite setting
|
# This is called when the user changes the overwrite setting
|
||||||
self.custom_settings["overwrite"] = not self.custom_settings["overwrite"]
|
self.custom_settings["overwrite"] = not self.custom_settings["overwrite"]
|
||||||
|
|
||||||
def validate(self):
|
def validate(self):
|
||||||
# Normally, it would be a good idea to validate the settings here
|
# Normally, it would be a good idea to validate the settings here
|
||||||
# But because there is only one setting and it can onbly be a boolean
|
# But because there is only one setting and it can onbly be a boolean
|
||||||
|
@ -201,23 +198,40 @@ class FirefoxGnomeThemePlugin(IPlugin):
|
||||||
print("No profiles found")
|
print("No profiles found")
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self.css = self.css.format(d_1=self.palette["dark_"]["1"], d_2=self.palette["dark_"]["2"], d_3=self.palette["dark_"]["3"], d_4=self.palette["dark_"]["4"],
|
self.css = self.css.format(
|
||||||
l_1=self.palette["light_"]["1"], l_2=self.palette["light_"][
|
d_1=self.palette["dark_"]["1"],
|
||||||
"2"], l_3=self.palette["light_"]["3"], l_4=self.palette["light_"]["4"],
|
d_2=self.palette["dark_"]["2"],
|
||||||
bg=self.variables["window_bg_color"], fg=self.variables["window_fg_color"],
|
d_3=self.palette["dark_"]["3"],
|
||||||
|
d_4=self.palette["dark_"]["4"],
|
||||||
red=self.palette["red_"]["5"], grn=self.palette["green_"][
|
l_1=self.palette["light_"]["1"],
|
||||||
"5"], ylw=self.palette["yellow_"]["5"], blu=self.palette["blue_"]["5"],
|
l_2=self.palette["light_"]["2"],
|
||||||
pnk=self.palette["purple_"]["5"], cyn=self.palette["blue_"][
|
l_3=self.palette["light_"]["3"],
|
||||||
"5"], wht=self.palette["light_"]["5"], blk=self.palette["dark_"]["5"],
|
l_4=self.palette["light_"]["4"],
|
||||||
|
bg=self.variables["window_bg_color"],
|
||||||
b_red=self.palette["red_"]["1"], b_grn=self.palette["green_"][
|
fg=self.variables["window_fg_color"],
|
||||||
"1"], b_ylw=self.palette["yellow_"]["1"], b_blu=self.palette["blue_"]["1"],
|
red=self.palette["red_"]["5"],
|
||||||
b_pnk=self.palette["purple_"]["1"], b_cyn=self.palette["blue_"]["1"], b_wht=self.palette["light_"]["1"], b_blk=self.palette["dark_"]["1"])
|
grn=self.palette["green_"]["5"],
|
||||||
|
ylw=self.palette["yellow_"]["5"],
|
||||||
|
blu=self.palette["blue_"]["5"],
|
||||||
|
pnk=self.palette["purple_"]["5"],
|
||||||
|
cyn=self.palette["blue_"]["5"],
|
||||||
|
wht=self.palette["light_"]["5"],
|
||||||
|
blk=self.palette["dark_"]["5"],
|
||||||
|
b_red=self.palette["red_"]["1"],
|
||||||
|
b_grn=self.palette["green_"]["1"],
|
||||||
|
b_ylw=self.palette["yellow_"]["1"],
|
||||||
|
b_blu=self.palette["blue_"]["1"],
|
||||||
|
b_pnk=self.palette["purple_"]["1"],
|
||||||
|
b_cyn=self.palette["blue_"]["1"],
|
||||||
|
b_wht=self.palette["light_"]["1"],
|
||||||
|
b_blk=self.palette["dark_"]["1"],
|
||||||
|
)
|
||||||
print(self.css)
|
print(self.css)
|
||||||
for profile in profiles:
|
for profile in profiles:
|
||||||
print(profile)
|
print(profile)
|
||||||
profile = profile / "chrome" / "firefox-gnome-theme" / "customChrome.css"
|
profile = (
|
||||||
|
profile / "chrome" / "firefox-gnome-theme" / "customChrome.css"
|
||||||
|
)
|
||||||
if profile.exists():
|
if profile.exists():
|
||||||
if self.custom_settings["overwrite"]:
|
if self.custom_settings["overwrite"]:
|
||||||
with open(profile, "w", encoding="utf-8") as f:
|
with open(profile, "w", encoding="utf-8") as f:
|
||||||
|
|
Loading…
Reference in a new issue