[GRASS-SVN] r72300 - grass/trunk/gui/wxpython/gmodeler
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Mar 2 12:52:36 PST 2018
Author: martinl
Date: 2018-03-02 12:52:36 -0800 (Fri, 02 Mar 2018)
New Revision: 72300
Modified:
grass/trunk/gui/wxpython/gmodeler/frame.py
Log:
wxGUI/gmodeler: print command finished message
Modified: grass/trunk/gui/wxpython/gmodeler/frame.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/frame.py 2018-03-02 16:52:06 UTC (rev 72299)
+++ grass/trunk/gui/wxpython/gmodeler/frame.py 2018-03-02 20:52:36 UTC (rev 72300)
@@ -289,7 +289,23 @@
def OnCmdDone(self, event):
"""Command done (or aborted)"""
self.goutput.GetProgressBar().SetValue(0)
+
try:
+ ctime = time.time() - event.time
+ if ctime < 60:
+ stime = _("%d sec") % int(ctime)
+ else:
+ mtime = int(ctime / 60)
+ stime = _("%(min)d min %(sec)d sec") % {
+ 'min': mtime, 'sec': int(ctime - (mtime * 60))}
+ except KeyError:
+ # stopped deamon
+ stime = _("unknown")
+
+ self.goutput.WriteCmdLog('({}) {} ({})'.format(str(time.ctime()), _("Command finished"), stime),
+ notification=event.notification)
+
+ try:
action = self.GetModel().GetItems()[event.pid]
if hasattr(action, "task"):
action.Update(running=True)
More information about the grass-commit
mailing list