Fixed Save As... function in Beremiz
--- a/etherlab/EthercatMaster.py Mon Apr 22 23:54:22 2013 +0200
+++ b/etherlab/EthercatMaster.py Wed Apr 24 17:27:31 2013 +0200
@@ -636,7 +636,7 @@
def CTNTestModified(self):
return self.ChangesToSave or not self.ModelIsSaved()
- def OnCTNSave(self):
+ def OnCTNSave(self, from_project_path=None):
config_filepath = self.ConfigFileName()
config_text = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
--- a/etherlab/etherlab.py Mon Apr 22 23:54:22 2013 +0200
+++ b/etherlab/etherlab.py Wed Apr 24 17:27:31 2013 +0200
@@ -429,8 +429,16 @@
self.ModulesLibrary = None
self.LoadModulesLibrary()
- def GetModulesLibraryPath(self):
- return os.path.join(self.CTNPath(), "modules")
+ def GetModulesLibraryPath(self, project_path=None):
+ if project_path is None:
+ project_path = self.CTNPath()
+ return os.path.join(project_path, "modules")
+
+ def OnCTNSave(self, from_project_path=None):
+ if from_project_path is not None:
+ shutil.copytree(self.GetModulesLibraryPath(from_project_path),
+ self.GetModulesLibraryPath())
+ return True
def CTNGenerate_C(self, buildpath, locations):
return [],"",False