Create a bertos project folder and copy the bertos source tree
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 27 Jan 2009 18:31:57 +0000 (18:31 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Tue, 27 Jan 2009 18:31:57 +0000 (18:31 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2230 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BProject.py
wizard/bertos_utils.py

index e58f5818481bbbd6d91a2fb8d99bd613ce36db6a..9c4a11a9bf7c4f6bb10ea7165cb65b01fd66b01b 100644 (file)
@@ -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
index 52eca1d7a59a161f9b15d47c4f7bd7ee23c6c1ea..df26613f66785a662666a44edb5a076719566775 100644 (file)
@@ -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"]