mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-05 04:30:22 +03:00
(Ref) Slightly refactor
This commit is contained in:
parent
921e2eae54
commit
38d0d9aea4
|
@ -222,14 +222,15 @@ class TLGenerator:
|
||||||
"date"]
|
"date"]
|
||||||
|
|
||||||
for arg in args:
|
for arg in args:
|
||||||
|
builder.writeln("\'{}\': ".format(arg.name))
|
||||||
if arg.is_vector:
|
if arg.is_vector:
|
||||||
builder.writeln("\'{}\': [_{} for _ in self.{}] if self.{} is not None else [],"
|
builder.writeln("[x{} for x in self.{}] if self.{} is not None else [],"
|
||||||
.format(arg.name, ".to_dict() if _ is not None else None"
|
.format(".to_dict() if x is not None else None"
|
||||||
if arg.type not in base_types else "",
|
if arg.type not in base_types else "",
|
||||||
arg.name, arg.name))
|
arg.name, arg.name))
|
||||||
else:
|
else:
|
||||||
builder.writeln("\'{}\': self.{}{}, "
|
builder.writeln("self.{}{},"
|
||||||
.format(arg.name, arg.name,
|
.format(arg.name,
|
||||||
".to_dict() if self.{} is not None else None".format(arg.name)
|
".to_dict() if self.{} is not None else None".format(arg.name)
|
||||||
if arg.type not in base_types else ""))
|
if arg.type not in base_types else ""))
|
||||||
builder.write("}")
|
builder.write("}")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user