2020-03-21 14:43:32 +00:00
|
|
|
# Pyrogram - Telegram MTProto API Client Library for Python
|
|
|
|
# Copyright (C) 2017-2020 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
|
|
|
|
2020-12-27 20:08:47 +00:00
|
|
|
__version__ = "1.1.7"
|
2019-03-25 10:10:46 +00:00
|
|
|
__license__ = "GNU Lesser General Public License v3 or later (LGPLv3+)"
|
2020-02-01 13:17:32 +00:00
|
|
|
__copyright__ = "Copyright (C) 2017-2020 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
|
|
|
|
|
|
|
|
crypto_executor = ThreadPoolExecutor(2, thread_name_prefix="CryptoWorker")
|