Adding incorrect hid code lookup error detection.
This commit is contained in:
parent
d05f7ae820
commit
e1add027a7
4
kll.py
4
kll.py
@ -466,11 +466,15 @@ def hidCodeToCapability( items ):
|
|||||||
for sequence in range( 0, len( items[ variant ] ) ):
|
for sequence in range( 0, len( items[ variant ] ) ):
|
||||||
for combo in range( 0, len( items[ variant ][ sequence ] ) ):
|
for combo in range( 0, len( items[ variant ][ sequence ] ) ):
|
||||||
if items[ variant ][ sequence ][ combo ][0] in backend.requiredCapabilities.keys():
|
if items[ variant ][ sequence ][ combo ][0] in backend.requiredCapabilities.keys():
|
||||||
|
try:
|
||||||
# Use backend capability name and a single argument
|
# Use backend capability name and a single argument
|
||||||
items[ variant ][ sequence ][ combo ] = tuple(
|
items[ variant ][ sequence ][ combo ] = tuple(
|
||||||
[ backend.capabilityLookup( items[ variant ][ sequence ][ combo ][0] ),
|
[ backend.capabilityLookup( items[ variant ][ sequence ][ combo ][0] ),
|
||||||
tuple( [ hid_lookup_dictionary[ items[ variant ][ sequence ][ combo ] ] ] ) ]
|
tuple( [ hid_lookup_dictionary[ items[ variant ][ sequence ][ combo ] ] ] ) ]
|
||||||
)
|
)
|
||||||
|
except KeyError:
|
||||||
|
print ( "{0} {1} is an invalid HID lookup value".format( ERROR, items[ variant ][ sequence ][ combo ] ) )
|
||||||
|
sys.exit( 1 )
|
||||||
return items
|
return items
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user