mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 03:22:29 +00:00
Make use of the new method info when generating docs
This commit is contained in:
6
setup.py
6
setup.py
@@ -54,7 +54,6 @@ DOCS_OUT = 'docs'
|
||||
|
||||
|
||||
def generate(which):
|
||||
# TODO make docs generator use the new CSV too
|
||||
from telethon_generator.parsers import\
|
||||
parse_errors, parse_methods, parse_tl, find_layer
|
||||
|
||||
@@ -64,8 +63,7 @@ def generate(which):
|
||||
layer = find_layer(TLOBJECT_IN_TL)
|
||||
errors = list(parse_errors(ERRORS_IN))
|
||||
methods = list(parse_methods(METHODS_IN, {e.str_code: e for e in errors}))
|
||||
invalid_bot_methods = {m.name for m in methods
|
||||
if not m.usability.startswith('bot')}
|
||||
invalid_bot_methods = {m.name for m in methods if m.usability == 'user'}
|
||||
|
||||
tlobjects = list(itertools.chain(
|
||||
parse_tl(TLOBJECT_IN_CORE_TL, layer, invalid_bot_methods),
|
||||
@@ -110,7 +108,7 @@ def generate(which):
|
||||
if os.path.isdir(DOCS_OUT):
|
||||
shutil.rmtree(DOCS_OUT)
|
||||
else:
|
||||
generate_docs(tlobjects, errors, layer, DOCS_IN_RES, DOCS_OUT)
|
||||
generate_docs(tlobjects, methods, layer, DOCS_IN_RES, DOCS_OUT)
|
||||
|
||||
if 'json' in which:
|
||||
which.remove('json')
|
||||
|
Reference in New Issue
Block a user