--- a/src/p4l/utils.py Tue Oct 08 17:25:39 2013 +0200
+++ b/src/p4l/utils.py Fri Oct 11 11:46:18 2013 +0200
@@ -46,7 +46,7 @@
logger = logging.getLogger(__name__)
-def show_progress(current_line, total_line, label, width, writer=None):
+def show_progress(current_line, total_line, label, width, writer=None, newline=False):
if writer is None:
writer = sys.stdout
@@ -60,7 +60,7 @@
loader = u'[' + (u'=' * int(marks)) + (u' ' * int(spaces)) + u']'
- s = u"%s %3d%% %*d/%d - %*s\r" % (loader, percent, len(str(total_line)), current_line, total_line, width, label[:width])
+ s = u"%s %3d%% %*d/%d - %*s%s" % (loader, percent, len(str(total_line)), current_line, total_line, width, label[:width], "\n" if newline else "\r")
writer.write(s) #takes the header into account
if percent >= 100: