Changeset 11657:f3470aa4f755 in orange


Ignore:
Timestamp:
08/13/13 13:18:28 (8 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

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

Location:
Orange/OrangeCanvas/scheme
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Orange/OrangeCanvas/scheme/scheme.py

    r11623 r11657  
    597597        assert(not (self.nodes or self.links or self.annotations)) 
    598598 
     599    def sync_node_properties(self): 
     600        """ 
     601        Called before saving, allowing a subclass to update/sync. 
     602 
     603        The default implementation does nothing. 
     604 
     605        """ 
     606        pass 
     607 
    599608    def save_to(self, stream, pretty=True, pickle_fallback=False): 
    600609        """ 
     
    609618            stream = open(stream, "wb") 
    610619 
     620        self.sync_node_properties() 
     621 
    611622        scheme_to_ows_stream(self, stream, pretty, 
    612623                             pickle_fallback=pickle_fallback) 
  • Orange/OrangeCanvas/scheme/widgetsscheme.py

    r11641 r11657  
    8686        log.debug("Scheme node properties sync (changed: %s)", changed) 
    8787        return changed 
    88  
    89     def save_to(self, stream, pretty=True, pickle_fallback=False): 
    90         """ 
    91         Reimplemented from :func:`Scheme.save_to`. 
    92         """ 
    93         self.sync_node_properties() 
    94         Scheme.save_to(self, stream, pretty, pickle_fallback) 
    9588 
    9689 
Note: See TracChangeset for help on using the changeset viewer.