2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-31 06:16:06 +00:00

Force keyword arguments for all TL types

This commit is contained in:
Dan
2019-03-16 16:50:40 +01:00
parent e0f1f6aaeb
commit 34b51b6481
28 changed files with 133 additions and 108 deletions

View File

@@ -287,9 +287,11 @@ def start():
sorted_args = sort_args(c.args)
arguments = ", " + ", ".join(
[get_argument_type(i) for i in sorted_args if i != ("flags", "#")]
) if c.args else ""
arguments = (
", "
+ ("*, " if c.args else "")
+ (", ".join([get_argument_type(i) for i in sorted_args if i != ("flags", "#")]) if c.args else "")
)
fields = "\n ".join(
["self.{0} = {0} # {1}".format(i[0], i[1]) for i in c.args if i != ("flags", "#")]
@@ -456,7 +458,9 @@ def start():
fields=fields,
read_types=read_types,
write_types=write_types,
return_arguments=", ".join([i[0] for i in sorted_args if i != ("flags", "#")]),
return_arguments=", ".join(
["{0}={0}".format(i[0]) for i in sorted_args if i != ("flags", "#")]
),
slots=", ".join(['"{}"'.format(i[0]) for i in sorted_args if i != ("flags", "#")]),
qualname="{}{}".format("{}.".format(c.namespace) if c.namespace else "", c.name)
)