Adding support for modification in CanFestival eds_utils
authorlbessard
Thu, 26 Jun 2008 09:24:24 +0200
changeset 490 305d75028630
parent 489 cfba6bf99701
child 491 2ad3dedf6c6a
Adding support for modification in CanFestival eds_utils
objdictgen/nodemanager.py
--- a/objdictgen/nodemanager.py	Wed Jun 25 17:31:41 2008 +0200
+++ b/objdictgen/nodemanager.py	Thu Jun 26 09:24:24 2008 +0200
@@ -299,7 +299,7 @@
     """
     def CloseCurrent(self, ignore = False):
         # Verify if it's not forced that the current node is saved before closing it
-        if self.UndoBuffers[self.NodeIndex].IsCurrentSaved() or ignore:
+        if self.NodeIndex in self.UndoBuffers and (self.UndoBuffers[self.NodeIndex].IsCurrentSaved() or ignore):
             self.RemoveNodeBuffer(self.NodeIndex)
             if len(self.UndoBuffers) > 0:
                 previousindexes = [idx for idx in self.UndoBuffers.keys() if idx < self.NodeIndex]
@@ -335,7 +335,7 @@
     Export to an eds file and store it in a new buffer if no node edited
     """
     def ExportCurrentToEDSFile(self, filepath):
-        return eds_utils.GenerateEDSFile(filepath, self)
+        return eds_utils.GenerateEDSFile(filepath, self.CurrentNode)
     
     """
     Build the C definition of Object Dictionary for current node