瀏覽代碼

wxGUI/gmodeler: print command finished message

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@72300 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 7 年之前
父節點
當前提交
7cce8e07f6
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      gui/wxpython/gmodeler/frame.py

+ 16 - 0
gui/wxpython/gmodeler/frame.py

@@ -289,6 +289,22 @@ class ModelFrame(wx.Frame):
     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"):