Add a stub for supported modules check
[bertos.git] / wizard / BModulePage.py
index 4c681f8549854d8691028e080dcfa128a8650e96..f95b8e7a3067e075864e081feaa4d30c13ebba16 100644 (file)
@@ -4,7 +4,7 @@
 # Copyright 2009 Develer S.r.l. (http://www.develer.com/)
 # All rights reserved.
 #
-# $Id:$
+# $Id$
 #
 # Author: Lorenzo Berni <duplo@develer.com>
 #
@@ -15,6 +15,7 @@ from PyQt4.QtGui import *
 from BWizardPage import *
 import bertos_utils
 
+from bertos_utils import SupportedException
 from DefineException import *
 from const import *
 
@@ -89,10 +90,10 @@ class BModulePage(BWizardPage):
                 index = 0
                 for i, property in param_list:
                     if "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "autoenabled":
-                        ## Doesn't show the hidden fields
+                        # Doesn't show the hidden fields
                         pass
                     else:
-                        ## Set the row count to the current index + 1
+                        # Set the row count to the current index + 1
                         self.pageContent.propertyTable.setRowCount(index + 1)
                         item = QTableWidgetItem(configurations[property]["brief"])
                         item.setData(Qt.UserRole, qvariant_converter.convertString(property))
@@ -160,7 +161,7 @@ class BModulePage(BWizardPage):
         """
         Loads the module data.
         """
-        ## Load the module data only if it isn't already loaded
+        # Load the module data only if it isn't already loaded
         if self.projectInfo("MODULES") == None \
                 and self.projectInfo("LISTS") == None \
                 and self.projectInfo("CONFIGURATIONS") == None:
@@ -233,7 +234,7 @@ class BModulePage(BWizardPage):
         Inserts in the table at index a spinbox for an int, a long or an unsigned
         long property setted to value.
         """
-        ## int, long or undefined type property
+        # int, long or undefined type property
         spin_box = None
         if bertos_utils.isLong(informations) or bertos_utils.isUnsignedLong(informations):
             spin_box = QDoubleSpinBox()
@@ -321,6 +322,16 @@ class BModulePage(BWizardPage):
         Resolves the selection dependencies.
         """
         modules = self.projectInfo("MODULES")
+        try:
+            supported = bertos_utils.isSupported(selectedModule, self.project())
+        except SupportedException, e:
+            self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule))
+            supported = True
+        # Temporary feedback
+        if supported:
+            print "%s is supported" %selectedModule
+        else:
+            print "%s is not supported" %selectedModule
         modules[selectedModule]["enabled"] = True
         self.setProjectInfo("MODULES", modules)
         depends = self.projectInfo("MODULES")[selectedModule]["depends"]