Mercurial > p > roundup > code
comparison roundup/admin.py @ 2650:d68a444fcce3
roundup-admin reindex command may now work on single items or classes
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 28 Jul 2004 05:00:32 +0000 |
| parents | a9e1fff1e793 |
| children | 402d6d556558 |
comparison
equal
deleted
inserted
replaced
| 2649:1df7d4a41da4 | 2650:d68a444fcce3 |
|---|---|
| 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 14 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 15 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 16 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 17 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 18 # | 18 # |
| 19 # $Id: admin.py,v 1.77 2004-07-27 00:57:17 richard Exp $ | 19 # $Id: admin.py,v 1.78 2004-07-28 05:00:30 richard Exp $ |
| 20 | 20 |
| 21 '''Administration commands for maintaining Roundup trackers. | 21 '''Administration commands for maintaining Roundup trackers. |
| 22 ''' | 22 ''' |
| 23 __docformat__ = 'restructuredtext' | 23 __docformat__ = 'restructuredtext' |
| 24 | 24 |
| 1152 elif m['date']: | 1152 elif m['date']: |
| 1153 pack_before = date.Date(value) | 1153 pack_before = date.Date(value) |
| 1154 self.db.pack(pack_before) | 1154 self.db.pack(pack_before) |
| 1155 return 0 | 1155 return 0 |
| 1156 | 1156 |
| 1157 def do_reindex(self, args): | 1157 def do_reindex(self, args, desre=re.compile('([A-Za-z]+)([0-9]+)')): |
| 1158 ""'''Usage: reindex | 1158 '''Usage: reindex [classname|designator]* |
| 1159 Re-generate a tracker's search indexes. | 1159 Re-generate a tracker's search indexes. |
| 1160 | 1160 |
| 1161 This will re-generate the search indexes for a tracker. | 1161 This will re-generate the search indexes for a tracker. This will |
| 1162 This will typically happen automatically. | 1162 typically happen automatically. |
| 1163 ''' | 1163 ''' |
| 1164 self.db.indexer.force_reindex() | 1164 if args: |
| 1165 self.db.reindex() | 1165 for arg in args: |
| 1166 m = desre.match(arg) | |
| 1167 if m: | |
| 1168 cl = self.get_class(m.group(1)) | |
| 1169 try: | |
| 1170 cl.index(m.group(2)) | |
| 1171 except IndexError: | |
| 1172 raise UsageError, _('no such item "%(designator)s"')%{ | |
| 1173 'designator': arg} | |
| 1174 else: | |
| 1175 cl = self.get_class(arg) | |
| 1176 self.db.reindex(arg) | |
| 1177 else: | |
| 1178 self.db.reindex() | |
| 1166 return 0 | 1179 return 0 |
| 1167 | 1180 |
| 1168 def do_security(self, args): | 1181 def do_security(self, args): |
| 1169 ""'''Usage: security [Role name] | 1182 ""'''Usage: security [Role name] |
| 1170 Display the Permissions available to one or all Roles. | 1183 Display the Permissions available to one or all Roles. |
