From: Fredrik Tolf Date: Wed, 28 Dec 2011 00:08:37 +0000 (+0100) Subject: Added a utility class for manual dirty management. X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=3b9bc7005f761c955dd8664c8141cc338f35ac91;p=wrw.git Added a utility class for manual dirty management. --- diff --git a/wrw/util.py b/wrw/util.py index a0e4095..17fc7fb 100644 --- a/wrw/util.py +++ b/wrw/util.py @@ -58,3 +58,17 @@ class autodirty(sessiondata): super(autodirty, self).__delattr__(name, value) if "_is_dirty" in self.__dict__: self.__dict__["_is_dirty"] = True + +class manudirty(object): + def __init__(self, *args, **kwargs): + super(manudirty, self).__init__(*args, **kwargs) + self.__dirty = False + + def sessfrozen(self): + self.__dirty = False + + def sessdirty(self): + return self.__dirty + + def dirty(self): + self.__dirty = True