mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-10-06 09:37:52 +00:00
Refactor unnecessary else
/ elif
when if
block has a return
statement (#485)
This commit is contained in:
commit
7e0386bf2a
1 changed files with 35 additions and 38 deletions
|
@ -194,46 +194,43 @@ class FirefoxGnomeThemePlugin(IPlugin):
|
||||||
if len(profiles) == 0:
|
if len(profiles) == 0:
|
||||||
print("No profiles found")
|
print("No profiles found")
|
||||||
return
|
return
|
||||||
else:
|
self.css = self.css.format(
|
||||||
self.css = self.css.format(
|
d_1=self.palette["dark_"]["1"],
|
||||||
d_1=self.palette["dark_"]["1"],
|
d_2=self.palette["dark_"]["2"],
|
||||||
d_2=self.palette["dark_"]["2"],
|
d_3=self.palette["dark_"]["3"],
|
||||||
d_3=self.palette["dark_"]["3"],
|
d_4=self.palette["dark_"]["4"],
|
||||||
d_4=self.palette["dark_"]["4"],
|
l_1=self.palette["light_"]["1"],
|
||||||
l_1=self.palette["light_"]["1"],
|
l_2=self.palette["light_"]["2"],
|
||||||
l_2=self.palette["light_"]["2"],
|
l_3=self.palette["light_"]["3"],
|
||||||
l_3=self.palette["light_"]["3"],
|
l_4=self.palette["light_"]["4"],
|
||||||
l_4=self.palette["light_"]["4"],
|
bg=self.variables["window_bg_color"],
|
||||||
bg=self.variables["window_bg_color"],
|
fg=self.variables["window_fg_color"],
|
||||||
fg=self.variables["window_fg_color"],
|
red=self.palette["red_"]["5"],
|
||||||
red=self.palette["red_"]["5"],
|
grn=self.palette["green_"]["5"],
|
||||||
grn=self.palette["green_"]["5"],
|
ylw=self.palette["yellow_"]["5"],
|
||||||
ylw=self.palette["yellow_"]["5"],
|
blu=self.palette["blue_"]["5"],
|
||||||
blu=self.palette["blue_"]["5"],
|
pnk=self.palette["purple_"]["5"],
|
||||||
pnk=self.palette["purple_"]["5"],
|
cyn=self.palette["blue_"]["5"],
|
||||||
cyn=self.palette["blue_"]["5"],
|
wht=self.palette["light_"]["5"],
|
||||||
wht=self.palette["light_"]["5"],
|
blk=self.palette["dark_"]["5"],
|
||||||
blk=self.palette["dark_"]["5"],
|
b_red=self.palette["red_"]["1"],
|
||||||
b_red=self.palette["red_"]["1"],
|
b_grn=self.palette["green_"]["1"],
|
||||||
b_grn=self.palette["green_"]["1"],
|
b_ylw=self.palette["yellow_"]["1"],
|
||||||
b_ylw=self.palette["yellow_"]["1"],
|
b_blu=self.palette["blue_"]["1"],
|
||||||
b_blu=self.palette["blue_"]["1"],
|
b_pnk=self.palette["purple_"]["1"],
|
||||||
b_pnk=self.palette["purple_"]["1"],
|
b_cyn=self.palette["blue_"]["1"],
|
||||||
b_cyn=self.palette["blue_"]["1"],
|
b_wht=self.palette["light_"]["1"],
|
||||||
b_wht=self.palette["light_"]["1"],
|
b_blk=self.palette["dark_"]["1"],
|
||||||
b_blk=self.palette["dark_"]["1"],
|
)
|
||||||
)
|
for profile in profiles:
|
||||||
for profile in profiles:
|
profile = profile / "chrome" / "firefox-gnome-theme" / "customChrome.css"
|
||||||
profile = (
|
if profile.exists():
|
||||||
profile / "chrome" / "firefox-gnome-theme" / "customChrome.css"
|
if self.custom_settings["overwrite"]:
|
||||||
)
|
|
||||||
if profile.exists():
|
|
||||||
if self.custom_settings["overwrite"]:
|
|
||||||
with open(profile, "w", encoding="utf-8") as f:
|
|
||||||
f.write(self.css)
|
|
||||||
else:
|
|
||||||
with open(profile, "w", encoding="utf-8") as f:
|
with open(profile, "w", encoding="utf-8") as f:
|
||||||
f.write(self.css)
|
f.write(self.css)
|
||||||
|
else:
|
||||||
|
with open(profile, "w", encoding="utf-8") as f:
|
||||||
|
f.write(self.css)
|
||||||
|
|
||||||
def save(self):
|
def save(self):
|
||||||
return self.custom_settings
|
return self.custom_settings
|
||||||
|
|
Loading…
Reference in a new issue