mirror of
https://github.com/GradienceTeam/Gradience.git
synced 2024-09-29 23:17:53 +00:00
Firefox theme plugin: correctly parse installations with multipe profiles (#626)
# Allows theming firefox/librefox installations with multiple profiles The old code would incorrectly iterate over files (such as the profiles.ini file) which would trigger an exception and skip the entire firefox installation. This checks the path to ensure it is a directory (and thus a profile) before trying to open the customChrome.css file for writing. It correctly themes my Librefox now. ## Changelog - Fixed path iteration
This commit is contained in:
commit
35e14b3960
1 changed files with 4 additions and 5 deletions
|
@ -118,11 +118,10 @@ class FirefoxGnomeTheme2Plugin(IPlugin):
|
|||
"~/.var/app/org.mozilla.firefox/.mozilla/firefox",
|
||||
"~/.var/app/io.gitlab.librewolf-community/.librewolf"]:
|
||||
try:
|
||||
with (
|
||||
next(Path("firefox").expanduser().glob("*.*"))
|
||||
/ "chrome/firefox-gnome-theme/customChrome.css"
|
||||
).open("w") as f:
|
||||
f.write(self.template.format(**self.variables))
|
||||
for result in Path(path).expanduser().glob("*.*"):
|
||||
if Path.is_dir(result):
|
||||
with open(f"{result}/chrome/firefox-gnome-theme/customChrome.css","w") as f:
|
||||
f.write(self.template.format(**self.variables))
|
||||
except OSError:
|
||||
pass
|
||||
except StopIteration:
|
||||
|
|
Loading…
Reference in a new issue