From 995c59cb3e461af2c74d9a084705e5f7972bcbdb Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 22 Feb 2007 13:11:50 +0000 Subject: Make sugar-activity-factory just a wrapper. --- (limited to 'sugar/activity') 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() -- cgit v0.9.1