X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBModulePage.py;h=00d9d4bdcb2d46a3f9d0785b1dec2b39409c266a;hb=1e2f7f270e346f7929aae85355aefc4f0a47139c;hp=0cb35a96d01e7529abc027b09ceb5038aea27680;hpb=75a8b43ba6532bb86533acd204fffdbe18dd5a03;p=bertos.git diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 0cb35a96..00d9d4bd 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -77,7 +77,7 @@ class BModulePage(BWizardPage): the source tree. """ module = self.currentModule() - if module is not None: + if module: try: supported = bertos_utils.isSupported(self.project(), module=module) except SupportedException, e: @@ -108,7 +108,7 @@ class BModulePage(BWizardPage): try: param_supported = bertos_utils.isSupported(self.project(), property_id=(configuration, property)) except SupportedException, e: - self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule)) + self.exceptionOccurred(self.tr("Error evaluating \"%1\" for parameter %2").arg(e.support_string).arg(property)) param_supported = True if not param_supported: # Doesn't show the unsupported parameters @@ -182,9 +182,9 @@ class BModulePage(BWizardPage): Loads the module data. """ # 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: + if not self.projectInfo("MODULES") \ + and not self.projectInfo("LISTS") \ + and not self.projectInfo("CONFIGURATIONS"): try: bertos_utils.loadModuleData(self.project()) except ModuleDefineException, e: @@ -199,7 +199,7 @@ class BModulePage(BWizardPage): Fills the module tree with the module entries separated in categories. """ modules = self.projectInfo("MODULES") - if modules is None: + if not modules: return categories = {} for module, information in modules.items(): @@ -214,7 +214,7 @@ class BModulePage(BWizardPage): try: supported = bertos_utils.isSupported(self.project(), module=module) except SupportedException, e: - self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(selectedModule)) + self.exceptionOccurred(self.tr("Error evaluating \"%1\" for module %2").arg(e.support_string).arg(module)) supported = True if not supported: module_item.setForeground(0, QBrush(QColor(Qt.red))) @@ -300,7 +300,7 @@ class BModulePage(BWizardPage): """ current_module = self.pageContent.moduleTree.currentItem() # return only the child items - if current_module is not None and current_module.parent() is not None: + if current_module and current_module.parent(): return unicode(current_module.text(0)) else: return None