Mercurial > p > roundup > code
comparison roundup/admin.py @ 3803:c54ae50f6ce1
Error message fixes.
- Verbose messages now print the \r *before* the message. Now if the
import aborts (e.g. due to a traceback) the last message will not be
overwritten (by the traceback).
- fix duplicate verbose message, probably result of a merge.
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Wed, 10 Jan 2007 18:17:47 +0000 |
| parents | cecdd102733c |
| children | f7766d5ba962 |
comparison
equal
deleted
inserted
replaced
| 3802:c3af8c6a6b5b | 3803:c54ae50f6ce1 |
|---|---|
| 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.105 2006-08-11 05:13:06 richard Exp $ | 19 # $Id: admin.py,v 1.106 2007-01-10 18:17:47 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 |
| 1108 writer.writerow(fields) | 1108 writer.writerow(fields) |
| 1109 | 1109 |
| 1110 # all nodes for this class | 1110 # all nodes for this class |
| 1111 for nodeid in cl.getnodeids(): | 1111 for nodeid in cl.getnodeids(): |
| 1112 if self.verbose: | 1112 if self.verbose: |
| 1113 sys.stdout.write('Exporting %s - %s\r'%(classname, nodeid)) | 1113 sys.stdout.write('\rExporting %s - %s'%(classname, nodeid)) |
| 1114 sys.stdout.flush() | |
| 1115 if self.verbose: | |
| 1116 sys.stdout.write('Exporting %s - %s\r'%(classname, nodeid)) | |
| 1117 sys.stdout.flush() | 1114 sys.stdout.flush() |
| 1118 writer.writerow(cl.export_list(propnames, nodeid)) | 1115 writer.writerow(cl.export_list(propnames, nodeid)) |
| 1119 if export_files and hasattr(cl, 'export_files'): | 1116 if export_files and hasattr(cl, 'export_files'): |
| 1120 cl.export_files(dir, nodeid) | 1117 cl.export_files(dir, nodeid) |
| 1121 | 1118 |
| 1196 if file_props is None: | 1193 if file_props is None: |
| 1197 file_props = r | 1194 file_props = r |
| 1198 continue | 1195 continue |
| 1199 | 1196 |
| 1200 if self.verbose: | 1197 if self.verbose: |
| 1201 sys.stdout.write('Importing %s - %s\r'%(classname, n)) | 1198 sys.stdout.write('\rImporting %s - %s'%(classname, n)) |
| 1202 sys.stdout.flush() | 1199 sys.stdout.flush() |
| 1203 | 1200 |
| 1204 # do the import and figure the current highest nodeid | 1201 # do the import and figure the current highest nodeid |
| 1205 nodeid = cl.import_list(file_props, r) | 1202 nodeid = cl.import_list(file_props, r) |
| 1206 if hasattr(cl, 'import_files'): | 1203 if hasattr(cl, 'import_files'): |
