Revision: 1121
http://svn.sourceforge.net/hackndev/?rev=1121&view=rev
Author: bobofdoom
Date: 2007-07-08 07:34:34 -0700 (Sun, 08 Jul 2007)
Log Message:
-----------
TOOLS: serial-loader: Added ETA and transfer speed to quickload uploader.
Modified Paths:
--------------
linux4palm/tools/serial-loader/ql.py
Modified: linux4palm/tools/serial-loader/ql.py
===================================================================
--- linux4palm/tools/serial-loader/ql.py 2007-07-08 14:27:46 UTC (rev 1120)
+++ linux4palm/tools/serial-loader/ql.py 2007-07-08 14:34:34 UTC (rev 1121)
@@ -23,6 +23,9 @@
# output the size of the image
sys.stdout.write(struct.pack('<I', len(image)))
+start = time.time()
+
+imgsize = len(image)
# write out image
i = 0
for c in image:
@@ -31,6 +34,7 @@
# print progress percentage
i += 1
- if (i % 1000) == 0:
- sys.stderr.write('%f\n' % (i / float(len(image)) * 100))
+ if (i % 10000) == 0:
+ speed = i/(time.time() - start)
+ sys.stderr.write('%.1f%% %.2f K/s ETA: %.0fs\n' % ((i / float(len(image)) * 100), (speed / 1024), (imgsize-i) / speed))
sys.stderr.flush()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|