-
Notifications
You must be signed in to change notification settings - Fork 3
/
config.py
executable file
·28 lines (21 loc) · 1.13 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
languages_to_generate = ["en"] # For now, there is no change between languages, but maybe in the future, shortcodes will be I18N'ed, and the script is ready for that.
output_dir = "snippets/"
cache_dir_def = "cache/def/" # WARNING : cache dirs will get emptied!
cache_dir_decolsp = "cache/decolsp/"
cache_dir_decoldedup = "cache/decoldedup/"
enable_skins = True # Use ok_hand_tone1 for example
# == Config test, do not edit after this line. ==
import os
import shutil
def ensure_directory(directory, empty=False):
if not os.path.exists(directory):
os.makedirs(directory)
elif empty:
shutil.rmtree(directory)
os.makedirs(directory)
AVAILABLE_LANGS = ["da", "de", "en", "en-gb", "es", "es-mx", "fr", "it", "ja", "ko", "ms", "nl", "pl", "pt", "ru", "sv", "th", "zh", "zh-hant"]
assert set(languages_to_generate).issubset(set(AVAILABLE_LANGS)), "The language specified cound't be found."
ensure_directory(output_dir)
ensure_directory(cache_dir_def , empty=True)
ensure_directory(cache_dir_decolsp , empty=True)
ensure_directory(cache_dir_decoldedup , empty=True)