Fix existing directory problem with copytree.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Apr 2010 11:11:09 +0000 (11:11 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 23 Apr 2010 11:11:09 +0000 (11:11 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3505 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BProject.py

index 3d0f5fec1b946159cfd631ed03dc7426491baae0..77b85326036ce5bae2d5cea8ec2639e6b5337460 100644 (file)
@@ -412,11 +412,11 @@ class BProject(object):
         project_related_stuff = ("cfg", "hw", self.infos["PROJECT_NAME"] + "_wiz.mk") + const.IGNORE_LIST
         for element in os.listdir(origin):
             if element not in project_related_stuff:
-                element = os.path.join(origin, element)
-                if os.path.isdir(element):
-                    copytree.copytree(element, self.prjdir, ignore_list=const.IGNORE_LIST)
+                full_path = os.path.join(origin, element)
+                if os.path.isdir(full_path):
+                    copytree.copytree(full_path, os.path.join(self.prjdir, element), ignore_list=const.IGNORE_LIST)
                 else:
-                    shutil.copy(element, self.prjdir)        
+                    shutil.copy(full_path, self.prjdir)        
 
     def _setupAutoenabledParameters(self):
         for module, information in self.infos["MODULES"].items():