From ecf902bf16abbcfab0243d4ecd6e7d41967b121a Mon Sep 17 00:00:00 2001 From: Nathan Fritz Date: Mon, 31 May 2010 18:36:25 +0800 Subject: Scheduler waits too longer, and pubsubstate registration was backwards --- sleekxmpp/plugins/stanza_pubsub.py | 4 ++-- sleekxmpp/xmlstream/scheduler.py | 2 +- sleekxmpp/xmlstream/stanzabase.py | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'sleekxmpp') diff --git a/sleekxmpp/plugins/stanza_pubsub.py b/sleekxmpp/plugins/stanza_pubsub.py index 0a75e1e7..1a1526f0 100644 --- a/sleekxmpp/plugins/stanza_pubsub.py +++ b/sleekxmpp/plugins/stanza_pubsub.py @@ -40,8 +40,8 @@ class PubsubStateEvent(ElementBase): plugin_attrib_map = {} plugin_tag_map = {} -stanzaPlugin(Message, PubsubState) -stanzaPlugin(PubsubState, PubsubStateEvent) +stanzaPlugin(Message, PubsubStateEvent) +stanzaPlugin(PubsubStateEvent, PubsubState) class Pubsub(ElementBase): namespace = 'http://jabber.org/protocol/pubsub' diff --git a/sleekxmpp/xmlstream/scheduler.py b/sleekxmpp/xmlstream/scheduler.py index 18d9229e..945d9fad 100644 --- a/sleekxmpp/xmlstream/scheduler.py +++ b/sleekxmpp/xmlstream/scheduler.py @@ -49,7 +49,7 @@ class Scheduler(object): self.run = True while self.run: try: - wait = 5 + wait = 1 updated = False if self.schedule: wait = self.schedule[0].next - time.time() diff --git a/sleekxmpp/xmlstream/stanzabase.py b/sleekxmpp/xmlstream/stanzabase.py index c40922be..64020c8f 100644 --- a/sleekxmpp/xmlstream/stanzabase.py +++ b/sleekxmpp/xmlstream/stanzabase.py @@ -78,6 +78,9 @@ class ElementBase(tostring.ToString): def __iter__(self): self.idx = 0 return self + + def __bool__(self): + return True def __next__(self): self.idx += 1 -- cgit v1.2.3