Return a list of dicts with GPU properties instead of a list of lists

This commit is contained in:
Alexander Grothe 2017-07-16 08:16:55 +02:00
parent 3521f9eee8
commit 72c016d14a
2 changed files with 4 additions and 2 deletions

View File

@ -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 = {

View File

@ -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 = {