Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-10-31 12:10:34 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-10-31 12:10:34 (GMT)
commit85719207344f324918fdb87df3669c2f3e86a7bb (patch)
treed27f03f9c4bf511d64fd963c7e3d1ed0c07b6021
parentcb285aba06dea2c2155522f5eeb74a793d96868c (diff)
Tweak activity search path. Use ~/Activities and XDG_DATA_DIRS/activities
-rw-r--r--shell/model/ShellModel.py12
-rw-r--r--sugar/activity/bundleregistry.py1
-rw-r--r--sugar/env.py3
3 files changed, 10 insertions, 6 deletions
diff --git a/shell/model/ShellModel.py b/shell/model/ShellModel.py
index 350666d..e87dc12 100644
--- a/shell/model/ShellModel.py
+++ b/shell/model/ShellModel.py
@@ -14,9 +14,10 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+import os
+
from sugar.presence import PresenceService
from sugar.activity.bundleregistry import BundleRegistry
-from sugar import env
from model.Friends import Friends
from model.MeshModel import MeshModel
from model.Owner import ShellOwner
@@ -35,7 +36,14 @@ class ShellModel:
self._mesh = MeshModel()
self._bundle_registry = BundleRegistry()
- self._bundle_registry.add_search_path(env.get_bundles_path())
+
+ path = os.path.expanduser('~/Activities')
+ self._bundle_registry.add_search_path(path)
+
+ if os.environ.has_key('XDG_DATA_DIRS'):
+ for path in os.environ['XDG_DATA_DIRS'].split(':'):
+ bundles_path = os.path.join(path, 'activities')
+ self._bundle_registry.add_search_path(bundles_path)
def get_bundle_registry(self):
return self._bundle_registry
diff --git a/sugar/activity/bundleregistry.py b/sugar/activity/bundleregistry.py
index 1d563e8..582c340 100644
--- a/sugar/activity/bundleregistry.py
+++ b/sugar/activity/bundleregistry.py
@@ -70,7 +70,6 @@ class BundleRegistry:
def _add_bundle(self, bundle_path):
bundle = Bundle(bundle_path)
- print bundle
if bundle.is_valid():
self._bundles[bundle.get_service_name()] = bundle
self._service_manager.add(bundle)
diff --git a/sugar/env.py b/sugar/env.py
index bbe53be..f776865 100644
--- a/sugar/env.py
+++ b/sugar/env.py
@@ -54,8 +54,5 @@ def get_services_dir():
def get_dbus_config():
return sugar_dbus_config
-def get_bundles_path():
- return os.path.join(get_profile_path(), 'bundles')
-
def get_shell_bin_dir():
return sugar_shell_bin_dir