mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Move tl_generator to generators/ and remove the class
This commit is contained in:
@@ -1,15 +1,24 @@
|
||||
from telethon_generator.parsers import parse_errors
|
||||
from telethon_generator.generators import generate_errors
|
||||
from telethon_generator.parsers import parse_errors, parse_tl, find_layer
|
||||
from telethon_generator.generators import generate_errors, generate_tlobjects
|
||||
|
||||
|
||||
INPUT_JSON = 'errors.json'
|
||||
INPUT_DESCRIPTIONS = 'error_descriptions'
|
||||
OUTPUT = '../telethon/errors/rpc_error_list.py'
|
||||
ERRORS_INPUT_JSON = 'errors.json'
|
||||
ERRORS_INPUT_DESC = 'error_descriptions'
|
||||
ERRORS_OUTPUT = '../telethon/errors/rpc_error_list.py'
|
||||
|
||||
TLOBJECT_INPUT_TL = 'scheme.tl'
|
||||
TLOBJECT_OUTPUT = '../telethon/tl'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
with open(OUTPUT, 'w', encoding='utf-8') as file:
|
||||
generate_tlobjects(
|
||||
tlobjects=list(parse_tl(TLOBJECT_INPUT_TL, ignore_core=True)),
|
||||
layer=find_layer((TLOBJECT_INPUT_TL)),
|
||||
output_dir=TLOBJECT_OUTPUT
|
||||
)
|
||||
|
||||
with open(ERRORS_OUTPUT, 'w', encoding='utf-8') as file:
|
||||
generate_errors(
|
||||
errors=list(parse_errors(INPUT_JSON, INPUT_DESCRIPTIONS)),
|
||||
errors=list(parse_errors(ERRORS_INPUT_JSON, ERRORS_INPUT_DESC)),
|
||||
f=file
|
||||
)
|
||||
|
Reference in New Issue
Block a user