Bug with return value of nodelist saving fixed
authorlbessard
Mon, 08 Sep 2008 13:55:50 +0200
changeset 250 01963beca027
parent 249 a770187273e9
child 251 2066d2c65b71
Bug with return value of nodelist saving fixed
plugger.py
plugins/canfestival/canfestival.py
--- a/plugger.py	Sun Sep 07 16:46:15 2008 +0200
+++ b/plugger.py	Mon Sep 08 13:55:50 2008 +0200
@@ -192,7 +192,7 @@
         # Call the plugin specific OnPlugSave method
         result = self.OnPlugSave()
         if not result:
-            return "Error while saving \"%s\""%self.PlugPath()
+            return "Error while saving \"%s\"\n"%self.PlugPath()
 
         # mark plugin as saved
         self.ChangesToSave = False        
@@ -272,7 +272,7 @@
     def IterChilds(self):
         for PlugType, PluggedChilds in self.PluggedChilds.items():
             for PlugInstance in PluggedChilds:
-                   yield PlugInstance
+                yield PlugInstance
     
     def IECSortedChilds(self):
         # reorder childs by IEC_channels
@@ -789,7 +789,9 @@
             self.SaveXMLFile(os.path.join(self.ProjectPath, 'plc.xml'))
         if self.PLCEditor:
             self.PLCEditor.RefreshTitle()
-        self.PlugRequestSave()
+        result = self.PlugRequestSave()
+        if result:
+            self.logger.write_error(result)
     
     # Update PLCOpenEditor Plugin Block types from loaded plugins
     def RefreshPluginsBlockLists(self):
--- a/plugins/canfestival/canfestival.py	Sun Sep 07 16:46:15 2008 +0200
+++ b/plugins/canfestival/canfestival.py	Mon Sep 08 13:55:50 2008 +0200
@@ -213,7 +213,7 @@
         
     def OnPlugSave(self):
         self.SetRoot(self.PlugPath())
-        return self.SaveProject() is not None
+        return self.SaveProject() is None
 
     def PlugGenerate_C(self, buildpath, locations):
         """