mirror of https://gitlab.com/bashrc2/epicyon
Handle input for single understood language
parent
8c54b72905
commit
4c9ddc3d4b
12
languages.py
12
languages.py
|
@ -51,8 +51,11 @@ def set_actor_languages(base_dir: str, actor_json: {},
|
||||||
languages_str: str) -> None:
|
languages_str: str) -> None:
|
||||||
"""Sets the languages used by the given actor
|
"""Sets the languages used by the given actor
|
||||||
"""
|
"""
|
||||||
separator = ','
|
languages_str = languages_str.strip()
|
||||||
if '/' in languages_str:
|
separator = None
|
||||||
|
if ',' in languages_str:
|
||||||
|
separator = ','
|
||||||
|
elif '/' in languages_str:
|
||||||
separator = '/'
|
separator = '/'
|
||||||
elif ',' in languages_str:
|
elif ',' in languages_str:
|
||||||
separator = ','
|
separator = ','
|
||||||
|
@ -62,7 +65,10 @@ def set_actor_languages(base_dir: str, actor_json: {},
|
||||||
separator = '+'
|
separator = '+'
|
||||||
elif ' ' in languages_str:
|
elif ' ' in languages_str:
|
||||||
separator = ' '
|
separator = ' '
|
||||||
lang_list = languages_str.lower().split(separator)
|
if separator:
|
||||||
|
lang_list = languages_str.lower().split(separator)
|
||||||
|
else:
|
||||||
|
lang_list = [languages_str.lower()]
|
||||||
lang_list2 = ''
|
lang_list2 = ''
|
||||||
for lang in lang_list:
|
for lang in lang_list:
|
||||||
lang = lang.strip()
|
lang = lang.strip()
|
||||||
|
|
Loading…
Reference in New Issue