use existing private keys when creating authorities if they are present
[sfa.git] / geni / util / rspec.py
index aff3200..6c44074 100644 (file)
@@ -176,7 +176,7 @@ class Rspec():
         """
      
         def elementNode(tagname, rd):
-            element = minidom.Element(tagname)   
+            element = minidom.Element(tagname)
             for key in rd.keys():
                 if isinstance(rd[key], StringTypes):
                     element.setAttribute(key, rd[key])
@@ -188,7 +188,11 @@ class Rspec():
                         child = elementNode(key, item)
                         element.appendChild(child)
             return element
-                     
+        
+        # Minidom does not allow documents to have more then one
+        # child, but elements may have many children. Because of
+        # this, the document's root node will be the first key/value
+        # pair in the dictionary.  
         node = elementNode(rdict.keys()[0], rdict.values()[0])
         if include_doc:
             rootNode = minidom.Document()
@@ -262,10 +266,10 @@ class Rspec():
 
        def validateDicts(self):
                types = {
-                       'EInt' = int,
-                       'EString' = str,
-                       'EByteArray' = list,
-                       'EBoolean' = bool,
-                       'EFloat' = float,
-                       'EDate' = date}
+                       'EInt' : int,
+                       'EString' : str,
+                       'EByteArray' : list,
+                       'EBoolean' : bool,
+                       'EFloat' : float,
+                       'EDate' : date}
 # vim:ts=4:expandtab