Merge ~pieq/bugit/+git/qabro:fix-1883860-series-argument into bugit:master

Proposed by Pierre Equoy
Status: Merged
Approved by: Pierre Equoy
Approved revision: 5bc857020450190bd564235bfd0129d7b7f38735
Merged at revision: c4b8d23215f38fed2c0b3d66e43d2df741d074b7
Proposed branch: ~pieq/bugit/+git/qabro:fix-1883860-series-argument
Merge into: bugit:master
Diff against target: 69 lines (+17/-8)
2 files modified
qabro/__init__.py (+15/-6)
qabro/ui.py (+2/-2)
Reviewer Review Type Date Requested Status
Jonathan Cave (community) Approve
Review via email: mp+386801@code.launchpad.net

Description of the change

See commit message for more info.

To test, one can build the snap using `snapcraft` command, install it with `--devmode` argument, and test:

$ qabro -h
usage: test.py [-h] [--fwts] [-a ASSIGNEE] [-p PROJECT] [-s SERIES] [-t TAGS]

optional arguments:
  -h, --help show this help message and exit
  --fwts Automatically files an issue in Launchpad for the firmware team
  -a ASSIGNEE, --assignee ASSIGNEE
                        Assignee
  -p PROJECT, --project PROJECT
                        Project name
  -s SERIES, --series SERIES
                        Series
  -t TAGS, --tags TAGS Tags (such as Platform tag) separated by spaces

Examples: `qabro --fwts -p somerville -t platform-tag-3` will automatically open a Launchpad issue in the somerville project for the FWTS team.`qabro -p myproject -s myseries -t "a b c"` will start a bug report for the myproject project under the myseries series with tags a, b and c.

$ qabro -s my-series

should pre-fill the Series text field with `my-series`.

To post a comment you must log in.
Revision history for this message
Jonathan Cave (jocave) wrote :

Very minor usability point not entirely related to this MR! Otherwise looks good to me.

review: Approve
Revision history for this message
Pierre Equoy (pieq) wrote :

Good point, joc, I updated the commit to reflect this.

Revision history for this message
Jonathan Cave (jocave) wrote :

Nice, still +1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/qabro/__init__.py b/qabro/__init__.py
2index ce717ad..832e3a7 100644
3--- a/qabro/__init__.py
4+++ b/qabro/__init__.py
5@@ -36,15 +36,19 @@ def main():
6 raise ValueError('Invalid log level: %s' % loglevel)
7 logging.basicConfig(filename=logfile, format=logformat, level=numeric_level)
8
9- epilog = ("Example: `qabro --fwts -p somerville -t platform-tag-3` will "
10+ epilog = ("Examples: `qabro --fwts -p somerville -t platform-tag-3` will "
11 "automatically open a Launchpad issue in the somerville project "
12- "for the FWTS team.")
13+ "for the FWTS team."
14+ "`qabro -p myproject -s myseries -t \"a b c\"` will start a bug "
15+ "report for the myproject project under the myseries series "
16+ "with tags a, b and c.")
17 parser = argparse.ArgumentParser(epilog=epilog, argument_default='')
18 parser.add_argument("--fwts", help=("Automatically files an issue in "
19 "Launchpad for the firmware team"),
20 action="store_true")
21- parser.add_argument("-a", "--assignee", help="Assignee")
22+ parser.add_argument("-a", "--assignee", help="Assignee e.g. your Launchpad ID")
23 parser.add_argument("-p", "--project", help="Project name")
24+ parser.add_argument("-s", "--series", help="Series e.g. focal")
25 parser.add_argument("-t", "--tags",
26 help="Tags (such as Platform tag) separated by spaces")
27 args = parser.parse_args()
28@@ -55,11 +59,16 @@ def main():
29 sys.exit("You must specify a platform tag, e.g. -t platform-tag-3")
30 auto_submit_fwts_report(args.project, args.tags)
31 else:
32- start_ui(assignee=args.assignee, project=args.project, tags=args.tags)
33+ start_ui(assignee=args.assignee,
34+ project=args.project,
35+ series=args.series,
36+ tags=args.tags)
37
38
39-def start_ui(assignee='', project='', tags=''):
40- ui = ReportScreen(assignee=assignee.lower(), project=project.lower(),
41+def start_ui(assignee='', project='', series='', tags=''):
42+ ui = ReportScreen(assignee=assignee.lower(),
43+ project=project.lower(),
44+ series=series.lower(),
45 tags=tags.lower())
46 ui.run()
47 ba = BugAssistant(ui.report())
48diff --git a/qabro/ui.py b/qabro/ui.py
49index 1a78c20..f83c516 100644
50--- a/qabro/ui.py
51+++ b/qabro/ui.py
52@@ -44,7 +44,7 @@ class ReportScreen:
53 elif d["category"] == "vendors":
54 tags["vendors"] = d["tags"]
55
56- def __init__(self, project='', tags='', assignee=''):
57+ def __init__(self, assignee='', project='', series='', tags=''):
58 # Adding standard info (CPU, BIOS, GPU, etc.) to the description
59 std_info = AttachmentAssistant.get_standard_info()
60 std_info_str = '\n'.join(['{}: {}'.format(elt, std_info[elt]) for elt in std_info])
61@@ -55,7 +55,7 @@ class ReportScreen:
62 multiline=True),
63 "Description (including steps to reproduce)")
64 self._project = urwid.LineBox(urwid.Edit(edit_text=project), 'Project')
65- self._series = urwid.LineBox(urwid.Edit(), 'Series')
66+ self._series = urwid.LineBox(urwid.Edit(edit_text=series), 'Series')
67 self._status = []
68 for s in self.statuses:
69 rb = urwid.RadioButton(self._status, s, 'first True', None)

Subscribers

People subscribed via source and target branches

to all changes: