Fixed bug when connecting and URI_location is empty
authorLaurent Bessard
Tue, 09 Apr 2013 18:16:04 +0200
changeset 1022 ec30c12b1d67
parent 1021 939b1a1c7aa5
child 1023 93022adef055
Fixed bug when connecting and URI_location is empty
xmlclass/xmlclass.py
--- a/xmlclass/xmlclass.py	Sat Apr 06 11:57:03 2013 +0200
+++ b/xmlclass/xmlclass.py	Tue Apr 09 18:16:04 2013 +0200
@@ -1670,7 +1670,12 @@
                 if attributes[parts[0]]["attr_type"]["basename"] == "boolean":
                     setattr(self, parts[0], value)
                 elif attributes[parts[0]]["use"] == "optional" and value == "":
-                    setattr(self, parts[0], None)
+                    if attributes[parts[0]].has_key("default"):
+                        setattr(self, parts[0], 
+                            attributes[parts[0]]["attr_type"]["extract"](
+                                attributes[parts[0]]["default"], False))
+                    else:
+                        setattr(self, parts[0], None)
                 else:
                     setattr(self, parts[0], attributes[parts[0]]["attr_type"]["extract"](value, False))
             elif elements.has_key(parts[0]):