~jbaker/storm/nose_plugin

« back to all changes in this revision

Viewing changes to storm/variables.py

  • Committer: Jamu Kakar
  • Date: 2009-11-24 18:34:34 UTC
  • mfrom: (340 storm.trunk)
  • mto: This revision was merged to the branch mainline in revision 341.
  • Revision ID: jkakar@kakar.ca-20091124183434-ambkvw9tp2byvjnc
- Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
550
550
        Variable.__init__(self, *args, **kwargs)
551
551
        if self.event is not None:
552
552
            self.event.hook("start-tracking-changes", self._start_tracking)
553
 
            self.event.hook("object-deleted", self._detect_changes)
 
553
            self.event.hook("object-deleted", self._detect_changes_and_stop)
554
554
 
555
555
    def _start_tracking(self, obj_info, event_system):
556
556
        self._event_system = event_system
564
564
        if (self._checkpoint_state is not Undef and
565
565
            self.get_state() != self._checkpoint_state):
566
566
            self.event.emit("changed", self, None, self._value, False)
 
567
    
 
568
    def _detect_changes_and_stop(self, obj_info):
 
569
        self._detect_changes(obj_info)
 
570
        if self._event_system is not None:
 
571
            self._stop_tracking(obj_info, self._event_system)
567
572
 
568
573
    def get(self, default=None, to_db=False):
569
574
        if self._event_system is not None: