From fd6894350a266f4436055940e6220151a4fd43de Mon Sep 17 00:00:00 2001 From: duplo Date: Thu, 23 Apr 2009 10:29:22 +0000 Subject: [PATCH] Use unicode instead of str for convert strings git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2646 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BFolderPage.py | 4 ++-- wizard/BModulePage.py | 2 +- wizard/BToolchainPage.py | 2 +- wizard/bertos_utils.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wizard/BFolderPage.py b/wizard/BFolderPage.py index 9eda8b71..dce305e0 100644 --- a/wizard/BFolderPage.py +++ b/wizard/BFolderPage.py @@ -91,14 +91,14 @@ class BFolderPage(BWizardPage): """ Slot called when the project name is changed manually by the user. """ - self._project_name = str(name).replace(" ", "_") + self._project_name = unicode(name).replace(" ", "_") self.setProjectPath() def directoryChanged(self, directory): """ Slot called when the project folder is changed manually by the user. """ - self._destination_folder = str(QDir.toNativeSeparators(directory)) + self._destination_folder = unicode(QDir.toNativeSeparators(directory)) self.setProjectPath() def selectDirectory(self): diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 9fbcf015..38bc8a53 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -189,7 +189,7 @@ class BModulePage(BWizardPage): configuration = self.projectInfo("MODULES")[self.currentModule()]["configuration"] configurations = self.projectInfo("CONFIGURATIONS") if "type" not in configurations[configuration][property]["informations"] or configurations[configuration][property]["informations"]["type"] == "int": - configurations[configuration][property]["value"] = str(int(self.pageContent.propertyTable.cellWidget(index, 1).value())) + configurations[configuration][property]["value"] = unicode(int(self.pageContent.propertyTable.cellWidget(index, 1).value())) elif configurations[configuration][property]["informations"]["type"] == "enum": configurations[configuration][property]["value"] = unicode(self.pageContent.propertyTable.cellWidget(index, 1).currentText()) elif configurations[configuration][property]["informations"]["type"] == "boolean": diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 4f7b4bf8..f85dbb1f 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -251,7 +251,7 @@ class BToolchainPage(BWizardPage): self._validation_process.start(filename, ["-v"]) self._validation_process.waitForStarted(1000) if self._validation_process.waitForFinished(200): - description = str(self._validation_process.readAllStandardError()) + description = unicode(self._validation_process.readAllStandardError()) info = bertos_utils.getToolchainInfo(description) if len(info) >= 4: valid = True diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 2bc44ab5..00b687d7 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -228,7 +228,7 @@ def csrcGenerator(project_info): cppasrc = " \\\n\t".join(cppasrc) + " \\" cxxsrc = " \\\n\t".join(cxxsrc) + " \\" asrc = " \\\n\t".join(asrc) + " \\" - constants = "\n".join([os.path.basename(project_info.info("PROJECT_PATH")) + "_" + key + " = " + str(value) for key, value in constants.items()]) + constants = "\n".join([os.path.basename(project_info.info("PROJECT_PATH")) + "_" + key + " = " + unicode(value) for key, value in constants.items()]) return csrc, pcsrc, cppasrc, cxxsrc, asrc, constants def findModuleFiles(module, project_info): -- 2.25.1