Merge lp:~nathwill-deactivatedaccount-deactivatedaccount/checkbox/lp988260 into lp:checkbox

Proposed by Nathan Williams
Status: Merged
Merged at revision: 1560
Proposed branch: lp:~nathwill-deactivatedaccount-deactivatedaccount/checkbox/lp988260
Merge into: lp:checkbox
Diff against target: 15 lines (+4/-1)
1 file modified
scripts/network_check (+4/-1)
To merge this branch: bzr merge lp:~nathwill-deactivatedaccount-deactivatedaccount/checkbox/lp988260
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Nathan Williams (community) Needs Resubmitting
Review via email: mp+118663@code.launchpad.net

Description of the change

wrap call(command) in try/catch to handle zenity absence (lp: #988260)

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks for your contribution to checkbox!

This code looks fine, I do have a request for the message you show when zenity is not found. The current message doesn't give much of a clue about why zenity is important, and people may confuse this with the result of the test.

I wonder if you could update it so it explains more clearly why zenity is needed and what the consequence will be. Maybe something like "unable to report test results since zenity is not installed" may work better. I leave it to your criteria.

Thanks again!

review: Needs Fixing
1559. By Nathan Williams

explain error, display results if missing zenity

Revision history for this message
Nathan Williams (nathwill-deactivatedaccount-deactivatedaccount) wrote :

Thanks for the tip. Updated the warning to be more helpful.

review: Needs Resubmitting
Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks!

One more correction needed: if I run it I get this:
  File "scripts/network_check", line 60
    print "Zenity missing; unable to report test result:\n %s" % message
                                                             ^
SyntaxError: invalid syntax

Note that this has been converted to Python 3, and since print is now a function and not a statement, you'd have to enclose it in parentheses so it runs correctly:

    print("Zenity missing; unable to report test result:\n %s" % message)

Once that's done this can be merged. It's a small change but I thought it best to bring it to your attention.

Thanks!

review: Needs Fixing
1560. By Nathan Williams

explain error,display results if missing zenity in py3 compatible fashion

Revision history for this message
Nathan Williams (nathwill-deactivatedaccount-deactivatedaccount) wrote :

py3: 1, nathwill: 0

review: Needs Resubmitting
Revision history for this message
Daniel Manrique (roadmr) wrote :

Great! Thanks so much.

Merging into trunk. Note that I added a changelog entry detailing your changes and linking to the fixed bug.

Thanks for your contribution!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/network_check'
2--- scripts/network_check 2012-07-25 19:30:54 +0000
3+++ scripts/network_check 2012-08-08 15:56:22 +0000
4@@ -54,7 +54,10 @@
5 command.append("--error")
6
7 if not args.auto:
8- call(command)
9+ try:
10+ call(command)
11+ except OSError:
12+ print("Zenity missing; unable to report test result:\n %s" % message)
13
14 if any(results.values()):
15 return 0

Subscribers

People subscribed via source and target branches