2006-10-15 01:08:44 +02:00
|
|
|
# Copyright (C) 2006, Red Hat, Inc.
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the
|
|
|
|
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
# Boston, MA 02111-1307, USA.
|
|
|
|
|
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._command = command
|
|
|
|
|
|
|
|
def get_name(self):
|
|
|
|
return self._command
|
|
|
|
|
2006-07-12 22:24:49 +02:00
|
|
|
def start(self, standard_output=False):
|
2006-07-12 14:02:29 +02:00
|
|
|
args = self._command.split()
|
2006-07-12 22:17:57 +02:00
|
|
|
flags = gobject.SPAWN_SEARCH_PATH
|
2006-07-12 22:24:49 +02:00
|
|
|
result = gobject.spawn_async(args, flags=flags,
|
|
|
|
standard_output=standard_output)
|
|
|
|
self._stdout = result[2]
|