From ed9413a008b0fb24428c5460f07faa6272bd955b Mon Sep 17 00:00:00 2001 From: Christoph Kords Date: Tue, 7 May 2013 14:32:38 +0000 Subject: [PATCH] added simple output about progress --- processing/post/marc_extractData.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/processing/post/marc_extractData.py b/processing/post/marc_extractData.py index b0d590b18..89249d651 100755 --- a/processing/post/marc_extractData.py +++ b/processing/post/marc_extractData.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -import os, sys, math, string, re +import os, sys, math, string, re, time import damask from optparse import OptionParser, OptionGroup, Option @@ -393,8 +393,12 @@ if not os.path.isdir(dirname): # --- loop over positions +time_start = time.time() for incCount,position in enumerate(locations): # walk through locations p.moveto(position+1) # wind to correct position + time_delta = (float(stat['NumberOfIncrements']) / float(incCount+1) - 1.0) * (time.time() - time_start) + sys.stdout.write("\r(%02i:%02i:%02i) processing increment %i of %i..."%(time_delta//3600,time_delta%3600//60,time_delta%60,incCount+1,len(locations))) + sys.stdout.flush() # --- write header @@ -433,5 +437,6 @@ for incCount,position in enumerate(locations): # walk through locations myfile.write('\t'.join(map(str,[e,i]+ipData[i]))+'\n') p.close() +sys.stdout.write("\n") # --------------------------- DONE --------------------------------