From: duplo Date: Thu, 9 Apr 2009 13:51:43 +0000 (+0000) Subject: Modify the comments X-Git-Tag: 2.1.0~209 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d33cc3bc1a94318cdf7624edb613eb6771a2fcb9;p=bertos.git Modify the comments git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2473 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BModulePage.py b/wizard/BModulePage.py index 4c681f85..7c8472c3 100644 --- a/wizard/BModulePage.py +++ b/wizard/BModulePage.py @@ -89,10 +89,10 @@ class BModulePage(BWizardPage): index = 0 for i, property in param_list: if "type" in configurations[property]["informations"] and configurations[property]["informations"]["type"] == "autoenabled": - ## Doesn't show the hidden fields + # Doesn't show the hidden fields pass else: - ## Set the row count to the current index + 1 + # Set the row count to the current index + 1 self.pageContent.propertyTable.setRowCount(index + 1) item = QTableWidgetItem(configurations[property]["brief"]) item.setData(Qt.UserRole, qvariant_converter.convertString(property)) @@ -160,7 +160,7 @@ class BModulePage(BWizardPage): """ Loads the module data. """ - ## Load the module data only if it isn't already loaded + # 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: @@ -233,7 +233,7 @@ class BModulePage(BWizardPage): Inserts in the table at index a spinbox for an int, a long or an unsigned long property setted to value. """ - ## int, long or undefined type property + # int, long or undefined type property spin_box = None if bertos_utils.isLong(informations) or bertos_utils.isUnsignedLong(informations): spin_box = QDoubleSpinBox() diff --git a/wizard/BToolchainPage.py b/wizard/BToolchainPage.py index 1820768a..8988ed57 100644 --- a/wizard/BToolchainPage.py +++ b/wizard/BToolchainPage.py @@ -200,14 +200,14 @@ class BToolchainPage(BWizardPage): filename = qvariant_converter.getStringDict(self.pageContent.toolchainList.item(i).data(Qt.UserRole))["path"] valid = False info = {} - ## Check for the other tools of the toolchain + # Check for the other tools of the toolchain for tool in TOOLCHAIN_ITEMS: if os.path.exists(filename.replace("gcc", tool)): valid = True else: valid = False break - ## Try to retrieve the informations about the toolchain only for the valid toolchains + # Try to retrieve the informations about the toolchain only for the valid toolchains if valid: self._validation_process = QProcess() self._validation_process.start(filename, ["-v"]) @@ -219,7 +219,7 @@ class BToolchainPage(BWizardPage): valid = True else: self._validation_process.kill() - ## Add the item in the list with the appropriate associate data. + # Add the item in the list with the appropriate associate data. if valid: self._validItem(i, info) else: diff --git a/wizard/BVersionPage.py b/wizard/BVersionPage.py index e4cb8d2c..6a7fbf63 100644 --- a/wizard/BVersionPage.py +++ b/wizard/BVersionPage.py @@ -36,7 +36,7 @@ class BVersionPage(BWizardPage): """ if self.pageContent.versionList.currentRow() != -1: sources_path = qvariant_converter.getString(self.pageContent.versionList.currentItem().data(Qt.UserRole)) - ## Remove the trailing slash + # Remove the trailing slash if sources_path.endswith(os.sep): sources_path = sources_path[:-1] self.setProjectInfo("SOURCES_PATH", sources_path) diff --git a/wizard/bertos.py b/wizard/bertos.py index a8d46650..87b08237 100755 --- a/wizard/bertos.py +++ b/wizard/bertos.py @@ -55,7 +55,7 @@ def main(): app = QApplication(sys.argv) app.settings = QSettings("Develer", "Bertos Configurator") app.project = BProject.BProject() - ## Development utility lines, to be removed for production + # Development utility lines, to be removed for production if newer("bertos.qrc", "bertos.rcc"): os.system("rcc -binary bertos.qrc -o bertos.rcc") QResource.registerResource("bertos.rcc") @@ -64,7 +64,7 @@ def main(): elif "--edit" in sys.argv and "--create" not in sys.argv: editProject() elif "--create" in sys.argv and "--edit" in sys.argv: - ## TODO: need an explaining message + # TODO need an explaining message print " ".join(sys.argv) print "Invalid usage!" pass diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 1b8715ff..f4547f1f 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -34,22 +34,22 @@ def createBertosProject(project_info): f = open(directory + "/project.bertos", "w") f.write(pickle.dumps(project_info)) f.close() - ## Destination source dir + # Destination source dir srcdir = directory + "/bertos" shutil.rmtree(srcdir, True) shutil.copytree(sources_dir + "/bertos", srcdir) - ## Destination makefile + # Destination makefile makefile = directory + "/Makefile" if os.path.exists(makefile): os.remove(makefile) makefile = open("mktemplates/Makefile").read() makefile = makefileGenerator(project_info, makefile) open(directory + "/Makefile", "w").write(makefile) - ## Destination project dir + # Destination project dir prjdir = directory + "/" + os.path.basename(directory) shutil.rmtree(prjdir, True) os.mkdir(prjdir) - ## Destination configurations files + # Destination configurations files cfgdir = prjdir + "/cfg" shutil.rmtree(cfgdir, True) os.mkdir(cfgdir) @@ -68,14 +68,14 @@ def createBertosProject(project_info): f = open(cfgdir + "/" + os.path.basename(configuration), "w") f.write(string) f.close() - ## Destinatio mk file + # Destinatio mk file makefile = open("mktemplates/template.mk", "r").read() makefile = mkGenerator(project_info, makefile) open(prjdir + "/" + os.path.basename(prjdir) + ".mk", "w").write(makefile) - ## Destination main.c file + # Destination main.c file main = open("srctemplates/main.c", "r").read() open(prjdir + "/main.c", "w").write(main) - ## Codelite project files + # Codelite project files if "codelite" in project_info.info("OUTPUT"): codelite_project.createProject(project_info) @@ -102,7 +102,7 @@ def makefileGenerator(project_info, makefile): """ Generate the Makefile for the current project. """ - # TODO: write a general function that works for both the mk file and the Makefile + # TODO write a general function that works for both the mk file and the Makefile while makefile.find("project_name") != -1: makefile = makefile.replace("project_name", os.path.basename(project_info.info("PROJECT_PATH"))) return makefile @@ -114,18 +114,18 @@ def csrcGenerator(project_info): harvard = True else: harvard = False - ## file to be included in CSRC variable + # file to be included in CSRC variable csrc = [] - ## file to be included in PCSRC variable + # file to be included in PCSRC variable pcsrc = [] - ## files to be included in CPPASRC variable + # files to be included in CPPASRC variable asrc = [] - ## constants to be included at the beginning of the makefile + # constants to be included at the beginning of the makefile constants = {} for module, information in modules.items(): module_files = set([]) dependency_files = set([]) - ## assembly sources + # assembly sources asm_files = set([]) if information["enabled"]: if "constants" in information: @@ -154,22 +154,22 @@ def csrcGenerator(project_info): return csrc, pcsrc, asrc, constants def findModuleFiles(module, project_info): - ## Find the files related to the selected module + # Find the files related to the selected module cfiles = [] sfiles = [] - ## .c files related to the module and the cpu architecture + # .c files related to the module and the cpu architecture for filename, path in findDefinitions(module + ".c", project_info) + \ findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".c", project_info): path = path.replace(project_info.info("SOURCES_PATH") + "/", "") cfiles.append(path + "/" + filename) - ## .s files related to the module and the cpu architecture + # .s files related to the module and the cpu architecture for filename, path in findDefinitions(module + ".s", project_info) + \ findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".s", project_info) + \ findDefinitions(module + ".S", project_info) + \ findDefinitions(module + "_" + project_info.info("CPU_INFOS")["TOOLCHAIN"] + ".S", project_info): path = path.replace(project_info.info("SOURCES_PATH") + "/", "") sfiles.append(path + "/" + filename) - ## .c and .s files related to the module and the cpu tags + # .c and .s files related to the module and the cpu tags for tag in project_info.info("CPU_INFOS")["CPU_TAGS"]: for filename, path in findDefinitions(module + "_" + tag + ".c", project_info): path = path.replace(project_info.info("SOURCES_PATH") + "/", "")