| |
Methods defined here:
- runInBackground(self, pollInterval=0.1)
- runInBackground - Create a background thread which will manage this process, automatically read from streams, and perform any cleanups
The object returned is a "BackgroundTaskInfo" object, and represents the state of the process. It is updated automatically as the program runs,
and if stdout or stderr are streams, they are automatically read from and populated into this object.
@see BackgroundTaskInfo for more info or
@param pollInterval - Amount of idle time between polling
- wait(self)
- Wait for child process to terminate. Returns returncode
attribute.
- waitOrTerminate(self, timeoutSeconds, pollInterval=0.05, terminateToKillSeconds=1.5)
- waitOrTerminate - Wait up to a certain number of seconds for the process to end.
If the process is running after the timeout has been exceeded, a SIGTERM will be sent.
Optionally, an additional SIGKILL can be sent after some configurable interval. See #terminateToKillSeconds doc below
@param timeoutSeconds <float> - Number of seconds to wait
@param pollInterval <float> (default .05)- Number of seconds between each poll
@param terminateToKillSeconds <float/None> (default 1.5) - If application does not end before #timeoutSeconds , terminate() will be called.
* If this is set to None, an additional #pollInterval sleep will occur after calling .terminate, to allow the application to cleanup. returnCode will be return of app if finished, or None if did not complete.
* If this is set to 0, no terminate signal will be sent, but directly to kill. Because the application cannot trap this, returnCode will be None.
* If this is set to > 0, that number of seconds maximum will be given between .terminate and .kill. If the application does not terminate before KILL, returnCode will be None.
Windows Note -- On windows SIGTERM and SIGKILL are the same thing.
@return dict { 'returnCode' : <int or None> , 'actionTaken' : <int mask of SUBPROCESS2_PROCESS_*> }
Returns a dict representing results:
"returnCode" matches return of application, or None per #terminateToKillSeconds doc above.
"actionTaken" is a mask of the SUBPROCESS2_PROCESS_* variables. If app completed normally, it will be SUBPROCESS2_PROCESS_COMPLETED, otherwise some mask of SUBPROCESS2_PROCESS_TERMINATED and/or SUBPROCESS2_PROCESS_KILLED
- waitUpTo(self, timeoutSeconds, pollInterval=0.05)
- Popen.waitUpTo - Wait up to a certain number of seconds for the process to end.
@param timeoutSeconds <float> - Number of seconds to wait
@param pollInterval <float> (default .05) - Number of seconds in between each poll
@return - Returncode of application, or None if did not terminate.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|