Commits

mickael9 committed d955226

Fix alignement issues (fixes #1)

Comments (0)

Files changed (1)

     return (base + ext).ljust(max_base + len(ext))
 
 def print_status(upload, index, count):
-        name = shorten(upload.file.name, 15)
-        bar_size = int(50 * upload.percent_done / 100)
-        bar = '[' + (bar_size * '#') + ((50 - bar_size) * '-') + ']'
+        name = shorten(upload.file.name, 22)
+        bar_size = int(40 * upload.percent_done / 100)
+        bar = '[' + (bar_size * '#') + ((40 - bar_size) * '-') + ']'
 
-        sys.stderr.write('\r%s (%d/%d) %s %d %%' % (name, index, count, bar, upload.percent_done))
+        sys.stderr.write('\r%s (%3d/%d) %s %d %%' % (name, index, count, bar, upload.percent_done))
 
 def show_share(share):
     print('--------------------------------------------------------------------------------')