for key, value in moduleInfos.items():
self.pageContent.moduleList.addItem(QListWidgetItem(key))
- def _fillParameterTable(self, value):
+ def _fillParameterTable(self, parameters):
self.pageContent.propertyTable.clear()
- self.pageContent.propertyTable.setRowCount(len(value))
- for index, element in enumerate(value):
- self.pageContent.propertyTable.setItem(index, 0, QTableWidgetItem(element[0]))
- self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(element[1]))
+ self.pageContent.propertyTable.setRowCount(len(parameters))
+ for index, key in enumerate(parameters):
+ self.pageContent.propertyTable.setItem(index, 0, QTableWidgetItem(key))
+ self.pageContent.propertyTable.setItem(index, 1, QTableWidgetItem(parameters[key]["value"]))
def moduleItemClicked(self):
module = unicode(self.pageContent.moduleList.currentItem().text())
def loadModuleInfos(path):
"""
Return the module configurations found in the given path as a dict with the name as key
- and a list of tuple as value. The tuple have the format (name, value, description).
+ and a dict as value. The value dict has the parameter name as key and has "value" and "description"
+ fields.
"""
moduleInfos = {}
for definition in findDefinitions(const.MODULE_CONFIGURATION, path):
moduleName = definition[0].replace("cfg_", "").replace(".h", "")
- moduleInfos[moduleName] = []
+ moduleInfos[moduleName] = {}
for description, define in getDefinitionBlocks(open(definition[1] + "/" + definition[0], "r").read()):
name, value = formatModuleNameValue(define)
- moduleInfos[moduleName].append((name, value, description))
+ moduleInfos[moduleName][name] = {}
+ moduleInfos[moduleName][name]["value"] = value
+ moduleInfos[moduleName][name]["description"] = description
return moduleInfos