diff --git a/extract-lang.py b/extract-lang.py index ccd95e3..3ab97ad 100644 --- a/extract-lang.py +++ b/extract-lang.py @@ -12,9 +12,13 @@ def find_languges(yaml, starting_list = []): find_languges(l, lang_list) elif isinstance(yaml[k], dict): find_languges(yaml[k], lang_list) + else: + pass elif isinstance(yaml, list): for l in yaml: find_languges(l, lang_list) + else: + pass return lang_list def find_engines(yaml, starting_list = []): @@ -28,20 +32,24 @@ def find_engines(yaml, starting_list = []): find_engines(l, engine_list) elif isinstance(yaml[k], dict): find_engines(yaml[k], engine_list) + else: + pass elif isinstance(yaml, list): for l in yaml: find_engines(l, engine_list) + else: + pass return engine_list with open(sys.argv[1], 'r') as file: yaml = yaml.load(file, Loader=yaml.FullLoader) lang_list = find_languges(yaml) engine_list = find_engines(yaml) - + output_string = '' - + for e in engine_list: for l in lang_list: output_string += ' ' + e + '-' + l - - print(output_string) \ No newline at end of file + + print(output_string)