Merge lp:~mikemc/ubuntuone-windows-installer/add-translations-mac into lp:ubuntuone-windows-installer

Proposed by Mike McCracken
Status: Merged
Approved by: dobey
Approved revision: 157
Merged at revision: 155
Proposed branch: lp:~mikemc/ubuntuone-windows-installer/add-translations-mac
Merge into: lp:ubuntuone-windows-installer
Prerequisite: lp:~mikemc/ubuntuone-windows-installer/add-folder-to-favorites
Diff against target: 80 lines (+33/-2)
1 file modified
scripts/setup-mac.py (+33/-2)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-windows-installer/add-translations-mac
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+139980@code.launchpad.net

Commit message

- Bundle translated strings files into mac app wrapper. (LP: #1074116)

Description of the change

- Bundle translated strings files into mac app wrapper. (LP: #1074116)

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/setup-mac.py'
2--- scripts/setup-mac.py 2012-12-10 18:13:57 +0000
3+++ scripts/setup-mac.py 2012-12-14 18:08:25 +0000
4@@ -203,6 +203,20 @@
5 # default is to do everything:
6 self.only_prepare = "sso, controlpanel, client, storage-protocol"
7
8+ def copy_translation_files(self, src_root, dst_root):
9+ """Merge .mo files from src_root into dst_root."""
10+ for src_dir, dirs, files in os.walk(src_root):
11+ dst_dir = src_dir.replace(src_root, dst_root)
12+ if not os.path.exists(dst_dir):
13+ os.mkdir(dst_dir)
14+ for f in files:
15+ src_f = os.path.join(src_dir, f)
16+ dst_f = os.path.join(dst_dir, f)
17+ if os.path.exists(dst_f):
18+ raise Exception("Error copying translations: %r "
19+ "exists already" % dst_f)
20+ shutil.copyfile(src_f, dst_f)
21+
22 def run(self):
23 """Copy, build and munge things to prepare for packaging."""
24
25@@ -262,6 +276,11 @@
26
27 shutil.copyfile(os.path.join(self.source_dir,
28 "ubuntuone-control-panel", "bin",
29+ "ubuntuone-updater"),
30+ os.path.join("bin", "ubuntuone-updater.py"))
31+
32+ shutil.copyfile(os.path.join(self.source_dir,
33+ "ubuntuone-control-panel", "bin",
34 "ubuntuone-control-panel-qt"),
35 os.path.join("bin", "ubuntuone-control-panel-qt.py"))
36
37@@ -320,6 +339,7 @@
38 print "tried to copy", os.path.abspath('ubuntu_sso'),
39 print "to ", dest_sso
40
41+
42 sso_revno = subprocess.check_output(["bzr", "revno", "."],
43 env=BZR_ENV).strip()
44
45@@ -347,7 +367,9 @@
46 os.chdir(start_dir)
47
48 # install controlpanel files
49- os.chdir(os.path.join(self.source_dir, "ubuntuone-control-panel"))
50+ cp_source_dir = os.path.join(self.source_dir,
51+ "ubuntuone-control-panel")
52+ os.chdir(cp_source_dir)
53
54 if "controlpanel" in self.only_prepare:
55 print "building ubuntuone-controlpanel"
56@@ -368,6 +390,11 @@
57 shutil.copytree(os.path.join("ubuntuone", "controlpanel"),
58 dest_cp)
59
60+ # copy translations over: (we are already in cp_source_dir)
61+ self.copy_translation_files(os.path.join('build', 'mo'),
62+ os.path.join(INSTALL_DIR,
63+ 'share', 'locale'))
64+
65 u1cp_revno = subprocess.check_output(["bzr", "revno", "."],
66 env=BZR_ENV).strip()
67
68@@ -857,8 +884,12 @@
69
70 main_zip.close()
71
72- # make a package to send for signing
73+ print "copying translation files"
74+ shutil.copytree(os.path.join(INSTALL_DIR, 'share', 'locale'),
75+ os.path.join(control_panel_resources_path,
76+ 'translations'))
77
78+ print "building signing package"
79 sign_dir = os.path.join("dist", "build_to_sign")
80 os.makedirs(sign_dir)
81

Subscribers

People subscribed via source and target branches