etherlab/etherlab.py
changeset 2133 ba0b2ca7db26
parent 2111 f2cffda17d00
child 2137 b65abacdbdf9
--- 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