[GRASS-SVN] r55232 - grass/trunk/gui/wxpython/core
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Feb 26 03:42:11 PST 2013
Author: turek
Date: 2013-02-26 03:42:11 -0800 (Tue, 26 Feb 2013)
New Revision: 55232
Modified:
grass/trunk/gui/wxpython/core/gconsole.py
Log:
gconsole: Only creation and sending of event belongs to condition.
Modified: grass/trunk/gui/wxpython/core/gconsole.py
===================================================================
--- grass/trunk/gui/wxpython/core/gconsole.py 2013-02-26 11:24:06 UTC (rev 55231)
+++ grass/trunk/gui/wxpython/core/gconsole.py 2013-02-26 11:42:11 UTC (rev 55232)
@@ -126,23 +126,21 @@
requestTime = time.time()
# prepare
- if not self.receiver:
- return
+ if self.receiver:
+ event = wxCmdPrepare(cmd=args[0],
+ time=requestTime,
+ pid=requestId,
+ onPrepare=vars()['onPrepare'],
+ userData=vars()['userData'])
- event = wxCmdPrepare(cmd=args[0],
- time=requestTime,
- pid=requestId,
- onPrepare=vars()['onPrepare'],
- userData=vars()['userData'])
+ wx.PostEvent(self.receiver, event)
- wx.PostEvent(self.receiver, event)
+ # run command
+ event = wxCmdRun(cmd=args[0],
+ pid=requestId)
- # run command
- event = wxCmdRun(cmd=args[0],
- pid=requestId)
+ wx.PostEvent(self.receiver, event)
- wx.PostEvent(self.receiver, event)
-
time.sleep(.1)
self.requestCmd = vars()['callable'](*args, **kwds)
if self._want_abort_all and self.requestCmd is not None:
@@ -192,20 +190,18 @@
self.requestCmdColor = vars()['callable'](*argsColor, **kwds)
self.resultQ.put((requestId, self.requestCmdColor.run()))
- if not self.receiver:
- return
+ if self.receiver:
+ event = wxCmdDone(cmd=args[0],
+ aborted=aborted,
+ returncode=returncode,
+ time=requestTime,
+ pid=requestId,
+ onDone=vars()['onDone'],
+ userData=vars()['userData'])
- event = wxCmdDone(cmd=args[0],
- aborted=aborted,
- returncode=returncode,
- time=requestTime,
- pid=requestId,
- onDone=vars()['onDone'],
- userData=vars()['userData'])
+ # send event
+ wx.PostEvent(self.receiver, event)
- # send event
- wx.PostEvent(self.receiver, event)
-
def abort(self, abortall=True):
"""!Abort command(s)"""
if abortall:
More information about the grass-commit
mailing list