MCPcopy
hub / github.com/PDFMathTranslate/PDFMathTranslate / get_translator_by_name

Method get_translator_by_name

pdf2zh/config.py:128–135  ·  view source on GitHub ↗

根据 name 获取对应的 translator 配置

(cls, name)

Source from the content-addressed store, hash-verified

126
127 @classmethod
128 def get_translator_by_name(cls, name):
129 """根据 name 获取对应的 translator 配置"""
130 instance = cls.get_instance()
131 translators = instance._config_data.get("translators", [])
132 for translator in translators:
133 if translator.get("name") == name:
134 return translator["envs"]
135 return None
136
137 @classmethod
138 def set_translator_by_name(cls, name, new_translator_envs):

Callers 1

set_envsMethod · 0.80

Calls 2

get_instanceMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected