mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 05:18:10 +00:00
Update API compiler
This commit is contained in:
parent
ddb8c9e595
commit
b1b04b5768
@ -41,12 +41,12 @@ constructors_to_functions = {}
|
|||||||
def get_docstring_arg_type(t: str, is_list: bool = False):
|
def get_docstring_arg_type(t: str, is_list: bool = False):
|
||||||
if t in core_types:
|
if t in core_types:
|
||||||
if t == "long":
|
if t == "long":
|
||||||
return ":obj:`int`:obj:`64-bit`"
|
return ":obj:`int` :obj:`64-bit`"
|
||||||
elif "int" in t:
|
elif "int" in t:
|
||||||
size = INT_RE.match(t)
|
size = INT_RE.match(t)
|
||||||
return ":obj:`int`:obj:`{}-bit`".format(size.group(1)) if size else ":obj:`int`:obj:`32-bit`"
|
return ":obj:`int` :obj:`{}-bit`".format(size.group(1)) if size else ":obj:`int` :obj:`32-bit`"
|
||||||
elif t == "double":
|
elif t == "double":
|
||||||
return ":obj:`float`:obj:`64-bit`"
|
return ":obj:`float` :obj:`64-bit`"
|
||||||
elif t == "string":
|
elif t == "string":
|
||||||
return ":obj:`str`"
|
return ":obj:`str`"
|
||||||
else:
|
else:
|
||||||
@ -264,7 +264,7 @@ def start():
|
|||||||
docstring_args.append(
|
docstring_args.append(
|
||||||
"{}: {}{}".format(
|
"{}: {}{}".format(
|
||||||
arg_name,
|
arg_name,
|
||||||
"(optional {}) ".format(flag_number) if is_optional else "",
|
"``optional.{}``".format(flag_number) if is_optional else "",
|
||||||
get_docstring_arg_type(arg_type)
|
get_docstring_arg_type(arg_type)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user