forked from indymedia/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')
|
'options.css', 'search.css', 'links.css')
|
||||||
|
|
||||||
|
|
||||||
def getThemesList() -> []:
|
def getThemesList(baseDir: str) -> []:
|
||||||
"""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
|
||||||
also used to create the web interface dropdown list
|
also used to create the web interface dropdown list
|
||||||
and to lookup function names
|
and to lookup function names
|
||||||
"""
|
"""
|
||||||
return ('Default', 'Blue', 'Hacker', 'Henge', 'HighVis',
|
themes = []
|
||||||
'IndymediaClassic', 'IndymediaModern',
|
for subdir, dirs, files in os.walk(baseDir + '/theme'):
|
||||||
'LCD', 'Light', 'Night', 'Purple', 'Solidaric',
|
for themeName in dirs:
|
||||||
'Starlight', 'Zen')
|
themes.append(themeName.title())
|
||||||
|
print('Themes available: ' + str(themes))
|
||||||
|
return themes
|
||||||
|
|
||||||
|
|
||||||
def setThemeInConfig(baseDir: str, name: str) -> bool:
|
def setThemeInConfig(baseDir: str, name: str) -> bool:
|
||||||
|
|
Loading…
Reference in New Issue