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,
|
||||
systemLanguage)
|
||||
|
||||
# set boolean values
|
||||
if 'rss-icon-at-top' in themeDesignerParams:
|
||||
if themeDesignerParams['rss-icon-at-top'].lower() == '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,
|
||||
allowLocalNetworkAccess, systemLanguage)
|
||||
|
||||
customIconsDir = baseDir + '/accounts/customIcons'
|
||||
if os.path.isdir(customIconsDir):
|
||||
rmtree(customIconsDir, ignore_errors=False, onerror=None)
|
||||
|
||||
|
||||
def _readVariablesFile(baseDir: str, themeName: 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 prevThemeName != name:
|
||||
customVariablesFile = baseDir + '/accounts/theme.json'
|
||||
if os.path.isfile(customVariablesFile):
|
||||
print('Removing theme designer settings')
|
||||
try:
|
||||
os.remove(customVariablesFile)
|
||||
except OSError:
|
||||
print('EX: removing theme designer settings')
|
||||
resetThemeDesignerSettings(baseDir, name, domain,
|
||||
allowLocalNetworkAccess,
|
||||
systemLanguage)
|
||||
|
||||
_removeTheme(baseDir)
|
||||
|
||||
|
|
Loading…
Reference in New Issue