[GRASS-SVN] r49048 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 2 10:48:55 EDT 2011


Author: martinl
Date: 2011-11-02 07:48:55 -0700 (Wed, 02 Nov 2011)
New Revision: 49048

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
Log:
wxGUI: improve time formatting (when command finished)


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2011-11-02 13:12:09 UTC (rev 49047)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/goutput.py	2011-11-02 14:48:55 UTC (rev 49048)
@@ -764,9 +764,17 @@
         else:
             try:
                 # Process results here
-                self.WriteCmdLog('(%s) %s (%d sec)' % (str(time.ctime()),
-                                                       _('Command finished'),
-                                                       (time.time() - event.time)))
+                ctime = time.time() - event.time
+                if ctime < 60:
+                    stime = _("%d sec") % int(ctime)
+                else:
+                    mtime = int(ctime / 60)
+                    stime = _("%d min %d sec") % (mtime, 
+                                                  int(ctime - (mtime * 60)))
+                
+                self.WriteCmdLog('(%s) %s (%s)' % (str(time.ctime()),
+                                                   _('Command finished'),
+                                                   (stime)))
             except KeyError:
                 # stopped deamon
                 pass



More information about the grass-commit mailing list