Merge remote branch 'fritzy/master'

Conflicts:
	sleekxmpp/__init__.py
	sleekxmpp/basexmpp.py
	sleekxmpp/stanza/error.py
This commit is contained in:
Brian Beggs 2010-07-01 09:17:45 -04:00
commit d763795b2c
3 changed files with 8 additions and 8 deletions

View File

@ -116,8 +116,7 @@ class ClientXMPP(basexmpp, XMLStream):
else: else:
logging.debug("Since no address is supplied, attempting SRV lookup.") logging.debug("Since no address is supplied, attempting SRV lookup.")
try: try:
answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.domain, answers = dns.resolver.query("_xmpp-client._tcp.%s" % self.server, dns.rdatatype.SRV)
dns.rdatatype.SRV )
except dns.resolver.NXDOMAIN: except dns.resolver.NXDOMAIN:
logging.debug("No appropriate SRV record found. Using JID server name.") logging.debug("No appropriate SRV record found. Using JID server name.")
else: else:
@ -335,4 +334,4 @@ def md5digest(data):
except ImportError: except ImportError:
import md5 import md5
md5 = md5.new(data) md5 = md5.new(data)
return md5.hexdigest() return md5.hexdigest()

View File

@ -1,9 +1,9 @@
""" """
SleekXMPP: The Sleek XMPP Library SleekXMPP: The Sleek XMPP Library
Copyright (C) 2010 Nathanael C. Fritz Copyright (C) 2010 Nathanael C. Fritz
This file is part of SleekXMPP. This file is part of SleekXMPP.
See the file license.txt for copying permission. See the file license.txt for copying permission.
""" """
from .. xmlstream.stanzabase import ElementBase, ET from .. xmlstream.stanzabase import ElementBase, ET

View File

@ -118,10 +118,11 @@ class testpubsubstanzas(unittest.TestCase):
iq = self.ps.Iq() iq = self.ps.Iq()
iq['pubsub_owner']['default'] iq['pubsub_owner']['default']
iq['pubsub_owner']['default']['node'] = 'mynode' iq['pubsub_owner']['default']['node'] = 'mynode'
iq['pubsub_owner']['default']['type'] = 'leaf'
form = xep_0004.Form() form = xep_0004.Form()
form.addField('pubsub#title', ftype='text-single', value='This thing is awesome') form.addField('pubsub#title', ftype='text-single', value='This thing is awesome')
iq['pubsub_owner']['default']['config'] = form iq['pubsub_owner']['default']['config'] = form
xmlstring = """<iq id="0"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><default node="mynode"><x xmlns="jabber:x:data" type="form"><field var="pubsub#title" type="text-single"><value>This thing is awesome</value></field></x></default></pubsub></iq>""" xmlstring = """<iq id="0"><pubsub xmlns="http://jabber.org/protocol/pubsub#owner"><default node="mynode" type="leaf"><x xmlns="jabber:x:data" type="form"><field var="pubsub#title" type="text-single"><value>This thing is awesome</value></field></x></default></pubsub></iq>"""
iq2 = self.ps.Iq(None, self.ps.ET.fromstring(xmlstring)) iq2 = self.ps.Iq(None, self.ps.ET.fromstring(xmlstring))
iq3 = self.ps.Iq() iq3 = self.ps.Iq()
values = iq2.getValues() values = iq2.getValues()