mirror of https://gitlab.com/bashrc2/epicyon
Automatically detect available themes
parent
dcb215f6b3
commit
d502b3be1e
12
theme.py
12
theme.py
|
@ -18,16 +18,18 @@ def getThemeFiles() -> []:
|
|||
'options.css', 'search.css', 'links.css')
|
||||
|
||||
|
||||
def getThemesList() -> []:
|
||||
def getThemesList(baseDir: str) -> []:
|
||||
"""Returns the list of available themes
|
||||
Note that these should be capitalized, since they're
|
||||
also used to create the web interface dropdown list
|
||||
and to lookup function names
|
||||
"""
|
||||
return ('Default', 'Blue', 'Hacker', 'Henge', 'HighVis',
|
||||
'IndymediaClassic', 'IndymediaModern',
|
||||
'LCD', 'Light', 'Night', 'Purple', 'Solidaric',
|
||||
'Starlight', 'Zen')
|
||||
themes = []
|
||||
for subdir, dirs, files in os.walk(baseDir + '/theme'):
|
||||
for themeName in dirs:
|
||||
themes.append(themeName.title())
|
||||
print('Themes available: ' + str(themes))
|
||||
return themes
|
||||
|
||||
|
||||
def setThemeInConfig(baseDir: str, name: str) -> bool:
|
||||
|
|
Loading…
Reference in New Issue