diff options
Diffstat (limited to 'sound/tts/languages_dir.py')
-rwxr-xr-x | sound/tts/languages_dir.py | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/sound/tts/languages_dir.py b/sound/tts/languages_dir.py deleted file mode 100755 index 5e1fb1a75b..0000000000 --- a/sound/tts/languages_dir.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/python - -from __future__ import print_function -from optparse import OptionParser - -import os - - -def parse_args(): - opt_parser = OptionParser(usage="This tool creates directories for languages for twine." - + "All directory names shall be listed in languages file with space separator.\n" - + "Example: python %prog path_to_language_file.txt path_to_dir_with_json_files", - version="%prog 1.0") - - (options, args) = opt_parser.parse_args() - - if len(args) != 2: - opt_parser.error("Wrong number of arguments.") - return args - - -def run(): - langs_name, json_dir_name = parse_args() - - print ("Creating directories for languages in json.") - with open(langs_name, 'r') as langs_file: - for lang in langs_file.read().split(): - new_dir = json_dir_name + lang + '.json' - if not os.path.exists(new_dir): - os.makedirs(new_dir) - - -if __name__ == "__main__": - run() |