Install service files for the presence service
This commit is contained in:
parent
e57f4da027
commit
e2e5bc0000
1
.gitignore
vendored
1
.gitignore
vendored
@ -34,3 +34,4 @@ po/sugar.pot
|
||||
po/*.gmo
|
||||
sugar/__installed__.py
|
||||
tools/sugar-setup-activity
|
||||
shell/PresenceService/org.laptop.Presence.service
|
||||
|
@ -1,3 +1,10 @@
|
||||
servicedir = $(datadir)/dbus-1/services
|
||||
service_in_files = org.laptop.Presence.service.in
|
||||
service_DATA = $(service_in_files:.service.in=.service)
|
||||
|
||||
$(service_DATA): $(service_in_files) Makefile
|
||||
@sed -e "s|\@bindir\@|$(bindir)|" $< > $@
|
||||
|
||||
sugardir = $(pkgdatadir)/shell/PresenceService
|
||||
sugar_PYTHON = \
|
||||
__init__.py \
|
||||
|
4
shell/PresenceService/org.laptop.Presence.service.in
Normal file
4
shell/PresenceService/org.laptop.Presence.service.in
Normal file
@ -0,0 +1,4 @@
|
||||
[D-BUS Service]
|
||||
Name = org.laptop.Presence
|
||||
Exec = @bindir@/sugar-presence-service
|
||||
|
@ -44,22 +44,6 @@ class MatchboxProcess(Process):
|
||||
def get_name(self):
|
||||
return 'Matchbox'
|
||||
|
||||
class PresenceServiceProcess(Process):
|
||||
def __init__(self):
|
||||
Process.__init__(self, "sugar-presence-service")
|
||||
|
||||
def get_name(self):
|
||||
return "PresenceService"
|
||||
|
||||
def start(self):
|
||||
Process.start(self)
|
||||
bus = dbus.Bus()
|
||||
ret = False
|
||||
# Wait for the presence service to start up
|
||||
while not ret:
|
||||
ret = dbus.dbus_bindings.bus_name_has_owner(bus._connection, PresenceService.DBUS_SERVICE)
|
||||
time.sleep(0.2)
|
||||
|
||||
class Session:
|
||||
"""Takes care of running the shell and all the sugar processes"""
|
||||
def __init__(self, registry):
|
||||
@ -76,9 +60,6 @@ class Session:
|
||||
process = MatchboxProcess()
|
||||
process.start()
|
||||
|
||||
process = PresenceServiceProcess()
|
||||
process.start()
|
||||
|
||||
shell = Shell(self._registry)
|
||||
shell.set_console(console)
|
||||
shell.start()
|
||||
|
@ -1,6 +1,7 @@
|
||||
sugar_source_dir = None
|
||||
sugar_data_dir = '@prefix@/share/sugar'
|
||||
sugar_activities_dir = '@prefix@/share/sugar/activities'
|
||||
sugar_services_dir = '@prefix@/share/sugar/services'
|
||||
sugar_dbus_config = '@prefix@/share/sugar/dbus-installed.conf'
|
||||
|
||||
sugar_python_path = ['@prefix@/share/sugar/shell',
|
||||
|
@ -2,9 +2,12 @@ import os
|
||||
import tempfile
|
||||
|
||||
sugar_source_dir = os.path.dirname(os.path.dirname(__file__))
|
||||
sugar_data_dir = os.path.join(sugar_source_dir, 'shell/data')
|
||||
|
||||
__tmpdir = os.path.join(tempfile.gettempdir(), 'sugar')
|
||||
sugar_activities_dir = __tmpdir
|
||||
sugar_service_dir = __tmpdir
|
||||
|
||||
sugar_data_dir = os.path.join(sugar_source_dir, 'shell/data')
|
||||
sugar_activities_dir = os.path.join(tempfile.gettempdir(), 'sugar')
|
||||
sugar_dbus_config = os.path.join(sugar_source_dir, 'dbus-uninstalled.conf')
|
||||
|
||||
sugar_python_path = []
|
||||
|
@ -34,6 +34,10 @@ def setup():
|
||||
source = os.path.join(sugar_source_dir, 'activities')
|
||||
runner = os.path.join(sugar_source_dir, 'shell/sugar-activity-factory')
|
||||
sugar.setup.setup_activities(source, get_activities_dir(), runner)
|
||||
|
||||
bin = os.path.join(sugar_source_dir, 'shell/sugar-presence-service')
|
||||
sugar.setup.write_service('org.laptop.Presence', bin,
|
||||
get_services_dir())
|
||||
|
||||
def get_user_dir():
|
||||
if os.environ.has_key('SUGAR_NICK_NAME'):
|
||||
@ -59,3 +63,6 @@ def get_data_file(filename):
|
||||
|
||||
def get_activities_dir():
|
||||
return sugar_activities_dir
|
||||
|
||||
def get_services_dir():
|
||||
return sugar_activities_dir
|
||||
|
Loading…
Reference in New Issue
Block a user