mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-11-12 12:00:37 +00:00
Document raw methods with friendly variants
This commit is contained in:
@@ -58,10 +58,13 @@ def _from_line(line, is_function, method_info, layer):
|
||||
)
|
||||
|
||||
name = match.group(1)
|
||||
if name in method_info:
|
||||
usability = method_info[name].usability
|
||||
method_info = method_info.get(name)
|
||||
if method_info:
|
||||
usability = method_info.usability
|
||||
friendly = method_info.friendly
|
||||
else:
|
||||
usability = Usability.UNKNOWN
|
||||
friendly = None
|
||||
|
||||
return TLObject(
|
||||
fullname=name,
|
||||
@@ -70,6 +73,7 @@ def _from_line(line, is_function, method_info, layer):
|
||||
is_function=is_function,
|
||||
layer=layer,
|
||||
usability=usability,
|
||||
friendly=friendly,
|
||||
args=[TLArg(name, arg_type, brace != '')
|
||||
for brace, name, arg_type in args_match]
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ WHITELISTED_MISMATCHING_IDS = {
|
||||
|
||||
class TLObject:
|
||||
def __init__(self, fullname, object_id, args, result,
|
||||
is_function, usability, layer):
|
||||
is_function, usability, friendly, layer):
|
||||
"""
|
||||
Initializes a new TLObject, given its properties.
|
||||
|
||||
@@ -25,6 +25,7 @@ class TLObject:
|
||||
:param result: The result type of the TL object
|
||||
:param is_function: Is the object a function or a type?
|
||||
:param usability: The usability for this method.
|
||||
:param friendly: A tuple (namespace, friendly method name) if known.
|
||||
:param layer: The layer this TLObject belongs to.
|
||||
"""
|
||||
# The name can or not have a namespace
|
||||
@@ -38,6 +39,7 @@ class TLObject:
|
||||
self.result = result
|
||||
self.is_function = is_function
|
||||
self.usability = usability
|
||||
self.friendly = friendly
|
||||
self.id = None
|
||||
if object_id is None:
|
||||
self.id = self.infer_id()
|
||||
|
||||
Reference in New Issue
Block a user