[GRASS-SVN] r49050 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Nov 2 11:11:19 EDT 2011


Author: martinl
Date: 2011-11-02 08:11:19 -0700 (Wed, 02 Nov 2011)
New Revision: 49050

Modified:
   grass/trunk/gui/wxpython/gui_modules/goutput.py
Log:
wxGUI: improve time formatting (when command finished)
       (merge r49048 from devbr6)


Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-11-02 15:10:50 UTC (rev 49049)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py	2011-11-02 15:11:19 UTC (rev 49050)
@@ -776,9 +776,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