diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-22 13:11:50 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-02-22 13:11:50 (GMT) |
commit | 995c59cb3e461af2c74d9a084705e5f7972bcbdb (patch) | |
tree | dbc97ba08d70a02e103cccd1119ad4933c541222 /sugar/activity | |
parent | 1b5ac988d786199a2ec2732775e8acd67833458d (diff) |
Make sugar-activity-factory just a wrapper.
Diffstat (limited to 'sugar/activity')
-rw-r--r-- | sugar/activity/activityfactoryservice.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/sugar/activity/activityfactoryservice.py b/sugar/activity/activityfactoryservice.py index 82fae4a..303d199 100644 --- a/sugar/activity/activityfactoryservice.py +++ b/sugar/activity/activityfactoryservice.py @@ -16,16 +16,24 @@ # Boston, MA 02111-1307, USA. import os +import sys +import gobject +import gtk import dbus import dbus.service +import dbus.glib from sugar.activity.bundle import Bundle from sugar.activity import activityhandle from sugar import logger +# Work around for dbus mutex locking issue +gobject.threads_init() +dbus.glib.threads_init() + class ActivityFactoryService(dbus.service.Object): - """Dbus service that takes care of creating new instances of an activity""" + """D-Bus service that creates new instances of an activity""" def __init__(self, service_name, activity_class): self._activities = [] @@ -67,15 +75,17 @@ class ActivityFactoryService(dbus.service.Object): if len(self._activities) == 0: gtk.main_quit() -def start(activity_class, bundle_path): +def run(args): """Start the activity factory.""" - bundle = Bundle(bundle_path) + sys.path.insert(0, args[2]) + + bundle = Bundle(args[2]) logger.start(bundle.get_name()) - os.environ['SUGAR_BUNDLE_PATH'] = bundle_path + os.environ['SUGAR_BUNDLE_PATH'] = args[2] os.environ['SUGAR_BUNDLE_SERVICE_NAME'] = bundle.get_service_name() os.environ['SUGAR_BUNDLE_DEFAULT_TYPE'] = bundle.get_default_type() - factory = ActivityFactoryService(bundle.get_service_name(), - activity_class) + factory = ActivityFactoryService(bundle.get_service_name(), args[1]) + gtk.main() |