Commit d4ce5d0c authored by Barry Warsaw's avatar Barry Warsaw

BerkeleyConfig.__repr__(): Dumb little thing which helps to know how

it's configured when you see it in the log files.
parent 7eab805a
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
"""Base class for BerkeleyStorage implementations. """Base class for BerkeleyStorage implementations.
""" """
__version__ = '$Revision: 1.32 $'.split()[-2:][0] __version__ = '$Revision: 1.33 $'.split()[-2:][0]
import os import os
import time import time
...@@ -126,6 +126,22 @@ class BerkeleyConfig: ...@@ -126,6 +126,22 @@ class BerkeleyConfig:
packtime = 4 * 60 * 60 packtime = 4 * 60 * 60
classicpack = 0 classicpack = 0
def __repr__(self):
d = self.__class__.__dict__.copy()
d.update(self.__dict__)
return """<BerkeleyConfig:
\tcheckpoint interval: %(interval)s seconds
\tcheckpoint kbytes: %(kbyte)s
\tcheckpoint minutes: %(min)s
\t----------------------
\tlogdir: %(logdir)s
\tcachesize: %(cachesize)s bytes
\t----------------------
\tautopack frequency: %(frequency)s seconds
\tpack to %(packtime)s seconds in the past
\tclassic pack every %(classicpack)s autopacks
\t>""" % d
class BerkeleyBase(BaseStorage): class BerkeleyBase(BaseStorage):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment