mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +00:00
Fix import errors for the documentation generator
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from telethon_generator.parsers import parse_errors, parse_tl, find_layer
|
||||
from telethon_generator.generators import generate_errors, generate_tlobjects
|
||||
from telethon_generator.generators import\
|
||||
generate_errors, generate_tlobjects, generate_docs
|
||||
|
||||
|
||||
ERRORS_INPUT_JSON = 'data/errors.json'
|
||||
@@ -9,16 +10,17 @@ ERRORS_OUTPUT = '../telethon/errors/rpc_error_list.py'
|
||||
TLOBJECT_INPUT_TL = 'data/scheme.tl'
|
||||
TLOBJECT_OUTPUT = '../telethon/tl'
|
||||
|
||||
DOCS_INPUT_RES = 'data/html'
|
||||
DOCS_OUTPUT = '../docs'
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
generate_tlobjects(
|
||||
tlobjects=list(parse_tl(TLOBJECT_INPUT_TL, ignore_core=True)),
|
||||
layer=find_layer((TLOBJECT_INPUT_TL)),
|
||||
output_dir=TLOBJECT_OUTPUT
|
||||
)
|
||||
tlobjects = list(parse_tl(TLOBJECT_INPUT_TL, ignore_core=True))
|
||||
errors = list(parse_errors(ERRORS_INPUT_JSON, ERRORS_INPUT_DESC))
|
||||
layer = find_layer(TLOBJECT_INPUT_TL)
|
||||
|
||||
generate_tlobjects(tlobjects, layer, TLOBJECT_OUTPUT)
|
||||
with open(ERRORS_OUTPUT, 'w', encoding='utf-8') as file:
|
||||
generate_errors(
|
||||
errors=list(parse_errors(ERRORS_INPUT_JSON, ERRORS_INPUT_DESC)),
|
||||
f=file
|
||||
)
|
||||
generate_errors(errors, file)
|
||||
|
||||
generate_docs(tlobjects, errors, layer, DOCS_INPUT_RES, DOCS_OUTPUT)
|
||||
|
Reference in New Issue
Block a user