Merge lp:~dholbach/help-app/prerequisites into lp:~ubuntu-touch-coreapps-drivers/help-app/trunk

Proposed by Daniel Holbach
Status: Merged
Merged at revision: 57
Proposed branch: lp:~dholbach/help-app/prerequisites
Merge into: lp:~ubuntu-touch-coreapps-drivers/help-app/trunk
Diff against target: 32 lines (+11/-1)
1 file modified
edit-here/translations.py (+11/-1)
To merge this branch: bzr merge lp:~dholbach/help-app/prerequisites
Reviewer Review Type Date Requested Status
Daniel Holbach (community) Approve
Nicholas Skaggs (community) Needs Fixing
Review via email: mp+251097@code.launchpad.net

Description of the change

Give more information and fail more gently if prerequisites like po4a or polib are missing.

To post a comment you must log in.
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

One minor tweak

review: Needs Fixing
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

There is an unrelated issue with the HACKING doc, I'll ask you to sneak in:

You can find the updated HTML in ./app/www/. For instance, you can browse
the site in firefox with

firefox app/www/index.html

^^ This is incorrect now. We could say

firefox app/www/index.en-us.html

or

firefox app/www/index*.html

or remove the specific recommendation.

lp:~dholbach/help-app/prerequisites updated
58. By Daniel Holbach

use shutil.which(), thanks Nick!

Revision history for this message
Daniel Holbach (dholbach) wrote :

app/www/index.html will be re-added through 1425025.

Revision history for this message
Daniel Holbach (dholbach) wrote :

<dholbach> balloons, the index.html will come back
 in fact I pushed a small branch to start work on bug 1425025
<ubot5> bug 1425025 in Help for Ubuntu for devices "Automatically load translated pages according to the user language" [High,Triaged] https://launchpad.net/bugs/1425025
<dholbach> can I merge the prerequisites branch now?
<balloons> dholbach, yep go for it

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'edit-here/translations.py'
2--- edit-here/translations.py 2015-02-26 11:59:36 +0000
3+++ edit-here/translations.py 2015-02-26 15:56:37 +0000
4@@ -2,10 +2,17 @@
5 import copy
6 import glob
7 import os
8-import polib
9 import re
10 import shutil
11 import subprocess
12+import sys
13+
14+try:
15+ import polib
16+except ImportError:
17+ print('Missing prerequisites. Please run: '
18+ '"sudo apt install python3-polib"')
19+ sys.exit(1)
20
21 from pelicanconf import PATH
22
23@@ -27,6 +34,9 @@
24 '-M', 'utf-8',
25 ]
26 self.pot_file = pot_file
27+ if not shutil.which('po4a'):
28+ print('Missing prerequisites. Please run: "sudo apt install po4a"')
29+ sys.exit(1)
30
31 def run(self, po4a_command, additional_args, with_output=False):
32 args = copy.copy(self.default_args)

Subscribers

People subscribed via source and target branches