diff options
author | André Erdmann <dywi@mailerd.de> | 2013-09-05 11:04:46 +0200 |
---|---|---|
committer | André Erdmann <dywi@mailerd.de> | 2013-09-05 11:04:46 +0200 |
commit | a828adc6a59516779cfc1178da4669379c01a4c7 (patch) | |
tree | fee33463d3d7e129c2d3ee1002550b9f8993a56f /roverlay/util | |
parent | dbcollector: collect time/numstats separately (diff) | |
download | R_overlay-a828adc6a59516779cfc1178da4669379c01a4c7.tar.gz R_overlay-a828adc6a59516779cfc1178da4669379c01a4c7.tar.bz2 R_overlay-a828adc6a59516779cfc1178da4669379c01a4c7.zip |
roverlay/util/objects: PersistentContent
an object with a "has changes" ('dirty') flag
Diffstat (limited to 'roverlay/util')
-rw-r--r-- | roverlay/util/objects.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/roverlay/util/objects.py b/roverlay/util/objects.py index 5ba1ccb..a20b707 100644 --- a/roverlay/util/objects.py +++ b/roverlay/util/objects.py @@ -349,3 +349,26 @@ class ObjectView ( object ): # --- end of update (...) --- # --- end of ObjectView --- + + +class PersistentContent ( object ): + + def __init__ ( self, *args, **kwargs ): + super ( PersistentContent, self ).__init__() + self._dirty = False + # --- end of __init__ (...) --- + + @property + def dirty ( self ): + return self._dirty + # --- end of dirty (...) --- + + def set_dirty ( self ): + self._dirty = True + # --- end of set_dirty (...) --- + + def reset_dirty ( self, value=False ): + self._dirty = bool ( value ) + # --- end of reset_dirty (...) --- + +# --- end of PersistentContent --- |