main
Bob Mottram 2020-07-11 10:30:07 +01:00
parent dabf1334fd
commit e2b569d202
1 changed files with 10 additions and 10 deletions

View File

@ -12,6 +12,11 @@ from utils import saveJson
from shutil import copyfile from shutil import copyfile
def getThemeFiles() -> []:
return ('epicyon.css', 'login.css', 'follow.css',
'suspended.css', 'calendar.css', 'blog.css')
def getThemesList() -> []: def getThemesList() -> []:
"""Returns the list of available themes """Returns the list of available themes
Note that these should be capitalized, since they're Note that these should be capitalized, since they're
@ -44,8 +49,7 @@ def getTheme(baseDir: str) -> str:
def removeTheme(baseDir: str): def removeTheme(baseDir: str):
themeFiles = ('epicyon.css', 'login.css', 'follow.css', themeFiles = getThemeFiles()
'suspended.css', 'calendar.css', 'blog.css')
for filename in themeFiles: for filename in themeFiles:
if os.path.isfile(baseDir + '/' + filename): if os.path.isfile(baseDir + '/' + filename):
os.remove(baseDir + '/' + filename) os.remove(baseDir + '/' + filename)
@ -89,8 +93,7 @@ def setThemeFromDict(baseDir: str, name: str, themeParams: {}) -> None:
""" """
if name: if name:
setThemeInConfig(baseDir, name) setThemeInConfig(baseDir, name)
themeFiles = ('epicyon.css', 'login.css', 'follow.css', themeFiles = getThemeFiles()
'suspended.css', 'calendar.css', 'blog.css')
for filename in themeFiles: for filename in themeFiles:
templateFilename = baseDir + '/epicyon-' + filename templateFilename = baseDir + '/epicyon-' + filename
if filename == 'epicyon.css': if filename == 'epicyon.css':
@ -109,8 +112,7 @@ def setThemeFromDict(baseDir: str, name: str, themeParams: {}) -> None:
def enableGrayscale(baseDir: str) -> None: def enableGrayscale(baseDir: str) -> None:
"""Enables grayscale for the current theme """Enables grayscale for the current theme
""" """
themeFiles = ('epicyon.css', 'login.css', 'follow.css', themeFiles = getThemeFiles()
'suspended.css', 'calendar.css', 'blog.css')
for filename in themeFiles: for filename in themeFiles:
templateFilename = baseDir + '/' + filename templateFilename = baseDir + '/' + filename
if not os.path.isfile(templateFilename): if not os.path.isfile(templateFilename):
@ -133,8 +135,7 @@ def enableGrayscale(baseDir: str) -> None:
def disableGrayscale(baseDir: str) -> None: def disableGrayscale(baseDir: str) -> None:
"""Disables grayscale for the current theme """Disables grayscale for the current theme
""" """
themeFiles = ('epicyon.css', 'login.css', 'follow.css', themeFiles = getThemeFiles()
'suspended.css', 'calendar.css', 'blog.css')
for filename in themeFiles: for filename in themeFiles:
templateFilename = baseDir + '/' + filename templateFilename = baseDir + '/' + filename
if not os.path.isfile(templateFilename): if not os.path.isfile(templateFilename):
@ -171,8 +172,7 @@ def setCustomFont(baseDir: str):
if not customFontExt: if not customFontExt:
return return
themeFiles = ('epicyon.css', 'login.css', 'follow.css', themeFiles = getThemeFiles()
'suspended.css', 'calendar.css', 'blog.css')
for filename in themeFiles: for filename in themeFiles:
templateFilename = baseDir + '/' + filename templateFilename = baseDir + '/' + filename
if not os.path.isfile(templateFilename): if not os.path.isfile(templateFilename):