Skip to content
Snippets Groups Projects
Unverified Commit 3bb6be9e authored by Caleb Connolly's avatar Caleb Connolly :recycle:
Browse files

add a flag to print checkboxes instead of bullet points (MR 2)


This way we can keep track of which devices have been tested.

Signed-off-by: default avatarCaleb Connolly <caleb.connolly@linaro.org>
parent 367850ac
No related branches found
No related tags found
1 merge request!2Make TTQ behave better in scripts
......@@ -10,9 +10,11 @@ ARGS_QUERY_SOCS = {}
ARGS_QUERY_DEVICES = []
ARGS_QUERY_UI = ""
ARGS_USER_TYPE = "gitlab"
BULLET_POINT = "*"
def parse_args():
global ARGS
global BULLET_POINT
ttq = sys.argv[0]
examples = ("examples:\n"
......@@ -39,10 +41,14 @@ def parse_args():
help="show matrix users instead of gitlab users")
parser.add_argument("-n", "--notes", action="store_true",
help="print notes (if any)")
parser.add_argument("-c", "--checkboxes", action="store_true",
help="Use checkboxes instead of bullet points")
parser.add_argument("QUERY", nargs="?",
help="what to search for")
ARGS = parser.parse_args()
if ARGS.checkboxes:
BULLET_POINT = "* [ ]"
def parse_args_query_soc():
......
......@@ -3,7 +3,7 @@
import sys
import ttq.match
import ttq.args
def format_user_list(users):
ret = []
......@@ -20,7 +20,7 @@ def by_ui():
for ui in sorted(ttq.match.UIS_MATCHED):
users = ttq.match.UIS_MATCHED[ui]
ui_short = ui.split("postmarketos-ui-", 1)[1]
print(f"* {ui_short} ({format_user_list(users)})")
print(f"{ttq.args.BULLET_POINT} {ui_short} ({format_user_list(users)})")
print()
print(f"Matched {len(ttq.match.UIS_MATCHED)} user interfaces,"
......@@ -31,7 +31,7 @@ def by_ui():
def by_device():
for device in sorted(ttq.match.DEVICES_MATCHED):
users = ttq.match.DEVICES_MATCHED[device]
print(f"* {device} ({format_user_list(users)})")
print(f"{ttq.args.BULLET_POINT} {device} ({format_user_list(users)})")
print()
print(f"Matched {len(ttq.match.DEVICES_MATCHED)} devices,"
......@@ -41,10 +41,10 @@ def by_device():
def by_soc():
for soc in ttq.match.SOCS_MATCHED:
print(f"* {soc}:")
print(f"{ttq.args.BULLET_POINT} {soc}:")
for device in sorted(ttq.match.SOCS_MATCHED[soc]):
users = ttq.match.DEVICES_MATCHED[device]
print(f" * {device} ({format_user_list(users)})")
print(f" {ttq.args.BULLET_POINT} {device} ({format_user_list(users)})")
print()
print(f"Matched {len(ttq.match.SOCS_MATCHED)} SoCs,"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment