Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorTomeu Vizoso <tomeu@tomeuvizoso.net>2007-03-25 09:42:26 (GMT)
committer Tomeu Vizoso <tomeu@tomeuvizoso.net>2007-03-25 09:42:26 (GMT)
commit318439ab274a3f920f0e7a267d07f2613e635e35 (patch)
tree3c1ef6b402db02b79b935b0f630741dcf21cf25a /sugar
parent01edb130c178d8901c4e7f0af583f662c097e7b4 (diff)
Fix for #1157. Thanks to leejc.
Diffstat (limited to 'sugar')
-rw-r--r--sugar/activity/bundlebuilder.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/sugar/activity/bundlebuilder.py b/sugar/activity/bundlebuilder.py
index 49c9389..c6ae593 100644
--- a/sugar/activity/bundlebuilder.py
+++ b/sugar/activity/bundlebuilder.py
@@ -143,6 +143,18 @@ def _get_file_list(manifest):
else:
return _DefaultFileList()
+def _include_mo_in_bundle(bundle_zip):
+ for langdir in os.listdir('locale'):
+ if os.path.isdir(os.path.join('locale', langdir)):
+ for filename in os.listdir(os.path.join('locale', langdir, 'LC_MESSAGES')):
+ if filename.endswith('.mo'):
+ arcname = os.path.join(_get_bundle_name() + '.activity',
+ 'locale', langdir, 'LC_MESSAGES',
+ filename)
+ bundle_zip.write(
+ os.path.join('locale', langdir, 'LC_MESSAGES', filename),
+ arcname)
+
def cmd_dist(manifest):
cmd_genmo(manifest)
file_list = _get_file_list(manifest)
@@ -154,16 +166,8 @@ def cmd_dist(manifest):
arcname = os.path.join(_get_bundle_name() + '.activity', filename)
bundle_zip.write(filename, arcname)
- for langdir in os.listdir('locale'):
- if os.path.isdir(os.path.join('locale', langdir)):
- for filename in os.listdir(os.path.join('locale', langdir, 'LC_MESSAGES')):
- if filename.endswith('.mo'):
- arcname = os.path.join(_get_bundle_name() + '.activity',
- 'locale', langdir, 'LC_MESSAGES',
- filename)
- bundle_zip.write(
- os.path.join('locale', langdir, 'LC_MESSAGES', filename),
- arcname)
+ if os.path.exists('locale'):
+ _include_mo_in_bundle(bundle_zip)
bundle_zip.close()