Merge lp:~brendan-donegan/lpltk/lp-file-bug-fixes into lp:lpltk

Proposed by Brendan Donegan
Status: Merged
Merged at revision: 183
Proposed branch: lp:~brendan-donegan/lpltk/lp-file-bug-fixes
Merge into: lp:lpltk
Diff against target: 35 lines (+8/-5)
1 file modified
scripts/lp-file-bug (+8/-5)
To merge this branch: bzr merge lp:~brendan-donegan/lpltk/lp-file-bug-fixes
Reviewer Review Type Date Requested Status
Bryce Harrington code Approve
Review via email: mp+125363@code.launchpad.net

Description of the change

Few small fixes for the lp-file-bug script. I have given them a good test, but you might want to double-check the scenarios you saw failing before.

To post a comment you must log in.
Revision history for this message
Bryce Harrington (bryce) wrote :

Looks good, this solves the editor problem I noticed.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'scripts/lp-file-bug'
2--- scripts/lp-file-bug 2012-09-19 21:09:50 +0000
3+++ scripts/lp-file-bug 2012-09-19 22:49:27 +0000
4@@ -22,17 +22,18 @@
5 lp = LaunchpadService()
6
7 # TODO: Get the description for 'your favourite editor'
8- editor = os.environ.get('EDITOR','nano')
9+ editor = os.environ.get('EDITOR','nano').split()
10 tempfile = NamedTemporaryFile(delete=False)
11+ editor.append(tempfile.name)
12 try:
13- check_call([editor,tempfile.name])
14- except CalledProcessError:
15- print("Failed to open text editor")
16+ check_call(editor)
17+ except OSError:
18+ print("Failed to open preferred editor '%s'" % editor)
19 description = tempfile.read()
20
21 try:
22 bug = lp.create_bug(args.project, args.package, title=args.title, description=description)
23- print(bug.lp_bug.web_link)
24+ print(bug.lpbug.web_link)
25 except:
26 print("Unable to file bug in:")
27 print("\tproject: %s" % args.project)
28@@ -40,5 +41,7 @@
29 if args.package:
30 print("\tpackage: %s" % args.package)
31
32+ print("Please check that the project and/or package name are correct.")
33+
34 if __name__ == "__main__":
35 sys.exit(main())

Subscribers

People subscribed via source and target branches