Skip to content

Commit 65a7eaa

Browse files
author
Ralf Schlatterbeck
committed
Fix verbose option for roundup-admin (for import and export)
Fixes [SF#1505645] "Verbose option for import does not work + patch"
1 parent eb05658 commit 65a7eaa

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

roundup/admin.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: admin.py,v 1.99 2006-04-27 03:38:53 richard Exp $
19+
# $Id: admin.py,v 1.100 2006-07-15 10:04:32 schlatterbeck Exp $
2020

2121
'''Administration commands for maintaining Roundup trackers.
2222
'''
@@ -1098,6 +1098,9 @@ class colon_separated(csv.excel):
10981098

10991099
# all nodes for this class
11001100
for nodeid in cl.getnodeids():
1101+
if self.verbose:
1102+
sys.stdout.write ('Exporting %s - %d\r'%(classname, nodeid))
1103+
sys.stdout.flush ()
11011104
writer.writerow(cl.export_list(propnames, nodeid))
11021105
if hasattr(cl, 'export_files'):
11031106
cl.export_files(dir, nodeid)
@@ -1107,6 +1110,9 @@ class colon_separated(csv.excel):
11071110

11081111
# export the journals
11091112
jf = open(os.path.join(dir, classname+'-journals.csv'), 'wb')
1113+
if self.verbose:
1114+
sys.stdout.write ("\nExporting Journal for %s\n" % classname)
1115+
sys.stdout.flush ()
11101116
journals = csv.writer(jf, colon_separated)
11111117
map(journals.writerow, cl.export_journals())
11121118
jf.close()
@@ -1162,8 +1168,9 @@ class colon_separated(csv.excel):
11621168
file_props = r
11631169
continue
11641170

1165-
sys.stdout.write('Importing %s - %d\r'%(classname, n))
1166-
sys.stdout.flush()
1171+
if self.verbose :
1172+
sys.stdout.write('Importing %s - %d\r'%(classname, n))
1173+
sys.stdout.flush()
11671174

11681175
# do the import and figure the current highest nodeid
11691176
nodeid = int(cl.import_list(file_props, r))
@@ -1399,7 +1406,7 @@ def interactive(self):
13991406

14001407
def main(self):
14011408
try:
1402-
opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:v')
1409+
opts, args = getopt.getopt(sys.argv[1:], 'i:u:hcdsS:vV')
14031410
except getopt.GetoptError, e:
14041411
self.usage(str(e))
14051412
return 1

0 commit comments

Comments
 (0)