mirror of https://gitlab.com/bashrc2/epicyon
Set a flag to clear the browser cache when the theme is changed
parent
0b7d96f48c
commit
e03b2e0fd8
10
theme.py
10
theme.py
|
@ -619,6 +619,15 @@ def setNewsAvatar(baseDir: str, name: str,
|
||||||
nickname + '@' + domain + '/avatar.png')
|
nickname + '@' + domain + '/avatar.png')
|
||||||
|
|
||||||
|
|
||||||
|
def _setClearCacheFlag(baseDir: str) -> None:
|
||||||
|
"""Sets a flag which can be used by an external system
|
||||||
|
(eg. a script in a cron job) to clear the browser cache
|
||||||
|
"""
|
||||||
|
flagFilename = baseDir + '/accounts/.clear_cache'
|
||||||
|
with open(flagFilename, 'w+') as flagFile:
|
||||||
|
flagFile.write('\n')
|
||||||
|
|
||||||
|
|
||||||
def setTheme(baseDir: str, name: str, domain: str,
|
def setTheme(baseDir: str, name: str, domain: str,
|
||||||
allowLocalNetworkAccess: bool) -> bool:
|
allowLocalNetworkAccess: bool) -> bool:
|
||||||
"""Sets the theme with the given name as the current theme
|
"""Sets the theme with the given name as the current theme
|
||||||
|
@ -674,4 +683,5 @@ def setTheme(baseDir: str, name: str, domain: str,
|
||||||
disableGrayscale(baseDir)
|
disableGrayscale(baseDir)
|
||||||
|
|
||||||
_setThemeInConfig(baseDir, name)
|
_setThemeInConfig(baseDir, name)
|
||||||
|
_setClearCacheFlag(baseDir)
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue