[Zodb-checkins] CVS: StandaloneZODB/bsddb3Storage/bsddb3Storage - Autopack.py:1.3
Barry Warsaw
barry@wooz.org
Thu, 18 Jul 2002 17:31:49 -0400
Update of /cvs-repository/StandaloneZODB/bsddb3Storage/bsddb3Storage
In directory cvs.zope.org:/tmp/cvs-serv9233
Modified Files:
Autopack.py
Log Message:
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.
=== StandaloneZODB/bsddb3Storage/bsddb3Storage/Autopack.py 1.2 => 1.3 ===
__version__ = '$Revision$'.split()[-2:][0]
import sys
+import os
import struct
import time
@@ -205,6 +206,11 @@
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