mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 01:16:35 +03:00
27 lines
610 B
Python
27 lines
610 B
Python
"""
|
|
Run `telethon_generator.codegen` on both `api.tl` and `mtproto.tl` to output
|
|
corresponding Python code in the default directories under the `client/`.
|
|
"""
|
|
|
|
import subprocess
|
|
import sys
|
|
|
|
GENERATOR = "telethon_generator.codegen"
|
|
GEN_ROOT = "client/src/telethon/_impl"
|
|
TL_ROOT = "generator/tl"
|
|
|
|
|
|
def run(*args: str) -> int:
|
|
return subprocess.run((sys.executable, "-m", *args)).returncode
|
|
|
|
|
|
def main() -> None:
|
|
exit(
|
|
run(GENERATOR, f"{TL_ROOT}/api.tl", f"{GEN_ROOT}/tl")
|
|
or run(GENERATOR, f"{TL_ROOT}/mtproto.tl", f"{GEN_ROOT}/tl/mtproto")
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|