[GRASS-SVN] r71846 - grass/trunk/gui/wxpython/startup

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Nov 26 07:16:02 PST 2017


Author: martinl
Date: 2017-11-26 07:16:02 -0800 (Sun, 26 Nov 2017)
New Revision: 71846

Modified:
   grass/trunk/gui/wxpython/startup/locdownload.py
Log:
wxGUI: download sample location progress info, be less verbose + formatting issues

Modified: grass/trunk/gui/wxpython/startup/locdownload.py
===================================================================
--- grass/trunk/gui/wxpython/startup/locdownload.py	2017-11-26 15:04:58 UTC (rev 71845)
+++ grass/trunk/gui/wxpython/startup/locdownload.py	2017-11-26 15:16:02 UTC (rev 71846)
@@ -175,13 +175,17 @@
     global start_time
     if count == 0:
         start_time = time.time()
+        sys.stdout.write("Download in progress ...\n0%")
         return
+    if count % 100 != 0: # be less verbose
+        return
     duration = time.time() - start_time
     progress_size = int(count * block_size)
     speed = int(progress_size / (1024 * duration))
     percent = int(count * block_size * 100 / total_size)
-    sys.stdout.write("Download in progress ...\n%d%%, %d MB, %d KB/s, %d seconds passed" %
-                    (percent, progress_size / (1024 * 1024), speed, duration))
+    sys.stdout.write("Download in progress ...\n{0}%, {1} MB, {2} KB/s, {3:.0f} seconds passed".format(
+        percent, progress_size / (1024 * 1024), speed, duration
+    ))
     
 # based on g.extension, potentially move to library
 def download_end_extract(source):



More information about the grass-commit mailing list