mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2026-04-06 14:53:53 +00:00
edit processManager demo
This commit is contained in:
parent
2da9bfbe0c
commit
c4b9f54df6
2 changed files with 19 additions and 10 deletions
|
|
@ -32,6 +32,9 @@ class ProcessManager:
|
|||
self._processHandle = None
|
||||
self._textMode = textMode
|
||||
|
||||
def __del__(self):
|
||||
self.stop()
|
||||
|
||||
def addArgument(self, arg):
|
||||
"""!add a new argument
|
||||
|
||||
|
|
@ -44,7 +47,7 @@ class ProcessManager:
|
|||
"""!clear all arguments"""
|
||||
self._args = self._args[0:1] # kept first element (process name)
|
||||
|
||||
def start(self, startAsShell=False):
|
||||
def start(self):
|
||||
"""!start the new process
|
||||
|
||||
@return: True or False"""
|
||||
|
|
@ -55,7 +58,7 @@ class ProcessManager:
|
|||
stdout=self._stdout,
|
||||
stderr=self._stderr,
|
||||
universal_newlines=self._textMode,
|
||||
shell=startAsShell)
|
||||
shell=False)
|
||||
if not self.isRunning:
|
||||
logging.error("cannot start")
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue