comparison roundup/admin.py @ 3544:5cd1c83dea50

Features and fixes. Feature: - trackers may configure custom stop-words for the full-text indexer Fixed: - fixes in scripts/import_sf.py - fix some unicode bugs in roundup-admin import - Xapian indexer wasn't actually being used - fix indexing of message content on roundup-admin import
author Richard Jones <richard@users.sourceforge.net>
date Mon, 06 Feb 2006 21:00:47 +0000
parents 2affe8fa51a5
children 064515f658e8
comparison
equal deleted inserted replaced
3543:0735c4587852 3544:5cd1c83dea50
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.97 2005-12-03 11:26:08 a1s Exp $ 19 # $Id: admin.py,v 1.98 2006-02-06 21:00:44 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
1153 f = open(os.path.join(dir, file), 'r') 1153 f = open(os.path.join(dir, file), 'r')
1154 reader = csv.reader(f, colon_separated) 1154 reader = csv.reader(f, colon_separated)
1155 file_props = None 1155 file_props = None
1156 maxid = 1 1156 maxid = 1
1157 # loop through the file and create a node for each entry 1157 # loop through the file and create a node for each entry
1158 for r in reader: 1158 for n, r in enumerate(reader):
1159 if file_props is None: 1159 if file_props is None:
1160 file_props = r 1160 file_props = r
1161 continue 1161 continue
1162 sys.stdout.write('Importing %s - %d\r'%(classname, n))
1163 sys.stdout.flush()
1164
1162 # do the import and figure the current highest nodeid 1165 # do the import and figure the current highest nodeid
1163 nodeid = int(cl.import_list(file_props, r)) 1166 nodeid = int(cl.import_list(file_props, r))
1164 if hasattr(cl, 'import_files'): 1167 if hasattr(cl, 'import_files'):
1165 cl.import_files(dir, nodeid) 1168 cl.import_files(dir, nodeid)
1166 maxid = max(maxid, nodeid) 1169 maxid = max(maxid, nodeid)
1167 1170 print
1168 f.close() 1171 f.close()
1169 1172
1170 # import the journals 1173 # import the journals
1171 f = open(os.path.join(args[0], classname + '-journals.csv'), 'r') 1174 f = open(os.path.join(args[0], classname + '-journals.csv'), 'r')
1172 reader = csv.reader(f, colon_separated) 1175 reader = csv.reader(f, colon_separated)
1236 'designator': arg} 1239 'designator': arg}
1237 else: 1240 else:
1238 cl = self.get_class(arg) 1241 cl = self.get_class(arg)
1239 self.db.reindex(arg) 1242 self.db.reindex(arg)
1240 else: 1243 else:
1241 self.db.reindex() 1244 self.db.reindex(show_progress=True)
1242 return 0 1245 return 0
1243 1246
1244 def do_security(self, args): 1247 def do_security(self, args):
1245 ""'''Usage: security [Role name] 1248 ""'''Usage: security [Role name]
1246 Display the Permissions available to one or all Roles. 1249 Display the Permissions available to one or all Roles.

Roundup Issue Tracker: http://roundup-tracker.org/