Fix in video devices registry keys request

Also treated keys as sets to avoid duplicated hardware.
This commit is contained in:
Dionisio E Alonso 2015-04-08 13:02:38 -03:00
parent 98f1483e2e
commit 911495fdfa
1 changed files with 4 additions and 4 deletions

View File

@ -49,23 +49,23 @@ class SystemInformation:
'HKEY_LOCAL_MACHINE',
'HARDWARE\\DEVICEMAP\\VIDEO',
'\Device\Video{}'.format(device))
reg_key = video_card_string.split('\\')[-2]
reg_key = '\\'.join(video_card_string.split('\\')[-2:])
# Probe keys to avoid software devices
get_registry_value(
'HKEY_LOCAL_MACHINE',
'SYSTEM\\CurrentControlSet\\Control\\Video\\'
'{}\\0000'.format(reg_key),
'{}'.format(reg_key),
'HardwareInformation.AdapterString')
reg_keys.append(reg_key)
except:
pass
video_cards = []
for video_card in reg_keys:
for video_card in set(reg_keys):
device_descrption = get_registry_value(
'HKEY_LOCAL_MACHINE',
'SYSTEM\\CurrentControlSet\\Control\\Video\\'
'{}\\0000'.format(video_card),
'{}'.format(video_card),
'Device Description')
video_cards.append(device_descrption)
return '\n\t'.join(video_cards)