Disable by default unlisted in project beremiz.xml libraries
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Tue, 26 Jun 2018 17:46:37 +0300
changeset 2230 295f966e8083
parent 2229 3c94bac4526e
child 2231 7d87a0f98345
Disable by default unlisted in project beremiz.xml libraries

Used libraries should be explicitly enabled.
ProjectController.py
--- a/ProjectController.py	Tue Jun 26 17:34:15 2018 +0300
+++ b/ProjectController.py	Tue Jun 26 17:46:37 2018 +0300
@@ -194,7 +194,7 @@
               <xsd:complexType>
               """+"\n".join(['<xsd:attribute name=' +
                              '"Enable_' + libname + '_Library" ' +
-                             'type="xsd:boolean" use="optional" default="true"/>'
+                             'type="xsd:boolean" use="optional" default="false"/>'
                              for libname, _lib in features.libraries])+"""
               </xsd:complexType>
             </xsd:element>""") if len(features.libraries) > 0 else '') + """
@@ -271,7 +271,7 @@
         self.Libraries = []
         TypeStack = []
         for libname, clsname in features.libraries:
-            if self.BeremizRoot.Libraries is None or getattr(self.BeremizRoot.Libraries, "Enable_"+libname+"_Library"):
+            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())
                 self.Libraries.append(Lib)