From 72c016d14a87a92927174e9ac10c8bf3a5ebc04b Mon Sep 17 00:00:00 2001 From: Alexander Grothe Date: Sun, 16 Jul 2017 08:16:55 +0200 Subject: [PATCH] Return a list of dicts with GPU properties instead of a list of lists --- Manual.org | 3 ++- library/hardware_facts.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Manual.org b/Manual.org index e30419b..d2e69e4 100644 --- a/Manual.org +++ b/Manual.org @@ -4190,7 +4190,8 @@ def format_gpu_device_list(iterator): def get_entries(iterator): for d in iterator: if d.idClass == 0x030000: - yield (vendor_dict.get(d.idVendor, "unknown"), "{:04x}:{:04x}".format(d.idVendor, d.idProduct)) + yield {"VendorName": vendor_dict.get(d.idVendor, "unknown"), + "VendorID": d.idVendor, "ProductID": d.idProduct} return [entry for entry in get_entries(iterator)] arg_specs = { diff --git a/library/hardware_facts.py b/library/hardware_facts.py index e6a1e5f..5ca2e82 100755 --- a/library/hardware_facts.py +++ b/library/hardware_facts.py @@ -93,7 +93,8 @@ def format_gpu_device_list(iterator): def get_entries(iterator): for d in iterator: if d.idClass == 0x030000: - yield (vendor_dict.get(d.idVendor, "unknown"), "{:04x}:{:04x}".format(d.idVendor, d.idProduct)) + yield {"VendorName": vendor_dict.get(d.idVendor, "unknown"), + "VendorID": d.idVendor, "ProductID": d.idProduct} return [entry for entry in get_entries(iterator)] arg_specs = {