Fixed bug in Save function in Beremiz
authorLaurent Bessard
Wed, 24 Apr 2013 18:50:37 +0200
changeset 1063 9b5995303db1
parent 1062 fd7c9a7cf882
child 1064 44318b45aab9
Fixed bug in Save function in Beremiz
ConfigTreeNode.py
canfestival/canfestival.py
--- a/ConfigTreeNode.py	Wed Apr 24 17:37:46 2013 +0200
+++ b/ConfigTreeNode.py	Wed Apr 24 18:50:37 2013 +0200
@@ -188,8 +188,10 @@
             self.ChangesToSave = False
             # go through all children and do the same
             for CTNChild in self.IterChildren():
-                result = CTNChild.CTNRequestSave(
-                    CTNChild.CTNPath(project_path=from_project_path))
+                CTNChildPath = None
+                if from_project_path is not None:
+                    CTNChildPath = CTNChild.CTNPath(project_path=from_project_path)
+                result = CTNChild.CTNRequestSave(CTNChildPath)
                 if result:
                     return result
         return None
--- a/canfestival/canfestival.py	Wed Apr 24 17:37:46 2013 +0200
+++ b/canfestival/canfestival.py	Wed Apr 24 18:50:37 2013 +0200
@@ -380,8 +380,9 @@
         
     def OnCTNSave(self, from_project_path=None):
         self.SetRoot(self.CTNPath())
-        shutil.copytree(self.GetEDSFolder(from_project_path), 
-                        self.GetEDSFolder())
+        if from_project_path is not None:
+            shutil.copytree(self.GetEDSFolder(from_project_path), 
+                            self.GetEDSFolder())
         return self.SaveProject() is None
 
     def CTNGenerate_C(self, buildpath, locations):