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()
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:
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:
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():
"""
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
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))
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):
# Copyright 2008 Develer S.r.l. (http://www.develer.com/)
# All rights reserved.
#
-# $Id:$
+# $Id$
#
# Author: Lorenzo Berni <duplo@develer.com>
#
method of the next page.
"""
page = self.page(pageId)
- if page is not None:
+ if page:
page.reloadData()
def project(self):
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]