move Updater and friends to ext submodule

This commit is contained in:
Rahiel Kasim 2016-03-14 14:50:12 +01:00
parent 8b196ce71f
commit 98112d3987
8 changed files with 41 additions and 18 deletions

View file

@ -49,26 +49,21 @@ from .inlinequeryresult import InlineQueryResultArticle, InlineQueryResultGif,\
InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo InlineQueryResultMpeg4Gif, InlineQueryResultPhoto, InlineQueryResultVideo
from .update import Update from .update import Update
from .bot import Bot from .bot import Bot
from .dispatcher import Dispatcher
from .jobqueue import JobQueue
from .updatequeue import UpdateQueue
def Updater(*args, **kwargs): def Updater(*args, **kwargs):
"""Load the updater module on invocation and return an Updater instance.""" """Load the updater module on invocation and return an Updater instance."""
from .updater import Updater as Up from .ext.updater import Updater as Up
return Up(*args, **kwargs) return Up(*args, **kwargs)
__author__ = 'devs@python-telegram-bot.org' __author__ = 'devs@python-telegram-bot.org'
__version__ = '3.3' __version__ = '3.3'
__all__ = ('Bot', 'Updater', 'Dispatcher', 'Emoji', 'TelegramError', __all__ = ('Audio', 'Bot', 'Emoji', 'TelegramError', 'InputFile', 'ReplyMarkup',
'InputFile', 'ReplyMarkup', 'ForceReply', 'ReplyKeyboardHide', 'Contact', 'ForceReply', 'ReplyKeyboardHide', 'ReplyKeyboardMarkup',
'ReplyKeyboardMarkup', 'UserProfilePhotos', 'ChatAction', 'UserProfilePhotos', 'ChatAction', 'Location', 'Video', 'Document',
'Location', 'Contact', 'Video', 'Sticker', 'Document', 'File', 'Sticker', 'File', 'PhotoSize', 'Update', 'ParseMode', 'Message',
'Audio', 'PhotoSize', 'Chat', 'Update', 'ParseMode', 'Message', 'User', 'TelegramObject', 'NullHandler', 'Voice', 'InlineQuery',
'User', 'TelegramObject', 'NullHandler', 'Voice', 'JobQueue', 'Chat', 'ChosenInlineResult', 'InlineQueryResultArticle',
'InlineQuery', 'ChosenInlineResult', 'InlineQueryResultArticle',
'InlineQueryResultGif', 'InlineQueryResultPhoto', 'InlineQueryResultGif', 'InlineQueryResultPhoto',
'InlineQueryResultMpeg4Gif', 'InlineQueryResultVideo', 'InlineQueryResultMpeg4Gif', 'InlineQueryResultVideo')
'UpdateQueue')

28
telegram/ext/__init__.py Normal file
View file

@ -0,0 +1,28 @@
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2016
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program 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 Public License for more details.
#
# You should have received a copy of the GNU Lesser Public License
# along with this program. If not, see [http://www.gnu.org/licenses/].
"""Extensions over the Telegram Bot API to facilitate bot making"""
from .dispatcher import Dispatcher
from .jobqueue import JobQueue
from .updatequeue import UpdateQueue
from .updater import Updater
__all__ = ('Dispatcher', 'JobQueue', 'UpdateQueue', 'Updater')

View file

@ -27,7 +27,7 @@ from re import match
from time import sleep from time import sleep
from telegram import (TelegramError, Update, NullHandler) from telegram import (TelegramError, Update, NullHandler)
from telegram.updatequeue import Empty from telegram.ext.updatequeue import Empty
H = NullHandler() H = NullHandler()
logging.getLogger(__name__).addHandler(H) logging.getLogger(__name__).addHandler(H)

View file

@ -28,8 +28,8 @@ from threading import Thread, Lock, current_thread, Event
from time import sleep from time import sleep
import subprocess import subprocess
from signal import signal, SIGINT, SIGTERM, SIGABRT from signal import signal, SIGINT, SIGTERM, SIGABRT
from telegram import (Bot, TelegramError, dispatcher, Dispatcher, from telegram import Bot, TelegramError, NullHandler
NullHandler, JobQueue, UpdateQueue) from telegram.ext import dispatcher, Dispatcher, JobQueue, UpdateQueue
from telegram.utils.webhookhandler import (WebhookServer, WebhookHandler) from telegram.utils.webhookhandler import (WebhookServer, WebhookHandler)
H = NullHandler() H = NullHandler()

View file

@ -37,7 +37,7 @@ except ImportError:
sys.path.append('.') sys.path.append('.')
from telegram import JobQueue, Updater from telegram.ext import JobQueue, Updater
from tests.base import BaseTest from tests.base import BaseTest
# Enable logging # Enable logging

View file

@ -48,7 +48,7 @@ except ImportError:
sys.path.append('.') sys.path.append('.')
from telegram import Update, Message, TelegramError, User, Chat, Updater, Bot from telegram import Update, Message, TelegramError, User, Chat, Updater, Bot
from telegram.dispatcher import run_async from telegram.ext.dispatcher import run_async
from tests.base import BaseTest from tests.base import BaseTest
from threading import Lock, Thread from threading import Lock, Thread