Skip to content

Commit e792c62

Browse files
committed
feat: add Progress output for admin export/exporttables
This provides feedback on how far along the export is. Detailed per node output with -V (for use when identifying exactly what node is hanging the output) is kind of ugly when used with Progress. But it's functional and not the expected operation mode.
1 parent e84b2fc commit e792c62

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

roundup/admin.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
)
4848
from roundup.exceptions import UsageError
4949
from roundup.i18n import _, get_translation
50+
from roundup import support
5051

5152
try:
5253
from UserDict import UserDict
@@ -653,9 +654,10 @@ class colon_separated(csv.excel):
653654
all_nodes.sort(key=keysort)
654655
# if there is no classkey no need to sort
655656

656-
for nodeid in all_nodes:
657+
for nodeid in support.Progress( "Exporting %s" %
658+
classname, all_nodes):
657659
if self.verbose:
658-
sys.stdout.write('\rExporting %s - %s' %
660+
sys.stdout.write('\rExporting %s - %s ' %
659661
(classname, nodeid))
660662
sys.stdout.flush()
661663
node = cl.getnode(nodeid)
@@ -683,7 +685,8 @@ class colon_separated(csv.excel):
683685
classname)
684686
sys.stdout.flush()
685687
journals = csv.writer(jf, colon_separated)
686-
for row in cl.export_journals():
688+
for row in support.Progress(" Writing journals",
689+
cl.export_journals()):
687690
journals.writerow(row)
688691
if max_len > self.db.config.CSV_FIELD_SIZE:
689692
print("Warning: config csv_field_size should be at least %s" %
@@ -1761,7 +1764,6 @@ def do_reindex(self, args, desre=designator_re, desrng=designator_rng):
17611764
to reindex issue class items 23-1000. Missing items
17621765
are reported but do not stop indexing of the range.
17631766
"""
1764-
from roundup import support
17651767
if args:
17661768
for arg in args:
17671769
m = desre.match(arg)

0 commit comments

Comments
 (0)