sugar-toolkit-gtk3/shell/Process.py

24 lines
540 B
Python
Raw Normal View History

2006-07-12 17:21:22 +02:00
import logging
2006-07-12 14:02:29 +02:00
import gobject
class Process:
2006-07-12 17:21:22 +02:00
"""Object representing one of the session processes"""
2006-07-12 14:02:29 +02:00
def __init__(self, command):
self._pid = None
self._command = command
def get_name(self):
return self._command
def start(self):
2006-07-12 17:21:22 +02:00
print self._command
logging.debug('Start %s' % (self._command))
2006-07-12 14:02:29 +02:00
args = self._command.split()
flags = gobject.SPAWN_SEARCH_PATH or gobject.SPAWN_STDERR_TO_DEV_NULL
result = gobject.spawn_async(args, flags=flags, standard_output=True)
self._pid = result[0]
self._stdout = result[2]