From 849321e5ca7eb2e636aa9a497bd08ed71f0b89da Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 11 Apr 2022 14:27:20 +0200 Subject: [PATCH] Remove unneeded parts --- compiler/api/compiler.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/api/compiler.py b/compiler/api/compiler.py index b8cf8b0c..4f83cf0a 100644 --- a/compiler/api/compiler.py +++ b/compiler/api/compiler.py @@ -361,14 +361,12 @@ def start(format: bool = False): for i, arg in enumerate(sorted_args): arg_name, arg_type = arg - is_optional = FLAGS_RE.match(arg_type) - flag_number = is_optional.group(1) if is_optional else -1 arg_type = arg_type.split("?")[-1] docstring_args.append( "{}{}: {}".format( arg_name, - " (optional)".format(flag_number) if is_optional else "", + " (optional)", get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram") ) ) @@ -413,7 +411,8 @@ def start(format: bool = False): if flag.group(3) == "true" or flag.group(3).startswith("Vector"): write_flags.append(f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} else 0") else: - write_flags.append(f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} is not None else 0") + write_flags.append( + f"{arg_name} |= (1 << {flag.group(2)}) if self.{i[0]} is not None else 0") write_flags = "\n ".join([ f"{arg_name} = 0",