summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2010-10-18 09:06:54 -0400
committerLance Stout <lancestout@gmail.com>2010-10-18 09:06:54 -0400
commite18354ae0e068d6e95ea13567e75da4f0c6c03eb (patch)
treecb33713dbfec266c39118b25df7627102e09d311 /sleekxmpp/xmlstream
parent4375ac7d8b9e62f34a4d3754a90b3538d5e978a3 (diff)
downloadslixmpp-e18354ae0e068d6e95ea13567e75da4f0c6c03eb.tar.gz
slixmpp-e18354ae0e068d6e95ea13567e75da4f0c6c03eb.tar.bz2
slixmpp-e18354ae0e068d6e95ea13567e75da4f0c6c03eb.tar.xz
slixmpp-e18354ae0e068d6e95ea13567e75da4f0c6c03eb.zip
Continue converting to underscored names.
Diffstat (limited to 'sleekxmpp/xmlstream')
-rw-r--r--sleekxmpp/xmlstream/handler/base.py12
-rw-r--r--sleekxmpp/xmlstream/handler/waiter.py14
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py2
3 files changed, 15 insertions, 13 deletions
diff --git a/sleekxmpp/xmlstream/handler/base.py b/sleekxmpp/xmlstream/handler/base.py
index 3ae82a89..9c704ec6 100644
--- a/sleekxmpp/xmlstream/handler/base.py
+++ b/sleekxmpp/xmlstream/handler/base.py
@@ -25,10 +25,10 @@ class BaseHandler(object):
stream -- The stream this handler is assigned to.
Methods:
- match -- Compare a stanza with the handler's matcher.
- prerun -- Handler execution during stream processing.
- run -- Handler execution during the main event loop.
- checkDelete -- Indicate if the handler may be removed from use.
+ match -- Compare a stanza with the handler's matcher.
+ prerun -- Handler execution during stream processing.
+ run -- Handler execution during the main event loop.
+ check_delete -- Indicate if the handler may be removed from use.
"""
def __init__(self, name, matcher, stream=None):
@@ -42,6 +42,8 @@ class BaseHandler(object):
this handler.
stream -- The XMLStream instance the handler should monitor.
"""
+ self.checkDelete = self.check_delete
+
self.name = name
self.stream = stream
self._destroy = False
@@ -79,7 +81,7 @@ class BaseHandler(object):
"""
self._payload = payload
- def checkDelete(self):
+ def check_delete(self):
"""
Check if the handler should be removed from the list of stream
handlers.
diff --git a/sleekxmpp/xmlstream/handler/waiter.py b/sleekxmpp/xmlstream/handler/waiter.py
index 1e101ed3..80720226 100644
--- a/sleekxmpp/xmlstream/handler/waiter.py
+++ b/sleekxmpp/xmlstream/handler/waiter.py
@@ -25,11 +25,11 @@ class Waiter(BaseHandler):
waiter has timed out.
Methods:
- checkDelete -- Overrides BaseHandler.checkDelete
- prerun -- Overrides BaseHandler.prerun
- run -- Overrides BaseHandler.run
- wait -- Wait for a stanza to arrive and return it to
- an event handler.
+ check_delete -- Overrides BaseHandler.check_delete
+ prerun -- Overrides BaseHandler.prerun
+ run -- Overrides BaseHandler.run
+ wait -- Wait for a stanza to arrive and return it to
+ an event handler.
"""
def __init__(self, name, matcher, stream=None):
@@ -89,10 +89,10 @@ class Waiter(BaseHandler):
self.stream.removeHandler(self.name)
return stanza
- def checkDelete(self):
+ def check_delete(self):
"""
Always remove waiters after use.
- Overrides BaseHandler.checkDelete
+ Overrides BaseHandler.check_delete
"""
return True
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 4c3dd9fe..5fd7be9d 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -755,7 +755,7 @@ class XMLStream(object):
handler.prerun(stanza_copy)
self.event_queue.put(('stanza', handler, stanza_copy))
try:
- if handler.checkDelete():
+ if handler.check_delete():
self.__handlers.pop(self.__handlers.index(handler))
except:
pass # not thread safe