2020-03-21 14:43:32 +00:00
|
|
|
# Pyrogram - Telegram MTProto API Client Library for Python
|
2021-01-01 21:58:48 +00:00
|
|
|
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
|
2017-12-05 11:26:27 +00:00
|
|
|
#
|
2020-03-21 14:43:32 +00:00
|
|
|
# This file is part of Pyrogram.
|
2017-12-05 11:26:27 +00:00
|
|
|
#
|
2020-03-21 14:43:32 +00:00
|
|
|
# Pyrogram is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Lesser General Public License as published
|
|
|
|
# by the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2017-12-05 11:26:27 +00:00
|
|
|
#
|
2020-03-21 14:43:32 +00:00
|
|
|
# Pyrogram is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Lesser General Public License for more details.
|
2017-12-05 11:26:27 +00:00
|
|
|
#
|
2020-03-21 14:43:32 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
2017-12-05 11:26:27 +00:00
|
|
|
|
2021-04-15 07:51:50 +00:00
|
|
|
__version__ = "1.2.9"
|
2019-03-25 10:10:46 +00:00
|
|
|
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
|
2021-01-10 14:56:42 +00:00
|
|
|
__copyright__ = "Copyright (C) 2017-2021 Dan <https://github.com/delivrance>"
|
2019-03-25 10:10:46 +00:00
|
|
|
|
2020-12-07 18:16:46 +00:00
|
|
|
from concurrent.futures.thread import ThreadPoolExecutor
|
|
|
|
|
2020-08-22 06:05:05 +00:00
|
|
|
|
|
|
|
class StopTransmission(StopAsyncIteration):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class StopPropagation(StopAsyncIteration):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
class ContinuePropagation(StopAsyncIteration):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2020-08-30 22:17:33 +00:00
|
|
|
import asyncio
|
|
|
|
|
2020-08-30 09:17:20 +00:00
|
|
|
from . import raw, types, filters, handlers, emoji
|
2020-08-22 06:05:05 +00:00
|
|
|
from .client import Client
|
|
|
|
from .sync import idle
|
2020-08-30 22:17:33 +00:00
|
|
|
|
|
|
|
# Save the main thread loop for future references
|
|
|
|
main_event_loop = asyncio.get_event_loop()
|
2020-12-07 18:16:46 +00:00
|
|
|
|
|
|
|
CRYPTO_EXECUTOR_SIZE_THRESHOLD = 512
|
|
|
|
|
2021-01-02 17:45:43 +00:00
|
|
|
crypto_executor = ThreadPoolExecutor(1, thread_name_prefix="CryptoWorker")
|