Mercurial > p > roundup > code
diff roundup/backends/back_anydbm.py @ 3589:1be293265e61
woo, that was quick
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 03 Mar 2006 02:51:13 +0000 |
| parents | f47bddab5a49 |
| children | 7b25567f0f54 |
line wrap: on
line diff
--- a/roundup/backends/back_anydbm.py Fri Mar 03 02:29:10 2006 +0000 +++ b/roundup/backends/back_anydbm.py Fri Mar 03 02:51:13 2006 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -#$Id: back_anydbm.py,v 1.196 2006-03-03 02:02:50 richard Exp $ +#$Id: back_anydbm.py,v 1.197 2006-03-03 02:51:13 richard Exp $ '''This module defines a backend that saves the hyperdatabase in a database chosen by anydbm. It is guaranteed to always be available in python versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several @@ -35,7 +35,7 @@ import whichdb, os, marshal, re, weakref, string, copy, time, shutil, logging -from roundup import hyperdb, date, password, roundupdb, security +from roundup import hyperdb, date, password, roundupdb, security, support from roundup.backends import locking from roundup.i18n import _ @@ -123,14 +123,19 @@ def getOTKManager(self): return OneTimeKeys(self) - def reindex(self, classname=None): + def reindex(self, classname=None, show_progress=False): if classname: classes = [self.getclass(classname)] else: classes = self.classes.values() for klass in classes: - for nodeid in klass.list(): - klass.index(nodeid) + if show_progress: + for nodeid in support.Progress('Reindex %s'%klass.classname, + klass.list()): + klass.index(nodeid) + else: + for nodeid in klass.list(): + klass.index(nodeid) self.indexer.save_index() def __repr__(self):
