Add namespaces when printing Object types

This commit is contained in:
Dan 2018-06-04 11:58:22 +02:00
parent c22cf3d89a
commit c88ca2e4f5

View File

@ -77,11 +77,14 @@ class Encoder(JSONEncoder):
if o is not None:
if o.startswith("pyrogram.client"):
r = remove_none(OrderedDict([("_", name)] + [i for i in content.items()]))
r = remove_none(OrderedDict([("_", "pyrogram:" + name)] + [i for i in content.items()]))
r.pop("_client", None)
return r
else:
return OrderedDict([("_", o)] + [i for i in content.items()])
return OrderedDict(
[("_", o.replace("pyrogram.api.types.", "telegram:"))]
+ [i for i in content.items()]
)
else:
return None