Commit ef32718f authored by Barry Warsaw's avatar Barry Warsaw

getSize(): loadmail.py really wants a functional getSize() method, so

here's a semi-kludgey one.  It returns the size of the zodb_pickles
table in bytes.
parent 13ea966d
......@@ -14,9 +14,10 @@
"""An autopacking Berkeley storage without undo and versioning.
"""
__version__ = '$Revision: 1.2 $'.split()[-2:][0]
__version__ = '$Revision: 1.3 $'.split()[-2:][0]
import sys
import os
import struct
import time
......@@ -206,6 +207,11 @@ class Autopack(BerkeleyBase):
def iterator(self):
raise NotImplementedError
def getSize(self):
# Return the size of the pickles table as a rough estimate
filename = os.path.join(self._env.db_home, 'zodb_pickles')
return os.path.getsize(filename)
# Not part of the storage API
def autopack(self):
......
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