Rename activity service_name to bundle_id
This commit is contained in:
+16
-9
@@ -46,8 +46,11 @@ def create_activity_instance(constructor, handle):
|
||||
|
||||
activity_instances.append(activity)
|
||||
|
||||
def get_single_process_path(service_name):
|
||||
return '/' + service_name.replace('.', '/')
|
||||
def get_single_process_name(bundle_id):
|
||||
return bundle_id
|
||||
|
||||
def get_single_process_path(bundle_id):
|
||||
return '/' + bundle_id.replace('.', '/')
|
||||
|
||||
class SingleProcess(dbus.service.Object):
|
||||
def __init__(self, service_name, constructor):
|
||||
@@ -64,6 +67,8 @@ class SingleProcess(dbus.service.Object):
|
||||
create_activity_instance(self.constructor, handle)
|
||||
|
||||
parser = OptionParser()
|
||||
parser.add_option("-b", "--bundle-id", dest="bundle_id",
|
||||
help="identifier of the activity bundle")
|
||||
parser.add_option("-a", "--activity-id", dest="activity_id",
|
||||
help="identifier of the activity instance")
|
||||
parser.add_option("-o", "--object-id", dest="object_id",
|
||||
@@ -88,15 +93,15 @@ sys.path.append(bundle_path)
|
||||
|
||||
bundle = ActivityBundle(bundle_path)
|
||||
|
||||
logger.start(bundle.get_service_name())
|
||||
logger.start(bundle.get_bundle_id())
|
||||
|
||||
gettext.bindtextdomain(bundle.get_service_name(),
|
||||
gettext.bindtextdomain(bundle.get_bundle_id(),
|
||||
bundle.get_locale_path())
|
||||
gettext.textdomain(bundle.get_service_name())
|
||||
gettext.textdomain(bundle.get_bundle_id())
|
||||
|
||||
gtk.icon_theme_get_default().append_search_path(bundle.get_icons_path())
|
||||
|
||||
_sugarext.set_prgname(bundle.get_service_name())
|
||||
_sugarext.set_prgname(bundle.get_bundle_id())
|
||||
_sugarext.set_application_name(bundle.get_name())
|
||||
|
||||
splitted_module = args[0].rsplit('.', 1)
|
||||
@@ -116,7 +121,10 @@ handle = activityhandle.ActivityHandle(
|
||||
|
||||
if options.single_process is True:
|
||||
bus = dbus.SessionBus()
|
||||
service_name = bundle.get_service_name()
|
||||
|
||||
bundle_id = bundle.get_bundle_id()
|
||||
service_name = get_single_process_name(bundle_id)
|
||||
service_path = get_single_process_path(bundle_id)
|
||||
|
||||
bus_object = bus.get_object(
|
||||
'org.freedesktop.DBus', '/org/freedesktop/DBus')
|
||||
@@ -129,8 +137,7 @@ if options.single_process is True:
|
||||
if not name:
|
||||
service = SingleProcess(service_name, constructor)
|
||||
else:
|
||||
single_process = bus.get_object(
|
||||
service_name, get_single_process_path(service_name))
|
||||
single_process = bus.get_object(service_name, service_path)
|
||||
single_process.create(handle.get_dict())
|
||||
|
||||
print 'Created %s in a single process.' % service_name
|
||||
|
||||
Reference in New Issue
Block a user