From f4175ba40c660aee389b79f30617290ec58749dc Mon Sep 17 00:00:00 2001 From: "Christian T. Jacobs" Date: Thu, 6 Jul 2017 23:14:28 +0100 Subject: [PATCH] Moar comments. --- pyqso/callsign_lookup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyqso/callsign_lookup.py b/pyqso/callsign_lookup.py index 7dbdbe7..c790dc0 100644 --- a/pyqso/callsign_lookup.py +++ b/pyqso/callsign_lookup.py @@ -63,6 +63,7 @@ class CallsignLookupQRZ: logging.error("Could not percent-escape the password. Falling back to non-percent-escaped password.") pass + # Connect to the server. try: self.connection = http_client.HTTPConnection("xmldata.qrz.com") request = "/xml/current/?username=%s;password=%s;agent=pyqso" % (username, password) @@ -72,6 +73,7 @@ class CallsignLookupQRZ: error(parent=self.parent, message="Could not connect to the qrz.com server. Check connection to the internets?") return False + # Get the session key. xml_data = minidom.parseString(response.read()) session_node = xml_data.getElementsByTagName("Session")[0] # There should only be one Session element. session_key_node = session_node.getElementsByTagName("Key") @@ -198,6 +200,7 @@ class CallsignLookupHamQTH: logging.error("Could not percent-escape the password. Falling back to non-percent-escaped password.") pass + # Connect to the server. try: self.connection = http_client.HTTPSConnection("www.hamqth.com") request = "/xml.php?u=%s&p=%s" % (username, password) @@ -207,6 +210,7 @@ class CallsignLookupHamQTH: error(parent=self.parent, message="Could not connect to the hamqth.com server. Check connection to the internets?") return False + # Get the session ID. xml_data = minidom.parseString(response.read()) session_node = xml_data.getElementsByTagName("session")[0] # There should only be one Session element. session_id_node = session_node.getElementsByTagName("session_id")