From 0baa18b329a9bc006fc74f7ef65581b04b43cfb7 Mon Sep 17 00:00:00 2001 From: duplo Date: Tue, 27 Jan 2009 18:31:57 +0000 Subject: [PATCH] Create a bertos project folder and copy the bertos source tree git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2230 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/BProject.py | 5 ++++- wizard/bertos_utils.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wizard/BProject.py b/wizard/BProject.py index e58f5818..9c4a11a9 100644 --- a/wizard/BProject.py +++ b/wizard/BProject.py @@ -20,4 +20,7 @@ class BProject(object): def info(self, key): if key in self.infos.keys(): return self.infos[key] - return None \ No newline at end of file + return None + + def __repr__(self): + return repr(self.infos()) \ No newline at end of file diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 52eca1d7..df26613f 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -13,6 +13,7 @@ import os import fnmatch import glob import re +import shutil import const @@ -22,10 +23,15 @@ def isBertosDir(directory): def bertosVersion(directory): return open(directory + "/VERSION").readline().strip() -def createBertosProject(directory): +def createBertosProject(directory, sources_dir, projectInfos): if not os.path.isdir(directory): os.mkdir(directory) - open(directory + "/project.bertos", "w") + f = open(directory + "/project.bertos", "w") + f.write(repr(projectInfos)) + f.close() + shutil.rmtree(directory + "/bertos", True) + shutil.copytree(sources_dir + "/bertos", directory + "/bertos") + shutil.copy(sources_dir + "/Makefile", directory + "/Makefile") def getSystemPath(): path = os.environ["PATH"] -- 2.25.1