[SCM] morituri/master: log persister
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:10:00 UTC 2014
The following commit has been merged in the master branch:
commit 8b1eef1cf1a07535926d1b79e9d06cd8ccb484c2
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Tue Jan 29 23:32:52 2013 +0100
log persister
diff --git a/morituri/common/cache.py b/morituri/common/cache.py
index 2fb8044..f8424d0 100644
--- a/morituri/common/cache.py
+++ b/morituri/common/cache.py
@@ -30,7 +30,7 @@ from morituri.result import result
from morituri.extern.log import log
-class Persister(object):
+class Persister(log.Loggable):
"""
I wrap an optional pickle to persist an object to disk.
@@ -86,6 +86,7 @@ class Persister(object):
handle.close()
# do an atomic move
shutil.move(path, self._path)
+ self.debug('saved persisted object to %r' % self._path)
def _unpickle(self, default=None):
self.object = default
@@ -101,6 +102,7 @@ class Persister(object):
try:
self.object = pickle.load(handle)
+ self.debug('loaded persisted object from %r' % self._path)
except:
# can fail for various reasons; in that case, pretend we didn't
# load it
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list