From 1f683ba00e80ce1c56ad597382ef9737140ce5ee Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 11 Apr 2018 03:40:40 +0200 Subject: [PATCH] Update compiler --- compiler/api/compiler.py | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index 250de451..6d77c16b 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -283,23 +283,24 @@ def start(): flag_number = is_optional.group(1) if is_optional else -1 arg_type = arg_type.split("?")[-1] - if docs: - docstring_args.append( - "{} ({}{}):\n {}\n".format( - arg_name, - get_docstring_arg_type(arg_type, is_pyrogram_type=True), - ", optional" if "Optional" in docs[i] else "", - re.sub("Optional\. ", "", docs[i].split("§")[1].rstrip(".") + ".") - ) - ) - else: - docstring_args.append( - "{}: {}{}".format( - arg_name, - "``optional`` ".format(flag_number) if is_optional else "", - get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram") - ) + # if c.namespace == "pyrogram": + # docstring_args.append( + # "{} ({}{}):\n {}\n".format( + # arg_name, + # get_docstring_arg_type(arg_type, is_pyrogram_type=True), + # ", optional" if "Optional" in docs[i] else "", + # re.sub("Optional\. ", "", docs[i].split("§")[1].rstrip(".") + ".") + # ) + # ) + # else: + + docstring_args.append( + "{}{}: {}".format( + arg_name, + " (optional)".format(flag_number) if is_optional else "", + get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram") ) + ) if docstring_args: docstring_args = "Args:\n " + "\n ".join(docstring_args)