chore: lets not break niels code

This commit is contained in:
GameTec_live
2025-04-06 13:48:30 +02:00
parent 5b670e133f
commit be7a8539f6
+4 -12
View File
@@ -954,16 +954,8 @@ class HFMFFCHK(ReaderRequiredUnit):
return
if args.import_dic is not None:
for key in args.import_dic.readlines():
if key.startswith("#"): # ignore comments
pass
elif key.isspace(): # ignore empty lines
pass
elif re.match(r'^[a-fA-F0-9]{12}$', key): # take only this key format
keys.add(bytes.fromhex(key))
else: # in case of another format, a conversion is needed
print(f' - {CR}Key should in hex[12] format, invalid key is ignored{C0}, key = "{key}"')
continue
if not load_dic_file(args.import_dic, keys):
return
if len(keys) == 0:
print(f' - {CR}No keys{C0}')
@@ -2503,7 +2495,7 @@ class HWSlotList(DeviceRequiredUnit):
print(f"{CY if enabled[fwslot]['hf'] else C0}{hf_tag_type}{C0}")
else:
print("undef")
if (not args.short) and enabled[fwslot]['hf'] and hf_tag_type != TagSpecificType.UNDEFINED:
if (not args.short) and enabled[fwslot]['hf']:
if current != slot:
self.cmd.set_active_slot(slot)
current = slot
@@ -2554,7 +2546,7 @@ class HWSlotList(DeviceRequiredUnit):
print(f"{CY if enabled[fwslot]['lf'] else C0}{lf_tag_type}{C0}")
else:
print("undef")
if (not args.short) and enabled[fwslot]['lf'] and lf_tag_type != TagSpecificType.UNDEFINED:
if (not args.short) and enabled[fwslot]['lf']:
if current != slot:
self.cmd.set_active_slot(slot)
current = slot