mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-05-07 23:27:26 +02:00
Deprecate Twisted.
This commit is contained in:
parent
83a91b8453
commit
ecdd16c004
@ -112,6 +112,9 @@ class SupyReconnectingFactory(ReconnectingClientFactory, drivers.ServersMixin):
|
|||||||
maxDelay = property(lambda self: conf.supybot.drivers.maxReconnectWait())
|
maxDelay = property(lambda self: conf.supybot.drivers.maxReconnectWait())
|
||||||
protocol = SupyIrcProtocol
|
protocol = SupyIrcProtocol
|
||||||
def __init__(self, irc):
|
def __init__(self, irc):
|
||||||
|
drivers.log.warning('Twisted driver is deprecated. You should '
|
||||||
|
'consider switching to Socket (set '
|
||||||
|
'supybot.drivers.module to Socket).')
|
||||||
self.irc = irc
|
self.irc = irc
|
||||||
drivers.ServersMixin.__init__(self, irc)
|
drivers.ServersMixin.__init__(self, irc)
|
||||||
(server, port) = self._getNextServer()
|
(server, port) = self._getNextServer()
|
||||||
|
@ -182,21 +182,6 @@ def newDriver(irc, moduleName=None):
|
|||||||
if moduleName is None:
|
if moduleName is None:
|
||||||
moduleName = conf.supybot.drivers.module()
|
moduleName = conf.supybot.drivers.module()
|
||||||
if moduleName == 'default':
|
if moduleName == 'default':
|
||||||
# XXX Twisted has been causing problems lately, so we're going to use
|
|
||||||
# the Socket driver by default, now. Leaving behind the code for using
|
|
||||||
# Twisted by default in case someone steps up and fixes the Twisted
|
|
||||||
# driver.
|
|
||||||
'''
|
|
||||||
try:
|
|
||||||
import supybot.drivers.Twisted
|
|
||||||
moduleName = 'supybot.drivers.Twisted'
|
|
||||||
except ImportError:
|
|
||||||
# We formerly used 'del' here, but 2.4 fixes the bug that we added
|
|
||||||
# the 'del' for, so we need to make sure we don't complain if the
|
|
||||||
# module is cleaned up already.
|
|
||||||
sys.modules.pop('supybot.drivers.Twisted', None)
|
|
||||||
moduleName = 'supybot.drivers.Socket'
|
|
||||||
'''
|
|
||||||
moduleName = 'supybot.drivers.Socket'
|
moduleName = 'supybot.drivers.Socket'
|
||||||
elif not moduleName.startswith('supybot.drivers.'):
|
elif not moduleName.startswith('supybot.drivers.'):
|
||||||
moduleName = 'supybot.drivers.' + moduleName
|
moduleName = 'supybot.drivers.' + moduleName
|
||||||
|
Loading…
x
Reference in New Issue
Block a user