Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-12-18 12:47:49 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-12-18 12:47:49 (GMT)
commite0bd5d1df41f1d77ae8bd66c3c2a0ab9143595cb (patch)
treec5c86920fb8815fab68daaa1d3a394c590a8cc12 /sugar
parent09b096d4d0feb92e31a4e132a1f15ec3d66a3860 (diff)
Cleanup activity factory startup, remove duplicated argument from the Exec field
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/ActivityFactory.py16
-rw-r--r--sugar/env.py6
2 files changed, 19 insertions, 3 deletions
diff --git a/sugar/activity/ActivityFactory.py b/sugar/activity/ActivityFactory.py
index ee131ef..4acb9b6 100644
--- a/sugar/activity/ActivityFactory.py
+++ b/sugar/activity/ActivityFactory.py
@@ -15,6 +15,7 @@
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
+import os
import sys
import logging
@@ -25,6 +26,8 @@ import gtk
from sugar.presence.PresenceService import PresenceService
from sugar.activity import Activity
+from sugar.activity.bundle import Bundle
+from sugar import logger
def get_path(activity_name):
"""Returns the activity path"""
@@ -93,6 +96,13 @@ def create(activity_name):
return activity
-def register_factory(name, activity_class):
- """Register the activity factory."""
- factory = ActivityFactory(name, activity_class)
+def start_factory(activity_class, bundle_path):
+ """Start the activity factory."""
+ bundle = Bundle(bundle_path)
+
+ logger.start(bundle.get_name())
+
+ os.environ['SUGAR_BUNDLE_PATH'] = bundle_path
+ os.environ['SUGAR_BUNDLE_SERVICE_NAME'] = bundle.get_service_name()
+
+ factory = ActivityFactory(bundle.get_service_name(), activity_class)
diff --git a/sugar/env.py b/sugar/env.py
index 391c7cd..6b59ab5 100644
--- a/sugar/env.py
+++ b/sugar/env.py
@@ -24,6 +24,12 @@ try:
except ImportError:
from sugar.__installed__ import *
+def get_bundle_path():
+ if os.environ.has_key('SUGAR_BUNDLE_PATH'):
+ return os.environ['SUGAR_BUNDLE_PATH']
+ else:
+ return None
+
def get_profile_path():
if os.environ.has_key('SUGAR_PROFILE'):
profile_id = os.environ['SUGAR_PROFILE']