perf: 完善 yaml 加载

pull/12280/head
Eric 2023-12-05 17:14:35 +08:00 committed by Eric_Lee
parent d2429f7883
commit e193d7a942
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ def get_platform_automation_methods(path, lang=None):
continue
with open(path, 'r', encoding='utf8') as f:
manifest = yaml_load_with_i18n(f, lang)
manifest = yaml_load_with_i18n(f, lang=lang)
check_platform_method(manifest, path)
manifest['dir'] = os.path.dirname(path)
manifest['params_serializer'] = generate_serializer(manifest)

View File

@ -12,7 +12,7 @@ def translate(key, i18n, lang):
return lang_data.get(lang, key)
def yaml_load_with_i18n(stream, lang):
def yaml_load_with_i18n(stream, lang=None):
ori_text = stream.read()
stream = io.StringIO(ori_text)
yaml_data = yaml.safe_load(stream)