Make part of the session public so that it can used by tests
parent
f4f70d22f1
commit
47cc58b1e6
@ -1,45 +1,17 @@
|
||||
import os
|
||||
import gtk
|
||||
import gobject
|
||||
import time
|
||||
import re
|
||||
|
||||
from Shell import Shell
|
||||
from ConsoleWindow import ConsoleWindow
|
||||
from session.Process import Process
|
||||
from FirstTimeDialog import FirstTimeDialog
|
||||
from sugar import env
|
||||
from sugar import logger
|
||||
import conf
|
||||
|
||||
class DbusProcess(Process):
|
||||
def __init__(self):
|
||||
config = env.get_dbus_config()
|
||||
cmd = "dbus-daemon --print-address --config-file %s" % config
|
||||
Process.__init__(self, cmd)
|
||||
|
||||
def get_name(self):
|
||||
return 'Dbus'
|
||||
|
||||
def start(self):
|
||||
Process.start(self, True)
|
||||
dbus_file = os.fdopen(self._stdout)
|
||||
addr = dbus_file.readline().strip()
|
||||
dbus_file.close()
|
||||
os.environ["DBUS_SESSION_BUS_ADDRESS"] = addr
|
||||
|
||||
class MatchboxProcess(Process):
|
||||
def __init__(self):
|
||||
kbd_config = os.path.join(env.get_data_dir(), 'kbdconfig')
|
||||
options = '-kbdconfig %s ' % kbd_config
|
||||
|
||||
options += '-theme olpc '
|
||||
from sugar.session.Process import Process
|
||||
from sugar.session.DbusProcess import DbusProcess
|
||||
from sugar.session.MatchboxProcess import MatchboxProcess
|
||||
|
||||
command = 'matchbox-window-manager %s ' % options
|
||||
Process.__init__(self, command)
|
||||
|
||||
def get_name(self):
|
||||
return 'Matchbox'
|
||||
from FirstTimeDialog import FirstTimeDialog
|
||||
import conf
|
||||
|
||||
class DBusMonitorProcess(Process):
|
||||
def __init__(self):
|
@ -1,6 +0,0 @@
|
||||
sugardir = $(pkgdatadir)/shell/session
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
Emulator.py \
|
||||
Process.py \
|
||||
Session.py
|
@ -1,14 +1,13 @@
|
||||
SUBDIRS = activity canvas chat p2p presence
|
||||
SUBDIRS = activity canvas chat p2p presence session
|
||||
|
||||
sugardir = $(pythondir)/sugar
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
__installed__.py \
|
||||
bots.py \
|
||||
env.py \
|
||||
logger.py \
|
||||
setup.py \
|
||||
TracebackUtils.py \
|
||||
TracebackUtils.py \
|
||||
util.py
|
||||
|
||||
EXTRA_DIST = __uninstalled__.py
|
||||
|
@ -0,0 +1,20 @@
|
||||
import os
|
||||
|
||||
from sugar.session.Process import Process
|
||||
from sugar import env
|
||||
|
||||
class DbusProcess(Process):
|
||||
def __init__(self):
|
||||
config = env.get_dbus_config()
|
||||
cmd = "dbus-daemon --print-address --config-file %s" % config
|
||||
Process.__init__(self, cmd)
|
||||
|
||||
def get_name(self):
|
||||
return 'Dbus'
|
||||
|
||||
def start(self):
|
||||
Process.start(self, True)
|
||||
dbus_file = os.fdopen(self._stdout)
|
||||
addr = dbus_file.readline().strip()
|
||||
dbus_file.close()
|
||||
os.environ["DBUS_SESSION_BUS_ADDRESS"] = addr
|
@ -0,0 +1,7 @@
|
||||
sugardir = $(pythondir)/sugar/session
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
DbusProcess.py \
|
||||
Emulator.py \
|
||||
MatchboxProcess.py \
|
||||
Process.py
|
@ -0,0 +1,17 @@
|
||||
import os
|
||||
|
||||
from sugar.session.Process import Process
|
||||
from sugar import env
|
||||
|
||||
class MatchboxProcess(Process):
|
||||
def __init__(self):
|
||||
kbd_config = os.path.join(env.get_data_dir(), 'kbdconfig')
|
||||
options = '-kbdconfig %s ' % kbd_config
|
||||
|
||||
options += '-theme olpc '
|
||||
|
||||
command = 'matchbox-window-manager %s ' % options
|
||||
Process.__init__(self, command)
|
||||
|
||||
def get_name(self):
|
||||
return 'Matchbox'
|
Loading…
Reference in New Issue