summaryrefslogtreecommitdiff
path: root/sleekxmpp/xmlstream/xmlstream.py
diff options
context:
space:
mode:
authorNathan Fritz <fritzy@netflint.net>2011-08-18 01:04:01 -0700
committerNathan Fritz <fritzy@netflint.net>2011-08-18 01:04:01 -0700
commitf75b6bf9557ffc9413a528649474478e9d98dfba (patch)
tree6de422af3eca714ff1a508a429bfdf36fb1b272c /sleekxmpp/xmlstream/xmlstream.py
parentfb78bf0996f8412a93cc53240fb55f16212105dc (diff)
downloadslixmpp-f75b6bf9557ffc9413a528649474478e9d98dfba.tar.gz
slixmpp-f75b6bf9557ffc9413a528649474478e9d98dfba.tar.bz2
slixmpp-f75b6bf9557ffc9413a528649474478e9d98dfba.tar.xz
slixmpp-f75b6bf9557ffc9413a528649474478e9d98dfba.zip
added inline documentation for new dns methods
Diffstat (limited to 'sleekxmpp/xmlstream/xmlstream.py')
-rw-r--r--sleekxmpp/xmlstream/xmlstream.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/sleekxmpp/xmlstream/xmlstream.py b/sleekxmpp/xmlstream/xmlstream.py
index 6c2c5aa5..ca8b5b6e 100644
--- a/sleekxmpp/xmlstream/xmlstream.py
+++ b/sleekxmpp/xmlstream/xmlstream.py
@@ -657,6 +657,13 @@ class XMLStream(object):
return False
def get_dns_records(self, domain, port=None):
+ """
+ Get the DNS records for a domain.
+
+ Arguments:
+ domain -- The domain in question.
+ port -- If the results don't include a port, use this one.
+ """
if port is None:
port = self.default_port
if DNSPYTHON:
@@ -673,6 +680,15 @@ class XMLStream(object):
return [((domain, port), 0, 0)]
def pick_dns_answer(self, domain, port=None):
+ """
+ Pick a server and port from DNS answers.
+ Gets DNS answers if none available.
+ Removes used answer from available answers.
+
+ Arguments:
+ domain -- The domain in question.
+ port -- If the results don't include a port, use this one.
+ """
if not self.dns_answers:
self.dns_answers = self.get_dns_records(domain, port)
addresses = {}