diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-10-09 11:15:06 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-10-09 11:15:06 (GMT) |
commit | 6073a396b36c7d3da15ee361b601e94b010c6e92 (patch) | |
tree | e862e652c460ab193c558535f86316c687ff140c /sugar/activity | |
parent | 57961d17bcb41d6606ea3c5293473b49da705d3c (diff) |
Rename activity service_name to bundle_id
Diffstat (limited to 'sugar/activity')
-rw-r--r-- | sugar/activity/activity.py | 6 | ||||
-rw-r--r-- | sugar/activity/activityfactory.py | 4 | ||||
-rw-r--r-- | sugar/activity/bundlebuilder.py | 8 | ||||
-rw-r--r-- | sugar/activity/registry.py | 6 |
4 files changed, 13 insertions, 11 deletions
diff --git a/sugar/activity/activity.py b/sugar/activity/activity.py index ca71110..a7ae905 100644 --- a/sugar/activity/activity.py +++ b/sugar/activity/activity.py @@ -299,7 +299,7 @@ class Activity(Window, gtk.Container): self._jobject.metadata['title'] = _('%s Activity') % get_bundle_name() self.set_title(self._jobject.metadata['title']) self._jobject.metadata['title_set_by_user'] = '0' - self._jobject.metadata['activity'] = self.get_service_name() + self._jobject.metadata['activity'] = self.get_bundle_id() self._jobject.metadata['activity_id'] = self.get_id() self._jobject.metadata['keep'] = '0' self._jobject.metadata['preview'] = '' @@ -362,7 +362,7 @@ class Activity(Window, gtk.Container): def get_id(self): return self._activity_id - def get_service_name(self): + def get_bundle_id(self): return _sugarext.get_prgname() def set_canvas(self, canvas): @@ -594,7 +594,7 @@ class Activity(Window, gtk.Container): self._pservice.share_activity(self, private=private) def _realize_cb(self, window): - wm.set_bundle_id(window.window, self.get_service_name()) + wm.set_bundle_id(window.window, self.get_bundle_id()) wm.set_activity_id(window.window, self._activity_id) def _delete_event_cb(self, window, event): diff --git a/sugar/activity/activityfactory.py b/sugar/activity/activityfactory.py index 6554755..d5936e9 100644 --- a/sugar/activity/activityfactory.py +++ b/sugar/activity/activityfactory.py @@ -158,6 +158,7 @@ class ActivityCreationHandler(gobject.GObject): env['PATH'] = bin_path + ':' + env['PATH'] command = activity.command + command += ' -b %s' % activity.bundle_id if self._handle.activity_id is not None: command += ' -a %s' % self._handle.activity_id if self._handle.object_id is not None: @@ -165,7 +166,8 @@ class ActivityCreationHandler(gobject.GObject): if self._handle.uri is not None: command += ' -u %s' % self._handle.uri - process = subprocess.Popen(command, env=env, shell=True) + process = subprocess.Popen(command, env=env, shell=True, + cwd=activity.path) else: system_bus = dbus.SystemBus() factory = system_bus.get_object(_RAINBOW_SERVICE_NAME, diff --git a/sugar/activity/bundlebuilder.py b/sugar/activity/bundlebuilder.py index a1f6c4b..c2e3278 100644 --- a/sugar/activity/bundlebuilder.py +++ b/sugar/activity/bundlebuilder.py @@ -107,9 +107,9 @@ def _delete_backups(arg, dirname, names): if name.endswith('~') or name.endswith('pyc'): os.remove(os.path.join(dirname, name)) -def _get_service_name(): +def _get_bundle_id(): bundle = ActivityBundle(_get_source_path()) - return bundle.get_service_name() + return bundle.get_bundle_id() def cmd_help(): print 'Usage: \n\ @@ -162,7 +162,7 @@ def _get_l10n_list(manifest): l10n_list = [] for lang in _get_po_list(manifest).keys(): - filename = _get_service_name() + '.mo' + filename = _get_bundle_id() + '.mo' l10n_list.append(os.path.join('locale', lang, 'LC_MESSAGES', filename)) l10n_list.append(os.path.join('locale', lang, 'activity.linfo')) @@ -256,7 +256,7 @@ def cmd_genl10n(bundle_name, manifest): if not os.path.isdir(mo_path): os.makedirs(mo_path) - mo_file = os.path.join(mo_path, "%s.mo" % _get_service_name()) + mo_file = os.path.join(mo_path, "%s.mo" % _get_bundle_id()) args = ["msgfmt", "--output-file=%s" % mo_file, file_name] retcode = subprocess.call(args) if retcode: diff --git a/sugar/activity/registry.py b/sugar/activity/registry.py index b873821..a279aa9 100644 --- a/sugar/activity/registry.py +++ b/sugar/activity/registry.py @@ -29,15 +29,15 @@ def _activity_info_from_dict(info_dict): if not info_dict: return None return ActivityInfo(info_dict['name'], info_dict['icon'], - info_dict['service_name'], info_dict['path'], + info_dict['bundle_id'], info_dict['path'], info_dict['show_launcher'], info_dict['command']) class ActivityInfo(object): - def __init__(self, name, icon, service_name, + def __init__(self, name, icon, bundle_id, path, show_launcher, command): self.name = name self.icon = icon - self.service_name = service_name + self.bundle_id = bundle_id self.path = path self.command = command self.show_launcher = show_launcher |