Commits

Cédric Bonhomme committed 1409d65

Bug fix : UnboundLocalError in xmlParser.getPassword(). Hide the password in the password entry.

Comments (0)

Files changed (3)

source/simpleGui.py

 
 
         if self.client_agent == None:
-            self.show_info('Not connected to the SPADE platform.')
+            self.show_info('You are not connected to the SPADE platform.')
             return
 
         msg = Toplevel(self.master)
 
         Label(msg, text='Password : ').grid(row = 1, column = 0, sticky = W)
         password1_entry = Entry(msg)
+        password1_entry.configure(show='*')
         password1_entry.grid(row = 1, column = 1, pady = 2, sticky = W)
 
         Label(msg, text='Password : ').grid(row = 2, column = 0, sticky = W)
         password2_entry = Entry(msg)
+        password2_entry.configure(show='*')
         password2_entry.grid(row = 2, column = 1, pady = 2, sticky = W)
 
         Label(msg, text='Ontology : ').grid(row = 3, column = 0, sticky = W)
             self.load_rsa_keys()
 
         if self.client_agent == None:
-            self.show_info('Not connected to the SPADE platform.')
+            self.show_info('You are not connected to the SPADE platform.')
             return
 
         msg = Toplevel(self.master)
 
         Label(msg, text='Enter your password : ').grid(row = 0, column = 0)
         password_entry = Entry(msg)
+        password_entry.configure(show='*')
         password_entry.grid(row = 1, column = 0, pady = 2)
         password_entry.focus_set()
 
 
         self.set_top_level_window(msg)
 
-
     def block_sender(self, event = None):
         """
         Block the selected client.
+        Message from this client will be
         """
         client = None
         try:

source/spade/user_db.xml

Binary file modified.

source/xmlParser.py

     """
     try:
         xml = parse(XML_FILE)
-    except Exception, e:
+    except Exception:
         xml = Document()
         root = xml.createElement("clients")
         xml.appendChild(root)
     """
     pass
 
-
 def get_ontology(client_name):
     """
     """
     try:
         xml = parse(XML_FILE)
-    except Exception, e:
-        print e
+    except Exception:
+        return None
 
     for client in xml.getElementsByTagName("client"):
         if client_name == client.getElementsByTagName("name")[0].childNodes[0].nodeValue:
     """
     try:
         xml = parse(XML_FILE)
-    except Exception, e:
-        print e
+    except Exception:
+        return None
 
     for client in xml.getElementsByTagName("client"):
         if client_name == client.getElementsByTagName("name")[0].childNodes[0].nodeValue:
     """
     try:
         xml = parse(XML_FILE)
-    except Exception, e:
-        print e
+    except Exception:
+        return None
 
     for client in xml.getElementsByTagName("client"):
         if client_name == client.getElementsByTagName("name")[0].childNodes[0].nodeValue:
                 pass
     return None
 
-
-
-
-
 def set_ontology():
     """
     """
     """
     pass
 
-
-
 def write(xml):
-    """Save XML file.
+    """Save the XML file.
     """
     try:
         file = open(XML_FILE, 'w')