Mercurial > p > roundup > code
comparison roundup/admin.py @ 3641:ba06fb4030d0
Spacing and CHANGES.txt fixed.
Thanks to alexander smishlajev for pointing me at it -- I just applied
my patches without checking for spacing. Sorry.
.-- Ralf
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Mon, 17 Jul 2006 14:47:23 +0000 |
| parents | eab067227e81 |
| children | 07d1d8e22271 |
comparison
equal
deleted
inserted
replaced
| 3640:eab067227e81 | 3641:ba06fb4030d0 |
|---|---|
| 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.101 2006-07-15 10:15:17 schlatterbeck Exp $ | 19 # $Id: admin.py,v 1.102 2006-07-17 14:47:23 schlatterbeck 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 |
| 1097 writer.writerow(fields) | 1097 writer.writerow(fields) |
| 1098 | 1098 |
| 1099 # all nodes for this class | 1099 # all nodes for this class |
| 1100 for nodeid in cl.getnodeids(): | 1100 for nodeid in cl.getnodeids(): |
| 1101 if self.verbose: | 1101 if self.verbose: |
| 1102 sys.stdout.write ('Exporting %s - %s\r'%(classname, nodeid)) | 1102 sys.stdout.write('Exporting %s - %s\r'%(classname, nodeid)) |
| 1103 sys.stdout.flush () | 1103 sys.stdout.flush() |
| 1104 writer.writerow(cl.export_list(propnames, nodeid)) | 1104 writer.writerow(cl.export_list(propnames, nodeid)) |
| 1105 if hasattr(cl, 'export_files'): | 1105 if hasattr(cl, 'export_files'): |
| 1106 cl.export_files(dir, nodeid) | 1106 cl.export_files(dir, nodeid) |
| 1107 | 1107 |
| 1108 # close this file | 1108 # close this file |
| 1109 f.close() | 1109 f.close() |
| 1110 | 1110 |
| 1111 # export the journals | 1111 # export the journals |
| 1112 jf = open(os.path.join(dir, classname+'-journals.csv'), 'wb') | 1112 jf = open(os.path.join(dir, classname+'-journals.csv'), 'wb') |
| 1113 if self.verbose: | 1113 if self.verbose: |
| 1114 sys.stdout.write ("\nExporting Journal for %s\n" % classname) | 1114 sys.stdout.write("\nExporting Journal for %s\n" % classname) |
| 1115 sys.stdout.flush () | 1115 sys.stdout.flush() |
| 1116 journals = csv.writer(jf, colon_separated) | 1116 journals = csv.writer(jf, colon_separated) |
| 1117 map(journals.writerow, cl.export_journals()) | 1117 map(journals.writerow, cl.export_journals()) |
| 1118 jf.close() | 1118 jf.close() |
| 1119 return 0 | 1119 return 0 |
| 1120 | 1120 |
| 1166 for n, r in enumerate(reader): | 1166 for n, r in enumerate(reader): |
| 1167 if file_props is None: | 1167 if file_props is None: |
| 1168 file_props = r | 1168 file_props = r |
| 1169 continue | 1169 continue |
| 1170 | 1170 |
| 1171 if self.verbose : | 1171 if self.verbose: |
| 1172 sys.stdout.write('Importing %s - %s\r'%(classname, n)) | 1172 sys.stdout.write('Importing %s - %s\r'%(classname, n)) |
| 1173 sys.stdout.flush() | 1173 sys.stdout.flush() |
| 1174 | 1174 |
| 1175 # do the import and figure the current highest nodeid | 1175 # do the import and figure the current highest nodeid |
| 1176 nodeid = int(cl.import_list(file_props, r)) | 1176 nodeid = int(cl.import_list(file_props, r)) |
