Skip to content

Commit 4c3eb8a

Browse files
committed
Merge branch 'new-api' into new-api-docs
2 parents 5e52895 + 1f683ba commit 4c3eb8a

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

compiler/api/compiler.py

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -282,23 +282,24 @@ def start():
282282
flag_number = is_optional.group(1) if is_optional else -1
283283
arg_type = arg_type.split("?")[-1]
284284

285-
if docs:
286-
docstring_args.append(
287-
"{} ({}{}):\n {}\n".format(
288-
arg_name,
289-
get_docstring_arg_type(arg_type, is_pyrogram_type=True),
290-
", optional" if "Optional" in docs[i] else "",
291-
re.sub("Optional\. ", "", docs[i].split("§")[1].rstrip(".") + ".")
292-
)
293-
)
294-
else:
295-
docstring_args.append(
296-
"{}: {}{}".format(
297-
arg_name,
298-
"``optional`` ".format(flag_number) if is_optional else "",
299-
get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram")
300-
)
285+
# if c.namespace == "pyrogram":
286+
# docstring_args.append(
287+
# "{} ({}{}):\n {}\n".format(
288+
# arg_name,
289+
# get_docstring_arg_type(arg_type, is_pyrogram_type=True),
290+
# ", optional" if "Optional" in docs[i] else "",
291+
# re.sub("Optional\. ", "", docs[i].split("§")[1].rstrip(".") + ".")
292+
# )
293+
# )
294+
# else:
295+
296+
docstring_args.append(
297+
"{}{}: {}".format(
298+
arg_name,
299+
" (optional)".format(flag_number) if is_optional else "",
300+
get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram")
301301
)
302+
)
302303

303304
if docstring_args:
304305
docstring_args = "Args:\n " + "\n ".join(docstring_args)

0 commit comments

Comments
 (0)