Reuse the spawn code
This commit is contained in:
parent
2bbedf988b
commit
02c697d862
@ -11,7 +11,9 @@ class Process:
|
||||
def get_name(self):
|
||||
return self._command
|
||||
|
||||
def start(self):
|
||||
def start(self, standard_output=False):
|
||||
args = self._command.split()
|
||||
flags = gobject.SPAWN_SEARCH_PATH
|
||||
result = gobject.spawn_async(args, flags=flags)
|
||||
result = gobject.spawn_async(args, flags=flags,
|
||||
standard_output=standard_output)
|
||||
self._stdout = result[2]
|
||||
|
@ -22,12 +22,7 @@ class DbusProcess(Process):
|
||||
return 'Dbus'
|
||||
|
||||
def start(self):
|
||||
args = self._command.split()
|
||||
flags = gobject.SPAWN_SEARCH_PATH
|
||||
result = gobject.spawn_async(args, flags=flags, standard_output=True,
|
||||
standard_error=True)
|
||||
self._stdout = result[2]
|
||||
|
||||
Process.start(self, True)
|
||||
dbus_file = os.fdopen(self._stdout)
|
||||
addr = dbus_file.readline()
|
||||
addr = addr.strip()
|
||||
|
Loading…
Reference in New Issue
Block a user