mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2025-03-29 09:40:31 +01:00
remove lazy import of JobQueue
This commit is contained in:
parent
cfdfdeb4fc
commit
cb79317354
2 changed files with 0 additions and 42 deletions
|
@ -80,39 +80,6 @@ from .update import Update
|
||||||
from .bot import Bot
|
from .bot import Bot
|
||||||
|
|
||||||
|
|
||||||
def Updater(*args, **kwargs):
|
|
||||||
"""
|
|
||||||
Load the updater module on invocation and return an Updater instance.
|
|
||||||
"""
|
|
||||||
import warnings
|
|
||||||
warnings.warn("telegram.Updater is being deprecated, please use "
|
|
||||||
"telegram.ext.Updater from now on.")
|
|
||||||
from .ext.updater import Updater as Up
|
|
||||||
return Up(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
def Dispatcher(*args, **kwargs):
|
|
||||||
"""
|
|
||||||
Load the dispatcher module on invocation and return an Dispatcher instance.
|
|
||||||
"""
|
|
||||||
import warnings
|
|
||||||
warnings.warn("telegram.Dispatcher is being deprecated, please use "
|
|
||||||
"telegram.ext.Dispatcher from now on.")
|
|
||||||
from .ext.dispatcher import Dispatcher as Dis
|
|
||||||
return Dis(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
def JobQueue(*args, **kwargs):
|
|
||||||
"""
|
|
||||||
Load the jobqueue module on invocation and return a JobQueue instance.
|
|
||||||
"""
|
|
||||||
import warnings
|
|
||||||
warnings.warn("telegram.JobQueue is being deprecated, please use "
|
|
||||||
"telegram.ext.JobQueue from now on.")
|
|
||||||
from .ext.jobqueue import JobQueue as JobQ
|
|
||||||
return JobQ(*args, **kwargs)
|
|
||||||
|
|
||||||
|
|
||||||
__author__ = 'devs@python-telegram-bot.org'
|
__author__ = 'devs@python-telegram-bot.org'
|
||||||
__version__ = '3.4'
|
__version__ = '3.4'
|
||||||
__all__ = ['Audio',
|
__all__ = ['Audio',
|
||||||
|
|
|
@ -71,15 +71,6 @@ class JobQueueTest(BaseTest, unittest.TestCase):
|
||||||
def job2(self, bot):
|
def job2(self, bot):
|
||||||
raise Exception("Test Error")
|
raise Exception("Test Error")
|
||||||
|
|
||||||
def test_legacy_import(self):
|
|
||||||
from telegram import JobQueue as legacyJobQueue
|
|
||||||
|
|
||||||
ljq = legacyJobQueue("Bot", tick_interval=0.005)
|
|
||||||
|
|
||||||
self.assertIsInstance(ljq, JobQueue)
|
|
||||||
|
|
||||||
ljq.stop()
|
|
||||||
|
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
self.jq.put(self.job1, 0.1)
|
self.jq.put(self.job1, 0.1)
|
||||||
sleep(1.5)
|
sleep(1.5)
|
||||||
|
|
Loading…
Add table
Reference in a new issue