summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2011-08-04 22:37:22 -0700
committerLance Stout <lancestout@gmail.com>2011-08-04 22:37:22 -0700
commit47bc50d9fbbe8d72b589a6360aa8b5f32d6ba74b (patch)
treebea40ff79dc92dd38c1152905658dde1e84df96b /sleekxmpp
parent93a4a3f8a0f64eed846895365fa3da059bbf5ea1 (diff)
downloadslixmpp-47bc50d9fbbe8d72b589a6360aa8b5f32d6ba74b.tar.gz
slixmpp-47bc50d9fbbe8d72b589a6360aa8b5f32d6ba74b.tar.bz2
slixmpp-47bc50d9fbbe8d72b589a6360aa8b5f32d6ba74b.tar.xz
slixmpp-47bc50d9fbbe8d72b589a6360aa8b5f32d6ba74b.zip
Cosmetic PEP8 fixes.
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/basexmpp.py12
-rw-r--r--sleekxmpp/features/feature_mechanisms/mechanisms.py1
-rw-r--r--sleekxmpp/features/feature_mechanisms/stanza/mechanisms.py6
-rw-r--r--sleekxmpp/plugins/xep_0050/adhoc.py2
-rw-r--r--sleekxmpp/test/sleektest.py2
-rw-r--r--sleekxmpp/xmlstream/stanzabase.py7
6 files changed, 17 insertions, 13 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py
index 07726a41..4d9a8964 100644
--- a/sleekxmpp/basexmpp.py
+++ b/sleekxmpp/basexmpp.py
@@ -141,7 +141,7 @@ class BaseXMPP(XMLStream):
def process(self, *args, **kwargs):
"""
Overrides XMLStream.process.
-
+
Initialize the XML streams and begin processing events.
The number of threads used for processing stream events is determined
@@ -185,12 +185,14 @@ class BaseXMPP(XMLStream):
if not module:
try:
module = sleekxmpp.plugins
- module = __import__(str("%s.%s" % (module.__name__, plugin)),
- globals(), locals(), [str(plugin)])
+ module = __import__(
+ str("%s.%s" % (module.__name__, plugin)),
+ globals(), locals(), [str(plugin)])
except ImportError:
module = sleekxmpp.features
- module = __import__(str("%s.%s" % (module.__name__, plugin)),
- globals(), locals(), [str(plugin)])
+ module = __import__(
+ str("%s.%s" % (module.__name__, plugin)),
+ globals(), locals(), [str(plugin)])
if isinstance(module, str):
# We probably want to load a module from outside
# the sleekxmpp package, so leave out the globals().
diff --git a/sleekxmpp/features/feature_mechanisms/mechanisms.py b/sleekxmpp/features/feature_mechanisms/mechanisms.py
index d60818bb..2debf3be 100644
--- a/sleekxmpp/features/feature_mechanisms/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/mechanisms.py
@@ -29,7 +29,6 @@ class feature_mechanisms(base_plugin):
self.description = "SASL Stream Feature"
self.stanza = stanza
-
def tls_active():
return 'starttls' in self.xmpp.features
diff --git a/sleekxmpp/features/feature_mechanisms/stanza/mechanisms.py b/sleekxmpp/features/feature_mechanisms/stanza/mechanisms.py
index 1189cd80..c09cafbd 100644
--- a/sleekxmpp/features/feature_mechanisms/stanza/mechanisms.py
+++ b/sleekxmpp/features/feature_mechanisms/stanza/mechanisms.py
@@ -42,9 +42,9 @@ class Mechanisms(ElementBase):
"""
self.del_mechanisms()
for val in values:
- mech = ET.Element('{%s}mechanism' % self.namespace)
- mech.text = val
- self.append(mech)
+ mech = ET.Element('{%s}mechanism' % self.namespace)
+ mech.text = val
+ self.append(mech)
def del_mechanisms(self):
"""
diff --git a/sleekxmpp/plugins/xep_0050/adhoc.py b/sleekxmpp/plugins/xep_0050/adhoc.py
index 72c6c513..dd1c88d6 100644
--- a/sleekxmpp/plugins/xep_0050/adhoc.py
+++ b/sleekxmpp/plugins/xep_0050/adhoc.py
@@ -589,5 +589,5 @@ class xep_0050(base_plugin):
elif iq['type'] == 'error':
self.terminate_command(session)
- if iq['command']['status'] == 'completed':
+ if iq['command']['status'] == 'completed':
self.terminate_command(session)
diff --git a/sleekxmpp/test/sleektest.py b/sleekxmpp/test/sleektest.py
index 7802a9bc..cb5031f7 100644
--- a/sleekxmpp/test/sleektest.py
+++ b/sleekxmpp/test/sleektest.py
@@ -318,9 +318,11 @@ class SleekTest(unittest.TestCase):
self.xmpp.socket.recv_data(header)
elif socket == 'live':
self.xmpp.socket_class = TestLiveSocket
+
def wait_for_session(x):
self.xmpp.socket.clear()
skip_queue.put('started')
+
self.xmpp.add_event_handler('session_start', wait_for_session)
self.xmpp.connect()
else:
diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py
index f1a9e1f5..a2826ead 100644
--- a/sleekxmpp/xmlstream/stanzabase.py
+++ b/sleekxmpp/xmlstream/stanzabase.py
@@ -482,7 +482,8 @@ class ElementBase(object):
if plugin:
if plugin not in self.plugins:
self.init_plugin(plugin)
- handler = getattr(self.plugins[plugin], set_method, None)
+ handler = getattr(self.plugins[plugin],
+ set_method, None)
if handler:
return handler(value)
@@ -1066,7 +1067,7 @@ class ElementBase(object):
stanza_ns = '' if top_level_ns else self.namespace
return tostring(self.xml, xmlns='',
stanza_ns=stanza_ns,
- top_level = not top_level_ns)
+ top_level=not top_level_ns)
def __repr__(self):
"""
@@ -1285,7 +1286,7 @@ class StanzaBase(ElementBase):
return tostring(self.xml, xmlns='',
stanza_ns=stanza_ns,
stream=self.stream,
- top_level = not top_level_ns)
+ top_level=not top_level_ns)
# To comply with PEP8, method names now use underscores.