From: duplo Date: Tue, 25 Aug 2009 15:08:41 +0000 (+0000) Subject: Change the automatic setting of the autoenabled parameters X-Git-Tag: 2.2.0~186 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d5b5023975dda1842bb0576de592729a37f4ea99;p=bertos.git Change the automatic setting of the autoenabled parameters git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2782 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 44911e5c..c59477e0 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -100,10 +100,10 @@ def projectFileGenerator(project_info): project_data["SELECTED_FREQ"] = project_info.info("SELECTED_FREQ") return pickle.dumps(project_data) -def createBertosProject(project_info): +def createBertosProject(project_info, edit=False): directory = project_info.info("PROJECT_PATH") sources_dir = project_info.info("SOURCES_PATH") - if os.path.isdir(directory): + if os.path.isdir(directory) and not edit: shutil.rmtree(directory, True) os.makedirs(directory) f = open(directory + "/project.bertos", "w") @@ -137,14 +137,14 @@ def createBertosProject(project_info): cfgdir = prjdir + "/cfg" shutil.rmtree(cfgdir, True) os.mkdir(cfgdir) - # Set to 1 the autoenabled for enabled modules + # Set properly the autoenabled parameters for module, information in project_info.info("MODULES").items(): - if information["enabled"] and "configuration" in information and information["configuration"] != "": + if "configuration" in information and information["configuration"] != "": configurations = project_info.info("CONFIGURATIONS") configuration = configurations[information["configuration"]] for start, parameter in configuration["paramlist"]: if "type" in configuration[parameter]["informations"] and configuration[parameter]["informations"]["type"] == "autoenabled": - configuration[parameter]["value"] = "1" + configuration[parameter]["value"] = "1" if information["enabled"] else "0" project_info.setInfo("CONFIGURATIONS", configurations) # Copy all the configuration files for configuration, information in project_info.info("CONFIGURATIONS").items():