[GRASS-SVN] r52485 - grass/trunk/gui/wxpython/gui_core
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jul 31 09:04:28 PDT 2012
Author: martinl
Date: 2012-07-31 09:04:27 -0700 (Tue, 31 Jul 2012)
New Revision: 52485
Modified:
grass/trunk/gui/wxpython/gui_core/goutput.py
Log:
wxGUI: CmdThread - parameters requestQ, resultQ optional
Modified: grass/trunk/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/goutput.py 2012-07-31 11:08:29 UTC (rev 52484)
+++ grass/trunk/gui/wxpython/gui_core/goutput.py 2012-07-31 16:04:27 UTC (rev 52485)
@@ -62,20 +62,34 @@
class CmdThread(threading.Thread):
"""!Thread for GRASS commands"""
requestId = 0
- def __init__(self, parent, requestQ, resultQ, **kwds):
+ def __init__(self, parent, requestQ = None, resultQ = None, **kwds):
threading.Thread.__init__(self, **kwds)
-
+
+ if requestQ is None:
+ self.requestQ = Queue.Queue()
+ else:
+ self.requestQ = requestQ
+
+ if resultQ is None:
+ self.resultQ = Queue.Queue()
+ else:
+ self.resultQ = resultQ
+
self.setDaemon(True)
-
+
self.parent = parent # GMConsole
self._want_abort_all = False
- self.requestQ = requestQ
- self.resultQ = resultQ
-
self.start()
def RunCmd(self, *args, **kwds):
+ """!Run command in queue
+
+ @param args unnamed command arguments
+ @param kwds named command arguments
+
+ @return request id in queue
+ """
CmdThread.requestId += 1
self.requestCmd = None
More information about the grass-commit
mailing list