Fix instances of using undefined variables.

This commit is contained in:
Lance Stout 2012-02-18 11:56:10 -08:00
parent 94b57d232d
commit 977fcc0632
6 changed files with 10 additions and 5 deletions

View file

@ -754,7 +754,7 @@ class xep_0030(base_plugin):
""" """
result = info result = info
if isinstance(info, Iq): if isinstance(info, Iq):
info = iq['disco_info'] info = info['disco_info']
if not info['node']: if not info['node']:
if not info['identities']: if not info['identities']:
if self.xmpp.is_component: if self.xmpp.is_component:

View file

@ -11,7 +11,7 @@ import threading
import sleekxmpp import sleekxmpp
from sleekxmpp import Iq from sleekxmpp import Iq
from sleekxmpp.exceptions import XMPPError from sleekxmpp.exceptions import XMPPError, IqError, IqTimeout
from sleekxmpp.plugins.base import base_plugin from sleekxmpp.plugins.base import base_plugin
from sleekxmpp.xmlstream.handler import Callback from sleekxmpp.xmlstream.handler import Callback
from sleekxmpp.xmlstream.matcher import StanzaPath from sleekxmpp.xmlstream.matcher import StanzaPath

View file

@ -121,7 +121,7 @@ class xep_0066(base_plugin):
iq -- The Iq stanza containing the OOB transfer request. iq -- The Iq stanza containing the OOB transfer request.
""" """
if iq['to'] in self.url_handlers['jid']: if iq['to'] in self.url_handlers['jid']:
return self.url_handlers['jid'][jid](iq) return self.url_handlers['jid'][iq['to']](iq)
else: else:
if self.url_handlers['global']: if self.url_handlers['global']:
self.url_handlers['global'](iq) self.url_handlers['global'](iq)

View file

@ -9,7 +9,9 @@
import logging import logging
import hashlib import hashlib
import random import random
import sys
from sleekxmpp.exceptions import IqError, IqTimeout
from sleekxmpp.stanza import Iq, StreamFeatures from sleekxmpp.stanza import Iq, StreamFeatures
from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin from sleekxmpp.xmlstream import ElementBase, ET, register_stanza_plugin
from sleekxmpp.plugins.base import base_plugin from sleekxmpp.plugins.base import base_plugin

View file

@ -67,6 +67,7 @@
import re import re
import math
import datetime import datetime
@ -240,12 +241,12 @@ except:
if frac != None: if frac != None:
# ok, fractions of hour? # ok, fractions of hour?
if min == None: if min == None:
frac, min = _math.modf(frac * 60.0) frac, min = math.modf(frac * 60.0)
min = int(min) min = int(min)
# fractions of second? # fractions of second?
if s == None: if s == None:
frac, s = _math.modf(frac * 60.0) frac, s = math.modf(frac * 60.0)
s = int(s) s = int(s)
# and extract microseconds... # and extract microseconds...

View file

@ -1,8 +1,10 @@
import sys import sys
import random import random
import hmac
from sleekxmpp.thirdparty.suelta.util import hash, bytes, quote from sleekxmpp.thirdparty.suelta.util import hash, bytes, quote
from sleekxmpp.thirdparty.suelta.util import num_to_bytes, bytes_to_num
from sleekxmpp.thirdparty.suelta.sasl import Mechanism, register_mechanism from sleekxmpp.thirdparty.suelta.sasl import Mechanism, register_mechanism
from sleekxmpp.thirdparty.suelta.exceptions import SASLError, SASLCancelled from sleekxmpp.thirdparty.suelta.exceptions import SASLError, SASLCancelled