mirror of https://gitlab.com/bashrc2/epicyon
Use a single function for resetting theme designer changes
parent
85136b7963
commit
f54112a15c
|
@ -2204,6 +2204,7 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
allowLocalNetworkAccess,
|
allowLocalNetworkAccess,
|
||||||
systemLanguage)
|
systemLanguage)
|
||||||
|
|
||||||
|
# set boolean values
|
||||||
if 'rss-icon-at-top' in themeDesignerParams:
|
if 'rss-icon-at-top' in themeDesignerParams:
|
||||||
if themeDesignerParams['rss-icon-at-top'].lower() == 'true':
|
if themeDesignerParams['rss-icon-at-top'].lower() == 'true':
|
||||||
self.server.rssIconAtTop = True
|
self.server.rssIconAtTop = True
|
||||||
|
|
14
theme.py
14
theme.py
|
@ -516,6 +516,10 @@ def resetThemeDesignerSettings(baseDir: str, themeName: str, domain: str,
|
||||||
setTheme(baseDir, themeName, domain,
|
setTheme(baseDir, themeName, domain,
|
||||||
allowLocalNetworkAccess, systemLanguage)
|
allowLocalNetworkAccess, systemLanguage)
|
||||||
|
|
||||||
|
customIconsDir = baseDir + '/accounts/customIcons'
|
||||||
|
if os.path.isdir(customIconsDir):
|
||||||
|
rmtree(customIconsDir, ignore_errors=False, onerror=None)
|
||||||
|
|
||||||
|
|
||||||
def _readVariablesFile(baseDir: str, themeName: str,
|
def _readVariablesFile(baseDir: str, themeName: str,
|
||||||
variablesFile: str,
|
variablesFile: str,
|
||||||
|
@ -826,13 +830,9 @@ def setTheme(baseDir: str, name: str, domain: str,
|
||||||
|
|
||||||
# if the theme has changed then remove any custom settings
|
# if the theme has changed then remove any custom settings
|
||||||
if prevThemeName != name:
|
if prevThemeName != name:
|
||||||
customVariablesFile = baseDir + '/accounts/theme.json'
|
resetThemeDesignerSettings(baseDir, name, domain,
|
||||||
if os.path.isfile(customVariablesFile):
|
allowLocalNetworkAccess,
|
||||||
print('Removing theme designer settings')
|
systemLanguage)
|
||||||
try:
|
|
||||||
os.remove(customVariablesFile)
|
|
||||||
except OSError:
|
|
||||||
print('EX: removing theme designer settings')
|
|
||||||
|
|
||||||
_removeTheme(baseDir)
|
_removeTheme(baseDir)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue