From 7db5479c5c5c9ec6cafb52a60276d80caa6f9fce Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 9 Aug 2006 13:01:47 +0200 Subject: [PATCH] It's not necessary to pass the default_type around anymore. --- shell/sugar-activity-factory | 5 +---- sugar/activity/ActivityFactory.py | 9 +++------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/shell/sugar-activity-factory b/shell/sugar-activity-factory index 2ec6bb3d..ba0e38a6 100755 --- a/shell/sugar-activity-factory +++ b/shell/sugar-activity-factory @@ -24,9 +24,6 @@ theme.setup() #lw = LogWriter(sys.argv[1]) #lw.start() -if len(sys.argv) == 4: - ActivityFactory.register_factory(sys.argv[1], sys.argv[2], sys.argv[3]) -else: - ActivityFactory.register_factory(sys.argv[1], sys.argv[2]) +ActivityFactory.register_factory(sys.argv[1], sys.argv[2]) gtk.main() diff --git a/sugar/activity/ActivityFactory.py b/sugar/activity/ActivityFactory.py index 3d11e34d..e6cac082 100644 --- a/sugar/activity/ActivityFactory.py +++ b/sugar/activity/ActivityFactory.py @@ -19,9 +19,7 @@ def _get_factory(activity_name): class ActivityFactory(dbus.service.Object): """Dbus service that takes care of creating new instances of an activity""" - def __init__(self, name, activity_class, default_type): - self._default_type = default_type - + def __init__(self, name, activity_class): splitted_module = activity_class.rsplit('.', 1) module_name = splitted_module[0] class_name = splitted_module[1] @@ -40,7 +38,6 @@ class ActivityFactory(dbus.service.Object): @dbus.service.method("com.redhat.Sugar.ActivityFactory") def create(self): activity = self._class() - activity.set_default_type(self._default_type) return activity.get_object_path() def create(activity_name): @@ -61,6 +58,6 @@ def create(activity_name): return activity -def register_factory(name, activity_class, default_type=None): +def register_factory(name, activity_class): """Register the activity factory.""" - factory = ActivityFactory(name, activity_class, default_type) + factory = ActivityFactory(name, activity_class)