From ec596888098946914b091cf361bf569469f4c1e3 Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 19 Apr 2010 13:05:46 +0000 Subject: [PATCH] Use self.project() as readonly property git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3457 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BCpuPage.py | 4 ++-- wizard/BFinalPage.py | 2 +- wizard/BModulePage.py | 8 ++++---- wizard/BWizardPage.py | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/wizard/BCpuPage.py b/wizard/BCpuPage.py index 49daf8c9..4803d6c6 100644 --- a/wizard/BCpuPage.py +++ b/wizard/BCpuPage.py @@ -112,7 +112,7 @@ class BCpuPage(BWizardPage): """ try: QApplication.instance().setOverrideCursor(Qt.WaitCursor) - self.project().loadSourceTree() + self.project.loadSourceTree() self.populateCpuList() cpu_name = self.projectInfo("CPU_NAME") selected_freq = self.projectInfo("SELECTED_FREQ") @@ -161,7 +161,7 @@ class BCpuPage(BWizardPage): """ self.pageContent.cpuList.clear() self.pageContent.cpuList.setCurrentItem(None) - infos = self.project().loadCpuInfos() + infos = self.project.loadCpuInfos() tag_list = bertos_utils.getTagSet(infos) # Create, fill and store the dict with the tags tag_dict = {} diff --git a/wizard/BFinalPage.py b/wizard/BFinalPage.py index f5d353ed..ec767a70 100644 --- a/wizard/BFinalPage.py +++ b/wizard/BFinalPage.py @@ -59,7 +59,7 @@ class BFinalPage(BWizardPage): """ try: QApplication.instance().setOverrideCursor(Qt.WaitCursor) - bertos_utils.createBertosProject(self.project()) + bertos_utils.createBertosProject(self.project) finally: QApplication.instance().restoreOverrideCursor() self._plugin_dict = {} diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index ccaf621c..9c13a2cc 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -110,7 +110,7 @@ class BModulePage(BWizardPage): module = self.currentModule() if module: try: - supported = bertos_utils.isSupported(self.project(), module=module) + 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(module)) supported = True @@ -137,7 +137,7 @@ class BModulePage(BWizardPage): # Doesn't show the hidden fields continue try: - param_supported = bertos_utils.isSupported(self.project(), property_id=(configuration, property)) + param_supported = bertos_utils.isSupported(self.project, property_id=(configuration, property)) except SupportedException, e: self.exceptionOccurred(self.tr("Error evaluating \"%1\" for parameter %2").arg(e.support_string).arg(property)) param_supported = True @@ -224,7 +224,7 @@ class BModulePage(BWizardPage): and not self.projectInfo("LISTS") \ and not self.projectInfo("CONFIGURATIONS"): try: - self.project().loadModuleData() + self.project.loadModuleData() except ModuleDefineException, e: self.exceptionOccurred(self.tr("Error parsing line '%2' in file %1").arg(e.path).arg(e.line)) except EnumDefineException, e: @@ -251,7 +251,7 @@ class BModulePage(BWizardPage): enabled = modules[module]["enabled"] module_item = QTreeWidgetItem(item, QStringList([module])) try: - supported = bertos_utils.isSupported(self.project(), module=module) + 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(module)) supported = True diff --git a/wizard/BWizardPage.py b/wizard/BWizardPage.py index 5c4b4bb9..b7ffe1f5 100644 --- a/wizard/BWizardPage.py +++ b/wizard/BWizardPage.py @@ -85,6 +85,7 @@ class BWizardPage(QWizardPage): """ return QApplication.instance().project.info(key) + @property def project(self): """ Returns the BProject instance. @@ -207,4 +208,4 @@ class BWizardPage(QWizardPage): """ pass - #### \ No newline at end of file + #### -- 2.25.1