Correct if caluses
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 20 Apr 2009 11:07:08 +0000 (11:07 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 20 Apr 2009 11:07:08 +0000 (11:07 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2577 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BCpuPage.py
wizard/BModulePage.py
wizard/BToolchainPage.py
wizard/BVersionPage.py
wizard/BWizard.py
wizard/bertos_utils.py

index c105543c2680f3e304292f8fd819b2b3b1d3921d..f38ab35c5069b5ec5b037d219cb991850f6683d6 100644 (file)
@@ -86,9 +86,9 @@ class BCpuPage(BWizardPage):
         cpu_name = self.projectInfo("CPU_NAME")
         selected_freq = self.projectInfo("SELECTED_FREQ")
         self.setupUi()
-        if not cpu_name is None:
+        if cpu_name:
             self.selectItem(cpu_name)
-            if not selected_freq is None:
+            if selected_freq:
                 self.setFrequency(selected_freq)
                 self.freq_modified = True
         QApplication.instance().restoreOverrideCursor()
index afbe9891cbb1deb91c975dfb87d3a4726d61cb3e..00d9d4bdcb2d46a3f9d0785b1dec2b39409c266a 100644 (file)
@@ -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:
@@ -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():
@@ -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
index be7fc6f12da215120fc094cfab13585710850be1..2587cf2019bc9fd768baf199c7b4aa870db12f90 100644 (file)
@@ -141,7 +141,7 @@ class BToolchainPage(BWizardPage):
             item = QListWidgetItem(key)
             item.setData(Qt.UserRole, qvariant_converter.convertStringDict({"path": key}))
             self.pageContent.toolchainList.addItem(item)
-            if sel_toolchain is not None and sel_toolchain["path"] == key:
+            if sel_toolchain and sel_toolchain["path"] == key:
                 self.pageContent.toolchainList.setCurrentItem(item)
             if value:
                 self.validateToolchain(self.pageContent.toolchainList.row(item))
index 0db1bd6217662a475cb3a5ea3c1df1e1f58b5d91..5d891b2192e334b4c68f0f8c708ab48d87c38309 100644 (file)
@@ -157,7 +157,7 @@ class BVersionPage(BWizardPage):
         selected = self.projectInfo("SOURCES_PATH")
         for directory in versions:
             item = self.insertListElement(directory)
-            if not selected is None and selected == directory:
+            if selected and selected == directory:
                 self.setCurrentItem(item)
     
     def setCurrentItem(self, item):
index 1966d932e10d908ac74f5bbd2ec0329ff9209c87..a4436623bc965e803c431c31ee8aebf133afec59 100644 (file)
@@ -4,7 +4,7 @@
 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
 # All rights reserved.
 #
-# $Id:$
+# $Id$
 #
 # Author: Lorenzo Berni <duplo@develer.com>
 #
@@ -55,7 +55,7 @@ class BWizard(QWizard):
         method of the next page.
         """
         page = self.page(pageId)
-        if page is not None:
+        if page:
             page.reloadData()
     
     def project(self):
index 17794579e0ca8ab6e950c4d03ba4cf8bd6aa742f..bfdcc0eefd32130df5e4b565bc752e636d31ad4f 100644 (file)
@@ -384,7 +384,7 @@ def loadModuleDefinition(first_comment):
     return to_be_parsed, module_dict
 
 def isSupported(project, module=None, property_id=None):
-    if module is None and property_id is not None:
+    if not module and property_id:
         item = project.info("CONFIGURATIONS")[property_id[0]][property_id[1]]["informations"]
     else:
         item = project.info("MODULES")[module]