From 3aa099509676d795873668948f3b4646aab9419a Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 3 Jun 2010 08:56:42 +0200 Subject: [PATCH] Bundelbuilder should not use localized activity name #1968 (Walter Bender) The localized activity name is only used for user-facing strings. The .xo and .tar files are left in the original name. --- src/sugar/activity/bundlebuilder.py | 2 +- src/sugar/bundle/activitybundle.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py index 868ca3dd..fc8ebc83 100644 --- a/src/sugar/activity/bundlebuilder.py +++ b/src/sugar/activity/bundlebuilder.py @@ -82,7 +82,7 @@ class Config(object): def update(self): self.bundle = bundle = ActivityBundle(self.source_dir) self.version = bundle.get_activity_version() - self.activity_name = bundle.get_name() + self.activity_name = bundle.get_bundle_name() self.bundle_id = bundle.get_bundle_id() self.bundle_name = reduce(lambda x, y: x+y, self.activity_name.split()) self.bundle_root_dir = self.bundle_name + '.activity' diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py index a1f10b9f..c83257f0 100644 --- a/src/sugar/bundle/activitybundle.py +++ b/src/sugar/bundle/activitybundle.py @@ -51,6 +51,7 @@ class ActivityBundle(Bundle): self.bundle_exec = None self._name = None + self._local_name = None self._icon = None self._bundle_id = None self._mime_types = None @@ -69,6 +70,9 @@ class ActivityBundle(Bundle): if linfo_file: self._parse_linfo(linfo_file) + if self._local_name == None: + self._local_name = self._name + def _get_manifest(self): if self._manifest is None: self._manifest = self._read_manifest() @@ -217,7 +221,7 @@ class ActivityBundle(Bundle): section = 'Activity' if cp.has_option(section, 'name'): - self._name = cp.get(section, 'name') + self._local_name = cp.get(section, 'name') if cp.has_option(section, 'tags'): tag_list = cp.get(section, 'tags').strip(';') @@ -240,7 +244,11 @@ class ActivityBundle(Bundle): return self._path def get_name(self): - """Get the activity user visible name.""" + """Get the activity user-visible name.""" + return self._local_name + + def get_bundle_name(self): + """Get the activity bundle name.""" return self._name def get_installation_time(self):