Let activities extend their own path

This commit is contained in:
Marco Pesenti Gritti 2006-10-17 10:07:35 +02:00
parent 4b7b1586d2
commit 77f2de8f73
5 changed files with 11 additions and 4 deletions

View File

@ -74,7 +74,7 @@ class _ActivityRegistry:
def __init__(self):
self._activities = []
self.scan_directory(env.get_activities_dir())
self.scan_directory(env.get_activity_info_dir())
def get_activity(self, activity_id):
"""Returns an activity given his identifier"""

View File

@ -17,6 +17,9 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
import sys
import os
sys.path.insert(0, env.get_activities_dir())
from sugar.activity import ActivityFactory

View File

@ -1,6 +1,7 @@
sugar_source_dir = None
sugar_data_dir = '@prefix@/share/sugar'
sugar_activities_dir = '@prefix@/share/sugar/activities'
sugar_activity_info_dir = '@prefix@/share/sugar/activities'
sugar_services_dir = '@prefix@/share/sugar/services'
sugar_dbus_config = '@prefix@/share/sugar/dbus-installed.conf'

View File

@ -6,7 +6,7 @@ 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_activity_info_dir = __tmpdir
sugar_dbus_config = os.path.join(sugar_source_dir, 'dbus-uninstalled.conf')

View File

@ -47,12 +47,12 @@ def setup_system():
if sugar_source_dir:
source = os.path.join(sugar_source_dir, 'activities')
runner = os.path.join(sugar_source_dir, 'shell/sugar-activity-factory')
sugar.setup.setup_activities(source, sugar_activities_dir, runner)
sugar.setup.setup_activities(source, get_activity_info_dir(), runner)
bin = os.path.join(sugar_source_dir,
'services/presence/sugar-presence-service')
sugar.setup.write_service('org.laptop.Presence', bin,
sugar_activities_dir)
get_activity_info_dir())
def get_profile_path():
if os.environ.has_key('SUGAR_PROFILE'):
@ -75,6 +75,9 @@ def get_data_dir():
def get_activities_dir():
return sugar_activities_dir
def get_activity_info_dir():
return sugar_activity_info_dir
def get_services_dir():
return sugar_services_dir