-
Notifications
You must be signed in to change notification settings - Fork 1.1k
themes in subdirectories #157
Copy link
Copy link
Open
Description
With a growing number of themes, I wanted to put them in subdirectories (original, made_by_me, made_by_others, from_maperitive)
Easy implementation
`def get_available_themes():
if not THEMES_DIR.exists():
st.error("THEMES_DIR doesnt exist")
return []
themes = []
for file in sorted(THEMES_DIR.iterdir()):
if file.is_file() and file.suffix.lower() == '.json':
theme_name = file.stem
themes.append(f"{theme_name}")
for folder in sorted(THEMES_DIR.iterdir()):
if folder.is_dir():
for file in folder.iterdir():
theme_file = folder / f"{file.stem}.json"
if theme_file.exists():
themes.append(f"{folder.name}/{file.stem}")
return themes
Ingenerate_output_filename(city, theme_name, file_format="png")` this line has to be added
theme_name = theme_name.lower().replace(' ', '_').replace(',', '').replace('\\', '_').replace('/', '_')
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels