mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
Cosmetic PEP8 fixes.
This commit is contained in:
parent
93a4a3f8a0
commit
47bc50d9fb
6 changed files with 17 additions and 13 deletions
|
@ -185,11 +185,13 @@ class BaseXMPP(XMLStream):
|
||||||
if not module:
|
if not module:
|
||||||
try:
|
try:
|
||||||
module = sleekxmpp.plugins
|
module = sleekxmpp.plugins
|
||||||
module = __import__(str("%s.%s" % (module.__name__, plugin)),
|
module = __import__(
|
||||||
|
str("%s.%s" % (module.__name__, plugin)),
|
||||||
globals(), locals(), [str(plugin)])
|
globals(), locals(), [str(plugin)])
|
||||||
except ImportError:
|
except ImportError:
|
||||||
module = sleekxmpp.features
|
module = sleekxmpp.features
|
||||||
module = __import__(str("%s.%s" % (module.__name__, plugin)),
|
module = __import__(
|
||||||
|
str("%s.%s" % (module.__name__, plugin)),
|
||||||
globals(), locals(), [str(plugin)])
|
globals(), locals(), [str(plugin)])
|
||||||
if isinstance(module, str):
|
if isinstance(module, str):
|
||||||
# We probably want to load a module from outside
|
# We probably want to load a module from outside
|
||||||
|
|
|
@ -29,7 +29,6 @@ class feature_mechanisms(base_plugin):
|
||||||
self.description = "SASL Stream Feature"
|
self.description = "SASL Stream Feature"
|
||||||
self.stanza = stanza
|
self.stanza = stanza
|
||||||
|
|
||||||
|
|
||||||
def tls_active():
|
def tls_active():
|
||||||
return 'starttls' in self.xmpp.features
|
return 'starttls' in self.xmpp.features
|
||||||
|
|
||||||
|
|
|
@ -318,9 +318,11 @@ class SleekTest(unittest.TestCase):
|
||||||
self.xmpp.socket.recv_data(header)
|
self.xmpp.socket.recv_data(header)
|
||||||
elif socket == 'live':
|
elif socket == 'live':
|
||||||
self.xmpp.socket_class = TestLiveSocket
|
self.xmpp.socket_class = TestLiveSocket
|
||||||
|
|
||||||
def wait_for_session(x):
|
def wait_for_session(x):
|
||||||
self.xmpp.socket.clear()
|
self.xmpp.socket.clear()
|
||||||
skip_queue.put('started')
|
skip_queue.put('started')
|
||||||
|
|
||||||
self.xmpp.add_event_handler('session_start', wait_for_session)
|
self.xmpp.add_event_handler('session_start', wait_for_session)
|
||||||
self.xmpp.connect()
|
self.xmpp.connect()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -482,7 +482,8 @@ class ElementBase(object):
|
||||||
if plugin:
|
if plugin:
|
||||||
if plugin not in self.plugins:
|
if plugin not in self.plugins:
|
||||||
self.init_plugin(plugin)
|
self.init_plugin(plugin)
|
||||||
handler = getattr(self.plugins[plugin], set_method, None)
|
handler = getattr(self.plugins[plugin],
|
||||||
|
set_method, None)
|
||||||
if handler:
|
if handler:
|
||||||
return handler(value)
|
return handler(value)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue