|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -#$Id: back_anydbm.py,v 1.196 2006-03-03 02:02:50 richard Exp $ |
| 18 | +#$Id: back_anydbm.py,v 1.197 2006-03-03 02:51:13 richard Exp $ |
19 | 19 | '''This module defines a backend that saves the hyperdatabase in a |
20 | 20 | database chosen by anydbm. It is guaranteed to always be available in python |
21 | 21 | versions >2.1.1 (the dumbdbm fallback in 2.1.1 and earlier has several |
|
35 | 35 |
|
36 | 36 | import whichdb, os, marshal, re, weakref, string, copy, time, shutil, logging |
37 | 37 |
|
38 | | -from roundup import hyperdb, date, password, roundupdb, security |
| 38 | +from roundup import hyperdb, date, password, roundupdb, security, support |
39 | 39 | from roundup.backends import locking |
40 | 40 | from roundup.i18n import _ |
41 | 41 |
|
@@ -123,14 +123,19 @@ def getSessionManager(self): |
123 | 123 | def getOTKManager(self): |
124 | 124 | return OneTimeKeys(self) |
125 | 125 |
|
126 | | - def reindex(self, classname=None): |
| 126 | + def reindex(self, classname=None, show_progress=False): |
127 | 127 | if classname: |
128 | 128 | classes = [self.getclass(classname)] |
129 | 129 | else: |
130 | 130 | classes = self.classes.values() |
131 | 131 | for klass in classes: |
132 | | - for nodeid in klass.list(): |
133 | | - klass.index(nodeid) |
| 132 | + if show_progress: |
| 133 | + for nodeid in support.Progress('Reindex %s'%klass.classname, |
| 134 | + klass.list()): |
| 135 | + klass.index(nodeid) |
| 136 | + else: |
| 137 | + for nodeid in klass.list(): |
| 138 | + klass.index(nodeid) |
134 | 139 | self.indexer.save_index() |
135 | 140 |
|
136 | 141 | def __repr__(self): |
|
0 commit comments