ProjectController.py
changeset 2244 42566291b9bc
parent 2230 295f966e8083
child 2245 fe3394697b02
--- a/ProjectController.py	Wed Jul 04 17:47:38 2018 +0300
+++ b/ProjectController.py	Mon Aug 06 13:14:50 2018 +0200
@@ -194,8 +194,9 @@
               <xsd:complexType>
               """+"\n".join(['<xsd:attribute name=' +
                              '"Enable_' + libname + '_Library" ' +
-                             'type="xsd:boolean" use="optional" default="false"/>'
-                             for libname, _lib in features.libraries])+"""
+                             'type="xsd:boolean" use="optional" default="' + 
+                                ('true' if default else 'false') + '"/>'
+                             for libname, _lib, default in features.libraries])+"""
               </xsd:complexType>
             </xsd:element>""") if len(features.libraries) > 0 else '') + """
           </xsd:sequence>
@@ -205,6 +206,7 @@
       </xsd:element>
     </xsd:schema>
     """
+    print XSD
     return XSD
 
 
@@ -270,7 +272,7 @@
     def LoadLibraries(self):
         self.Libraries = []
         TypeStack = []
-        for libname, clsname in features.libraries:
+        for libname, clsname, default in features.libraries:
             if self.BeremizRoot.Libraries is not None and getattr(self.BeremizRoot.Libraries, "Enable_"+libname+"_Library"):
                 Lib = GetClassImporter(clsname)()(self, libname, TypeStack)
                 TypeStack.append(Lib.GetTypes())