Let activities extend their own path
This commit is contained in:
parent
4b7b1586d2
commit
77f2de8f73
@ -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"""
|
||||
|
@ -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
|
||||
|
||||
|
@ -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'
|
||||
|
||||
|
@ -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')
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user