It's not necessary to pass the default_type around anymore.
This commit is contained in:
parent
7e85c5160e
commit
7db5479c5c
@ -24,9 +24,6 @@ theme.setup()
|
|||||||
#lw = LogWriter(sys.argv[1])
|
#lw = LogWriter(sys.argv[1])
|
||||||
#lw.start()
|
#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()
|
gtk.main()
|
||||||
|
@ -19,9 +19,7 @@ def _get_factory(activity_name):
|
|||||||
class ActivityFactory(dbus.service.Object):
|
class ActivityFactory(dbus.service.Object):
|
||||||
"""Dbus service that takes care of creating new instances of an activity"""
|
"""Dbus service that takes care of creating new instances of an activity"""
|
||||||
|
|
||||||
def __init__(self, name, activity_class, default_type):
|
def __init__(self, name, activity_class):
|
||||||
self._default_type = default_type
|
|
||||||
|
|
||||||
splitted_module = activity_class.rsplit('.', 1)
|
splitted_module = activity_class.rsplit('.', 1)
|
||||||
module_name = splitted_module[0]
|
module_name = splitted_module[0]
|
||||||
class_name = splitted_module[1]
|
class_name = splitted_module[1]
|
||||||
@ -40,7 +38,6 @@ class ActivityFactory(dbus.service.Object):
|
|||||||
@dbus.service.method("com.redhat.Sugar.ActivityFactory")
|
@dbus.service.method("com.redhat.Sugar.ActivityFactory")
|
||||||
def create(self):
|
def create(self):
|
||||||
activity = self._class()
|
activity = self._class()
|
||||||
activity.set_default_type(self._default_type)
|
|
||||||
return activity.get_object_path()
|
return activity.get_object_path()
|
||||||
|
|
||||||
def create(activity_name):
|
def create(activity_name):
|
||||||
@ -61,6 +58,6 @@ def create(activity_name):
|
|||||||
|
|
||||||
return activity
|
return activity
|
||||||
|
|
||||||
def register_factory(name, activity_class, default_type=None):
|
def register_factory(name, activity_class):
|
||||||
"""Register the activity factory."""
|
"""Register the activity factory."""
|
||||||
factory = ActivityFactory(name, activity_class, default_type)
|
factory = ActivityFactory(name, activity_class)
|
||||||
|
Loading…
Reference in New Issue
Block a user