Commits

Aleš Erjavec  committed f3470aa

Added an default 'sync_node_properties' method to base Scheme class.

  • Participants
  • Parent commits 9b25511

Comments (0)

Files changed (2)

File Orange/OrangeCanvas/scheme/scheme.py

 
         assert(not (self.nodes or self.links or self.annotations))
 
+    def sync_node_properties(self):
+        """
+        Called before saving, allowing a subclass to update/sync.
+
+        The default implementation does nothing.
+
+        """
+        pass
+
     def save_to(self, stream, pretty=True, pickle_fallback=False):
         """
         Save the scheme as an xml formated file to `stream`
         if isinstance(stream, basestring):
             stream = open(stream, "wb")
 
+        self.sync_node_properties()
+
         scheme_to_ows_stream(self, stream, pretty,
                              pickle_fallback=pickle_fallback)
 

File Orange/OrangeCanvas/scheme/widgetsscheme.py

         log.debug("Scheme node properties sync (changed: %s)", changed)
         return changed
 
-    def save_to(self, stream, pretty=True, pickle_fallback=False):
-        """
-        Reimplemented from :func:`Scheme.save_to`.
-        """
-        self.sync_node_properties()
-        Scheme.save_to(self, stream, pretty, pickle_fallback)
-
 
 class WidgetManager(QObject):
     """