genpkgmetadata.py

[email protected] (James Antill)
Newsgroups gmane.linux.rpm.metadata
Message-ID <[email protected]>
 genpkgmetadata.py |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 9062aec1e79b371bf243658c6d2c9a5b4e21f8b8
Author: James Antill <[email protected]>
Date:   Fri Feb 29 16:12:32 2008 -0500

    Fix line overflow, minor IO optimisation

diff --git a/genpkgmetadata.py b/genpkgmetadata.py
index e9de6b3..03f2b31 100755
--- a/genpkgmetadata.py
+++ b/genpkgmetadata.py
@@ -140,8 +140,9 @@ class MDCallBack(object):
         print thing
     
     def progress(self, item, current, total):
-        sys.stdout.write('\r' + ' ' * 80)
-        sys.stdout.write("\r%d/%d - %s" % (current, total, item))
+        beg = "%*d/%d - " % (len(str(total)), current, total)
+        left = 80 - len(beg)
+        sys.stdout.write("\r%s%-*.*s" % (beg, left, left, item))
         sys.stdout.flush()
         
 def main(args):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.