diff options
author | Lance Stout <lancestout@gmail.com> | 2010-10-01 10:46:37 -0400 |
---|---|---|
committer | Lance Stout <lancestout@gmail.com> | 2010-10-01 10:46:37 -0400 |
commit | 5522443e0e122093080032037a783ab3d2718d3f (patch) | |
tree | 42ef29b752991f6e05170a83bfccbdae5badf540 /sleekxmpp/basexmpp.py | |
parent | 55cfe69fefde4cbb1b10f2518f94f652db819d38 (diff) | |
download | slixmpp-5522443e0e122093080032037a783ab3d2718d3f.tar.gz slixmpp-5522443e0e122093080032037a783ab3d2718d3f.tar.bz2 slixmpp-5522443e0e122093080032037a783ab3d2718d3f.tar.xz slixmpp-5522443e0e122093080032037a783ab3d2718d3f.zip |
Moved getNewId and getId to XMLStream.
This prepares the way for moving add_handler to XMLStream.
Since stanzas, matchers, and handlers in any XML stream will typically
use unique IDs, XMLStream is a good place for these methods.
Diffstat (limited to 'sleekxmpp/basexmpp.py')
-rw-r--r-- | sleekxmpp/basexmpp.py | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/sleekxmpp/basexmpp.py b/sleekxmpp/basexmpp.py index f83fc062..a522f822 100644 --- a/sleekxmpp/basexmpp.py +++ b/sleekxmpp/basexmpp.py @@ -114,20 +114,12 @@ class basexmpp(object): for plugin in self.plugin: self.plugin[plugin].post_init() - def getNewId(self): - with self.id_lock: - self.id += 1 - return self.getId() - def add_handler(self, mask, pointer, name=None, disposable=False, threaded=False, filter=False, instream=False): # threaded is no longer needed, but leaving it for backwards compatibility for now if name is None: name = 'add_handler_%s' % self.getNewId() self.registerHandler(XMLCallback(name, MatchXMLMask(mask), pointer, once=disposable, instream=instream)) - def getId(self): - return "%x".upper() % self.id - def sendXML(self, data, mask=None, timeout=10): return self.send(tostring(data), mask, timeout) |