diff --git a/services/presence/sugar-presence-service b/services/presence/sugar-presence-service index 05dfdaaa..b2261b40 100755 --- a/services/presence/sugar-presence-service +++ b/services/presence/sugar-presence-service @@ -1,10 +1,16 @@ #!/usr/bin/python - import logging +import sys +import os + +from sugar import logger +from sugar import env + +sys.path.insert(0, env.get_services_dir()) + from presence import PresenceService -import sugar.logger -sugar.logger.start('presenceservice') +logger.start('presenceservice') logging.info('Starting presence service') diff --git a/sugar/__installed__.py.in b/sugar/__installed__.py.in index ff0a830d..d9cdfd54 100644 --- a/sugar/__installed__.py.in +++ b/sugar/__installed__.py.in @@ -4,6 +4,6 @@ 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/activities', - '@prefix@/share/sugar/services'] +sugar_python_path = ['@prefix@/share/sugar/activities'] + sugar_bin_path = [] diff --git a/sugar/__uninstalled__.py.in b/sugar/__uninstalled__.py.in index 869901df..c454a86b 100644 --- a/sugar/__uninstalled__.py.in +++ b/sugar/__uninstalled__.py.in @@ -3,17 +3,16 @@ import tempfile sugar_source_dir = os.path.dirname(os.path.dirname(__file__)) sugar_data_dir = os.path.join(sugar_source_dir, 'shell/data') +sugar_services_dir = os.path.join(sugar_source_dir, 'services') __tmpdir = os.path.join(tempfile.gettempdir(), 'sugar') sugar_activities_dir = __tmpdir -sugar_service_dir = __tmpdir sugar_dbus_config = os.path.join(sugar_source_dir, 'dbus-uninstalled.conf') sugar_python_path = [] sugar_python_path.append(sugar_source_dir) sugar_python_path.append(os.path.join(sugar_source_dir, 'activities')) -sugar_python_path.append(os.path.join(sugar_source_dir, 'services')) sugar_bin_path = [] sugar_bin_path.append(os.path.join(sugar_source_dir)) diff --git a/sugar/env.py b/sugar/env.py index a2dfa457..bd7a9191 100644 --- a/sugar/env.py +++ b/sugar/env.py @@ -75,5 +75,8 @@ def get_data_dir(): def get_activities_dir(): return sugar_activities_dir +def get_services_dir(): + return sugar_services_dir + def get_dbus_config(): return sugar_dbus_config