From b0cff31fc140bd26cf7b8b1594721d4405883534 Mon Sep 17 00:00:00 2001 From: Harshil <37377066+harshil21@users.noreply.github.com> Date: Sun, 25 Jun 2023 18:38:26 +0530 Subject: [PATCH] Rename `_handler.py` to `_basehandler.py` (#3761) --- telegram/ext/__init__.py | 2 +- telegram/ext/_application.py | 2 +- telegram/ext/{_handler.py => _basehandler.py} | 2 +- telegram/ext/_callbackqueryhandler.py | 2 +- telegram/ext/_chatjoinrequesthandler.py | 2 +- telegram/ext/_chatmemberhandler.py | 2 +- telegram/ext/_choseninlineresulthandler.py | 2 +- telegram/ext/_commandhandler.py | 2 +- telegram/ext/_conversationhandler.py | 2 +- telegram/ext/_inlinequeryhandler.py | 2 +- telegram/ext/_messagehandler.py | 2 +- telegram/ext/_pollanswerhandler.py | 2 +- telegram/ext/_pollhandler.py | 2 +- telegram/ext/_precheckoutqueryhandler.py | 2 +- telegram/ext/_prefixhandler.py | 2 +- telegram/ext/_shippingqueryhandler.py | 2 +- telegram/ext/_stringcommandhandler.py | 2 +- telegram/ext/_stringregexhandler.py | 2 +- telegram/ext/_typehandler.py | 2 +- tests/ext/{test_handler.py => test_basehandler.py} | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) rename telegram/ext/{_handler.py => _basehandler.py} (99%) rename tests/ext/{test_handler.py => test_basehandler.py} (96%) diff --git a/telegram/ext/__init__.py b/telegram/ext/__init__.py index a6abdb974..b05d608ff 100644 --- a/telegram/ext/__init__.py +++ b/telegram/ext/__init__.py @@ -63,6 +63,7 @@ from . import filters from ._aioratelimiter import AIORateLimiter from ._application import Application, ApplicationHandlerStop from ._applicationbuilder import ApplicationBuilder +from ._basehandler import BaseHandler from ._basepersistence import BasePersistence, PersistenceInput from ._baseratelimiter import BaseRateLimiter from ._baseupdateprocessor import BaseUpdateProcessor, SimpleUpdateProcessor @@ -78,7 +79,6 @@ from ._conversationhandler import ConversationHandler from ._defaults import Defaults from ._dictpersistence import DictPersistence from ._extbot import ExtBot -from ._handler import BaseHandler from ._inlinequeryhandler import InlineQueryHandler from ._jobqueue import Job, JobQueue from ._messagehandler import MessageHandler diff --git a/telegram/ext/_application.py b/telegram/ext/_application.py index 15178d917..ad5540a55 100644 --- a/telegram/ext/_application.py +++ b/telegram/ext/_application.py @@ -56,11 +56,11 @@ from telegram._utils.logging import get_logger from telegram._utils.types import SCT, DVType, ODVInput from telegram._utils.warnings import warn from telegram.error import TelegramError +from telegram.ext._basehandler import BaseHandler from telegram.ext._basepersistence import BasePersistence from telegram.ext._baseupdateprocessor import BaseUpdateProcessor from telegram.ext._contexttypes import ContextTypes from telegram.ext._extbot import ExtBot -from telegram.ext._handler import BaseHandler from telegram.ext._updater import Updater from telegram.ext._utils.stack import was_called_by from telegram.ext._utils.trackingdict import TrackingDict diff --git a/telegram/ext/_handler.py b/telegram/ext/_basehandler.py similarity index 99% rename from telegram/ext/_handler.py rename to telegram/ext/_basehandler.py index 1af83b88d..010302c99 100644 --- a/telegram/ext/_handler.py +++ b/telegram/ext/_basehandler.py @@ -78,7 +78,7 @@ class BaseHandler(Generic[UT, CCT], ABC): Attributes: callback (:term:`coroutine function`): The callback function for this handler. - block (:obj:`bool`): Determines whether the callback will run in a blocking way.. + block (:obj:`bool`): Determines whether the callback will run in a blocking way. """ diff --git a/telegram/ext/_callbackqueryhandler.py b/telegram/ext/_callbackqueryhandler.py index 9e19f8896..a6d5edd36 100644 --- a/telegram/ext/_callbackqueryhandler.py +++ b/telegram/ext/_callbackqueryhandler.py @@ -24,7 +24,7 @@ from typing import TYPE_CHECKING, Any, Callable, Match, Optional, Pattern, TypeV from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_chatjoinrequesthandler.py b/telegram/ext/_chatjoinrequesthandler.py index d98758131..c8a46d989 100644 --- a/telegram/ext/_chatjoinrequesthandler.py +++ b/telegram/ext/_chatjoinrequesthandler.py @@ -23,7 +23,7 @@ from typing import FrozenSet, Optional from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import RT, SCT, DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback diff --git a/telegram/ext/_chatmemberhandler.py b/telegram/ext/_chatmemberhandler.py index 2267ee593..84c1240d6 100644 --- a/telegram/ext/_chatmemberhandler.py +++ b/telegram/ext/_chatmemberhandler.py @@ -22,7 +22,7 @@ from typing import ClassVar, Optional, TypeVar from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback RT = TypeVar("RT") diff --git a/telegram/ext/_choseninlineresulthandler.py b/telegram/ext/_choseninlineresulthandler.py index 4836905a8..b40adf68c 100644 --- a/telegram/ext/_choseninlineresulthandler.py +++ b/telegram/ext/_choseninlineresulthandler.py @@ -23,7 +23,7 @@ from typing import TYPE_CHECKING, Any, Match, Optional, Pattern, TypeVar, Union, from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback RT = TypeVar("RT") diff --git a/telegram/ext/_commandhandler.py b/telegram/ext/_commandhandler.py index c68035208..c31673d9b 100644 --- a/telegram/ext/_commandhandler.py +++ b/telegram/ext/_commandhandler.py @@ -24,7 +24,7 @@ from telegram import MessageEntity, Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import SCT, DVType from telegram.ext import filters as filters_module -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, FilterDataDict, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_conversationhandler.py b/telegram/ext/_conversationhandler.py index a7ee91436..eb1d896c6 100644 --- a/telegram/ext/_conversationhandler.py +++ b/telegram/ext/_conversationhandler.py @@ -41,10 +41,10 @@ from telegram._utils.logging import get_logger from telegram._utils.types import DVType from telegram._utils.warnings import warn from telegram.ext._application import ApplicationHandlerStop +from telegram.ext._basehandler import BaseHandler from telegram.ext._callbackqueryhandler import CallbackQueryHandler from telegram.ext._choseninlineresulthandler import ChosenInlineResultHandler from telegram.ext._extbot import ExtBot -from telegram.ext._handler import BaseHandler from telegram.ext._inlinequeryhandler import InlineQueryHandler from telegram.ext._stringcommandhandler import StringCommandHandler from telegram.ext._stringregexhandler import StringRegexHandler diff --git a/telegram/ext/_inlinequeryhandler.py b/telegram/ext/_inlinequeryhandler.py index 743cbd555..c6a2e1a0c 100644 --- a/telegram/ext/_inlinequeryhandler.py +++ b/telegram/ext/_inlinequeryhandler.py @@ -23,7 +23,7 @@ from typing import TYPE_CHECKING, Any, List, Match, Optional, Pattern, TypeVar, from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_messagehandler.py b/telegram/ext/_messagehandler.py index eff8b3c77..0a9c964c1 100644 --- a/telegram/ext/_messagehandler.py +++ b/telegram/ext/_messagehandler.py @@ -23,7 +23,7 @@ from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType from telegram.ext import filters as filters_module -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_pollanswerhandler.py b/telegram/ext/_pollanswerhandler.py index 5b317d53f..a900ba0ee 100644 --- a/telegram/ext/_pollanswerhandler.py +++ b/telegram/ext/_pollanswerhandler.py @@ -20,7 +20,7 @@ from telegram import Update -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT diff --git a/telegram/ext/_pollhandler.py b/telegram/ext/_pollhandler.py index 66260724b..e6cab3581 100644 --- a/telegram/ext/_pollhandler.py +++ b/telegram/ext/_pollhandler.py @@ -20,7 +20,7 @@ from telegram import Update -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT diff --git a/telegram/ext/_precheckoutqueryhandler.py b/telegram/ext/_precheckoutqueryhandler.py index 36755db70..68e395953 100644 --- a/telegram/ext/_precheckoutqueryhandler.py +++ b/telegram/ext/_precheckoutqueryhandler.py @@ -20,7 +20,7 @@ from telegram import Update -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT diff --git a/telegram/ext/_prefixhandler.py b/telegram/ext/_prefixhandler.py index d2abc702f..571e9f7d7 100644 --- a/telegram/ext/_prefixhandler.py +++ b/telegram/ext/_prefixhandler.py @@ -24,7 +24,7 @@ from telegram import Update from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import SCT, DVType from telegram.ext import filters as filters_module -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_shippingqueryhandler.py b/telegram/ext/_shippingqueryhandler.py index 96c13869e..4c2025aa5 100644 --- a/telegram/ext/_shippingqueryhandler.py +++ b/telegram/ext/_shippingqueryhandler.py @@ -20,7 +20,7 @@ from telegram import Update -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT diff --git a/telegram/ext/_stringcommandhandler.py b/telegram/ext/_stringcommandhandler.py index 632f3be04..2ae16c572 100644 --- a/telegram/ext/_stringcommandhandler.py +++ b/telegram/ext/_stringcommandhandler.py @@ -22,7 +22,7 @@ from typing import TYPE_CHECKING, Any, List, Optional from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, RT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_stringregexhandler.py b/telegram/ext/_stringregexhandler.py index f3abc17b4..b5bb4e018 100644 --- a/telegram/ext/_stringregexhandler.py +++ b/telegram/ext/_stringregexhandler.py @@ -23,7 +23,7 @@ from typing import TYPE_CHECKING, Any, Match, Optional, Pattern, TypeVar, Union from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback if TYPE_CHECKING: diff --git a/telegram/ext/_typehandler.py b/telegram/ext/_typehandler.py index 477e2f6f5..e6a737644 100644 --- a/telegram/ext/_typehandler.py +++ b/telegram/ext/_typehandler.py @@ -22,7 +22,7 @@ from typing import Optional, Type, TypeVar from telegram._utils.defaultvalue import DEFAULT_TRUE from telegram._utils.types import DVType -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from telegram.ext._utils.types import CCT, HandlerCallback RT = TypeVar("RT") diff --git a/tests/ext/test_handler.py b/tests/ext/test_basehandler.py similarity index 96% rename from tests/ext/test_handler.py rename to tests/ext/test_basehandler.py index 6730d916d..01f9b40fb 100644 --- a/tests/ext/test_handler.py +++ b/tests/ext/test_basehandler.py @@ -17,7 +17,7 @@ # You should have received a copy of the GNU Lesser Public License # along with this program. If not, see [http://www.gnu.org/licenses/]. -from telegram.ext._handler import BaseHandler +from telegram.ext._basehandler import BaseHandler from tests.auxil.slots import mro_slots