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
=== modified file 'scripts/setup-mac.py'
--- scripts/setup-mac.py 2012-12-10 18:13:57 +0000
+++ scripts/setup-mac.py 2012-12-14 18:08:25 +0000
@@ -203,6 +203,20 @@
203 # default is to do everything:203 # default is to do everything:
204 self.only_prepare = "sso, controlpanel, client, storage-protocol"204 self.only_prepare = "sso, controlpanel, client, storage-protocol"
205205
206 def copy_translation_files(self, src_root, dst_root):
207 """Merge .mo files from src_root into dst_root."""
208 for src_dir, dirs, files in os.walk(src_root):
209 dst_dir = src_dir.replace(src_root, dst_root)
210 if not os.path.exists(dst_dir):
211 os.mkdir(dst_dir)
212 for f in files:
213 src_f = os.path.join(src_dir, f)
214 dst_f = os.path.join(dst_dir, f)
215 if os.path.exists(dst_f):
216 raise Exception("Error copying translations: %r "
217 "exists already" % dst_f)
218 shutil.copyfile(src_f, dst_f)
219
206 def run(self):220 def run(self):
207 """Copy, build and munge things to prepare for packaging."""221 """Copy, build and munge things to prepare for packaging."""
208222
@@ -262,6 +276,11 @@
262276
263 shutil.copyfile(os.path.join(self.source_dir,277 shutil.copyfile(os.path.join(self.source_dir,
264 "ubuntuone-control-panel", "bin",278 "ubuntuone-control-panel", "bin",
279 "ubuntuone-updater"),
280 os.path.join("bin", "ubuntuone-updater.py"))
281
282 shutil.copyfile(os.path.join(self.source_dir,
283 "ubuntuone-control-panel", "bin",
265 "ubuntuone-control-panel-qt"),284 "ubuntuone-control-panel-qt"),
266 os.path.join("bin", "ubuntuone-control-panel-qt.py"))285 os.path.join("bin", "ubuntuone-control-panel-qt.py"))
267286
@@ -320,6 +339,7 @@
320 print "tried to copy", os.path.abspath('ubuntu_sso'),339 print "tried to copy", os.path.abspath('ubuntu_sso'),
321 print "to ", dest_sso340 print "to ", dest_sso
322341
342
323 sso_revno = subprocess.check_output(["bzr", "revno", "."],343 sso_revno = subprocess.check_output(["bzr", "revno", "."],
324 env=BZR_ENV).strip()344 env=BZR_ENV).strip()
325345
@@ -347,7 +367,9 @@
347 os.chdir(start_dir)367 os.chdir(start_dir)
348368
349 # install controlpanel files369 # install controlpanel files
350 os.chdir(os.path.join(self.source_dir, "ubuntuone-control-panel"))370 cp_source_dir = os.path.join(self.source_dir,
371 "ubuntuone-control-panel")
372 os.chdir(cp_source_dir)
351373
352 if "controlpanel" in self.only_prepare:374 if "controlpanel" in self.only_prepare:
353 print "building ubuntuone-controlpanel"375 print "building ubuntuone-controlpanel"
@@ -368,6 +390,11 @@
368 shutil.copytree(os.path.join("ubuntuone", "controlpanel"),390 shutil.copytree(os.path.join("ubuntuone", "controlpanel"),
369 dest_cp)391 dest_cp)
370392
393 # copy translations over: (we are already in cp_source_dir)
394 self.copy_translation_files(os.path.join('build', 'mo'),
395 os.path.join(INSTALL_DIR,
396 'share', 'locale'))
397
371 u1cp_revno = subprocess.check_output(["bzr", "revno", "."],398 u1cp_revno = subprocess.check_output(["bzr", "revno", "."],
372 env=BZR_ENV).strip()399 env=BZR_ENV).strip()
373400
@@ -857,8 +884,12 @@
857884
858 main_zip.close()885 main_zip.close()
859886
860 # make a package to send for signing887 print "copying translation files"
888 shutil.copytree(os.path.join(INSTALL_DIR, 'share', 'locale'),
889 os.path.join(control_panel_resources_path,
890 'translations'))
861891
892 print "building signing package"
862 sign_dir = os.path.join("dist", "build_to_sign")893 sign_dir = os.path.join("dist", "build_to_sign")
863 os.makedirs(sign_dir)894 os.makedirs(sign_dir)
864895

Subscribers

People subscribed via source and target branches