From 7959ac4776b28ff48b11bc465fff52af9891142c Mon Sep 17 00:00:00 2001 From: Markus Birth Date: Mon, 16 Sep 2019 12:45:58 +0200 Subject: [PATCH] Added parameter to output known device list. --- get_updates.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/get_updates.py b/get_updates.py index 03376b1..f280f6f 100644 --- a/get_updates.py +++ b/get_updates.py @@ -9,6 +9,7 @@ __author__ = "mbirth" from grmn import updateserver, devices from optparse import OptionParser, OptionGroup +import json import os.path import sys @@ -33,7 +34,17 @@ Examples: (opts, device_skus) = optp.parse_args() -if len(device_skus) < 1 and not opts.devicexml: +if opts.list_devices: + if opts.json: + print(json.dumps(devices.DEVICES)) + else: + print("HWID - Device/Component") + for hwid, name in devices.DEVICES.items(): + print("{:>04} - {}".format(hwid, name)) + print() + print("SKU format is 006-Bxxxx-00 with xxxx being the HWID.") + sys.exit(0) +elif len(device_skus) < 1 and not opts.devicexml: optp.print_help() sys.exit(1)