Weblate 的 Python API¶
安裝¶
The Python API is shipped separately, you need to install the Weblate 客戶端 (wlc) to have it.
pip install wlc
wlc¶
WeblateException¶
- exception wlc.WeblateException¶
所有異常的基類。
Weblate¶
- class wlc.Weblate(key='', url=None, config=None)¶
- 參數:
key (str) -- User key
url (str) -- API server URL, if not specified default is used.
config (wlc.config.WeblateConfig) -- 組態對象,覆蓋任何其他參數。
存取API的類,定義API鍵和可選的API URL。
- get(path)¶
- 參數:
path (str) -- Request path
- 回傳型別:
object
執行單個API呼叫。
- post(path, **kwargs)¶
- 參數:
path (str) -- Request path
- 回傳型別:
object
執行單個API呼叫。
wlc.config¶
WeblateConfig¶
wlc.main¶
- wlc.main.main(settings=None, stdout=None, args=None)¶
- 參數:
settings (list) -- 作為元組列表覆蓋的設定
stdout (object) -- stdout file object for printing output, uses
sys.stdoutas defaultargs (list) -- Command-line arguments to process, uses
sys.argsas default
命令行界面的主要入口點。
Command¶
- class wlc.main.Command(args, config, stdout=None)¶
用於呼叫命令的主類。