Improve method signatures in the docs

This commit is contained in:
Lonami Exo 2019-09-08 10:56:35 +02:00
parent dab237e758
commit 67183ff9e8
4 changed files with 15 additions and 1 deletions

View File

@ -106,7 +106,8 @@ def skip(app, what, name, obj, would_skip, options):
'__init__', '__init__',
'__abstractmethods__', '__abstractmethods__',
'__module__', '__module__',
'__doc__' '__doc__',
'__dict__'
} }
return would_skip return would_skip

View File

@ -1,4 +1,5 @@
import asyncio import asyncio
import inspect
import itertools import itertools
import string import string
import typing import typing
@ -447,6 +448,8 @@ class ChatMethods:
""" """
return await self.iter_participants(*args, **kwargs).collect() return await self.iter_participants(*args, **kwargs).collect()
get_participants.__signature__ = inspect.signature(iter_participants)
def iter_admin_log( def iter_admin_log(
self: 'TelegramClient', self: 'TelegramClient',
entity: 'hints.EntityLike', entity: 'hints.EntityLike',
@ -608,6 +611,8 @@ class ChatMethods:
""" """
return await self.iter_admin_log(*args, **kwargs).collect() return await self.iter_admin_log(*args, **kwargs).collect()
get_admin_log.__signature__ = inspect.signature(iter_admin_log)
def iter_profile_photos( def iter_profile_photos(
self: 'TelegramClient', self: 'TelegramClient',
entity: 'hints.EntityLike', entity: 'hints.EntityLike',
@ -673,6 +678,8 @@ class ChatMethods:
""" """
return await self.iter_profile_photos(*args, **kwargs).collect() return await self.iter_profile_photos(*args, **kwargs).collect()
get_profile_photos.__signature__ = inspect.signature(iter_profile_photos)
def action( def action(
self: 'TelegramClient', self: 'TelegramClient',
entity: 'hints.EntityLike', entity: 'hints.EntityLike',

View File

@ -1,4 +1,5 @@
import asyncio import asyncio
import inspect
import itertools import itertools
import typing import typing
@ -248,6 +249,8 @@ class DialogMethods:
""" """
return await self.iter_dialogs(*args, **kwargs).collect() return await self.iter_dialogs(*args, **kwargs).collect()
get_dialogs.__signature__ = inspect.signature(iter_dialogs)
def iter_drafts( def iter_drafts(
self: 'TelegramClient', self: 'TelegramClient',
entity: 'hints.EntitiesLike' = None entity: 'hints.EntitiesLike' = None

View File

@ -1,3 +1,4 @@
import inspect
import itertools import itertools
import typing import typing
@ -520,6 +521,8 @@ class MessageMethods:
return await it.collect() return await it.collect()
get_messages.__signature__ = inspect.signature(iter_messages)
# endregion # endregion
# region Message sending/editing/deleting # region Message sending/editing/deleting