Skip to content

Commit 57ad412

Browse files
chore: add __all__ to where missing
also change some type comments into formal type annotations
1 parent 0fd0056 commit 57ad412

File tree

15 files changed

+103
-5
lines changed

15 files changed

+103
-5
lines changed

hydrogram/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,20 @@ class ContinuePropagation(StopAsyncIteration):
4141
from .sync import idle, compose
4242

4343
crypto_executor = ThreadPoolExecutor(1, thread_name_prefix="CryptoWorker")
44+
45+
46+
__all__ = [
47+
"Client",
48+
"idle",
49+
"compose",
50+
"StopTransmission",
51+
"StopPropagation",
52+
"ContinuePropagation",
53+
"crypto_executor",
54+
"raw",
55+
"types",
56+
"filters",
57+
"handlers",
58+
"emoji",
59+
"enums",
60+
]

hydrogram/connection/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@
1818
# along with Hydrogram. If not, see <http://www.gnu.org/licenses/>.
1919

2020
from .connection import Connection
21+
22+
23+
__all__ = ["Connection"]

hydrogram/connection/transport/tcp/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,13 @@
2323
from .tcp_full import TCPFull
2424
from .tcp_intermediate import TCPIntermediate
2525
from .tcp_intermediate_o import TCPIntermediateO
26+
27+
28+
__all__ = [
29+
"TCP",
30+
"TCPAbridged",
31+
"TCPAbridgedO",
32+
"TCPFull",
33+
"TCPIntermediate",
34+
"TCPIntermediateO",
35+
]

hydrogram/errors/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# along with Hydrogram. If not, see <http://www.gnu.org/licenses/>.
1919

2020
from .exceptions import *
21-
from .rpc_error import UnknownError
21+
from .rpc_error import UnknownError as UnknownError
2222

2323

2424
class BadMsgNotification(Exception):

hydrogram/handlers/__init__.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,19 @@
2929
from .poll_handler import PollHandler
3030
from .raw_update_handler import RawUpdateHandler
3131
from .user_status_handler import UserStatusHandler
32+
33+
34+
__all__ = [
35+
"CallbackQueryHandler",
36+
"ChatJoinRequestHandler",
37+
"ChatMemberUpdatedHandler",
38+
"ChosenInlineResultHandler",
39+
"DeletedMessagesHandler",
40+
"DisconnectHandler",
41+
"EditedMessageHandler",
42+
"InlineQueryHandler",
43+
"MessageHandler",
44+
"PollHandler",
45+
"RawUpdateHandler",
46+
"UserStatusHandler",
47+
]

hydrogram/parser/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@
1818
# along with Hydrogram. If not, see <http://www.gnu.org/licenses/>.
1919

2020
from .parser import Parser
21+
22+
23+
__all__ = ["Parser"]

hydrogram/raw/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@
2525
for k, v in objects.items():
2626
path, name = v.rsplit(".", 1)
2727
objects[k] = getattr(import_module(path), name)
28+
29+
30+
__all__ = ["types", "functions", "base", "core", "objects"]

hydrogram/raw/core/__init__.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,25 @@
3030
from .primitives.string import String
3131
from .primitives.vector import Vector
3232
from .tl_object import TLObject
33+
34+
35+
__all__ = [
36+
"FutureSalt",
37+
"FutureSalts",
38+
"GzipPacked",
39+
"List",
40+
"Message",
41+
"MsgContainer",
42+
"Bool",
43+
"BoolFalse",
44+
"BoolTrue",
45+
"Bytes",
46+
"Double",
47+
"Int",
48+
"Long",
49+
"Int128",
50+
"Int256",
51+
"String",
52+
"Vector",
53+
"TLObject",
54+
]

hydrogram/raw/core/primitives/__init__.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,18 @@
2323
from .int import Int, Long, Int128, Int256
2424
from .string import String
2525
from .vector import Vector
26+
27+
28+
__all__ = [
29+
"Bool",
30+
"BoolFalse",
31+
"BoolTrue",
32+
"Bytes",
33+
"Double",
34+
"Int",
35+
"Long",
36+
"Int128",
37+
"Int256",
38+
"String",
39+
"Vector",
40+
]

hydrogram/session/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@
1919

2020
from .auth import Auth
2121
from .session import Session
22+
23+
24+
__all__ = ["Auth", "Session"]

0 commit comments

Comments
 (0)