From: duplo Date: Tue, 20 Apr 2010 16:18:37 +0000 (+0000) Subject: Add method to create the sources dir into the project. X-Git-Tag: 2.5.0~419 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=e28fc9dfd2361aecf99ecb8f3f256a8776e266d3;p=bertos.git Add method to create the sources dir into the project. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3489 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BProject.py b/wizard/BProject.py index 3d8d579e..ca24f669 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -276,16 +276,7 @@ class BProject(object): # VERSION file self._writeVersionFile(directory + "/VERSION") # Destination source dir - srcdir = directory + "/bertos" - if not edit: - # If not in editing mode it copies all the bertos sources in the /bertos subdirectory of the project - shutil.rmtree(srcdir, True) - copytree.copytree(sources_dir + "/bertos", srcdir, ignore_list=const.IGNORE_LIST) - elif old_sources_dir: - # If in editing mode it merges the current bertos sources with the selected ones - # TODO: implement the three way merge algotihm - # - mergeSources(srcdir, sources_dir, old_sources_dir) + self._createSourcesDir(sources_dir, directory + "/bertos", old_sources_dir, edit) # Destination makefile self._writeMakefile(directory + "/Makefile") # Destination project dir @@ -380,6 +371,17 @@ class BProject(object): configuration[parameter]["value"] = "1" if information["enabled"] else "0" self.infos["CONFIGURATIONS"] = configurations + def _createSourcesDir(self, sources_dir, dest_srcdir, old_sources_dir, edit=False): + if not edit: + # If not in editing mode it copies all the bertos sources in the /bertos subdirectory of the project + shutil.rmtree(dest_srcdir, True) + copytree.copytree(sources_dir + "/bertos", dest_srcdir, ignore_list=const.IGNORE_LIST) + elif old_sources_dir: + # If in editing mode it merges the current bertos sources with the selected ones + # TODO: implement the three way merge algotihm + # + mergeSources(dest_srcdir, sources_dir, old_sources_dir) + def _createDestinationDirectory(self, maindir, edit=False): if not edit: if os.path.isdir(maindir):