Skip to content

Commit 9b3d09a

Browse files
committed
override bug fix
1 parent 8ac4a56 commit 9b3d09a

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ variable_mask.txt
2121
variable_screen.txt
2222
.~lock.*
2323
protocols/*custom*
24+
protocols/*/*custom*
2425
protocols/*override*
26+
protocols/*/*override*
2527
classes/transports/*custom*
2628

2729
input_registry.json

classes/protocol_settings.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,10 @@ def load_registry_overrides(self, override_path, keys : list[str]):
345345
reader = csv.DictReader(csvfile)
346346
for row in reader:
347347
for key in keys:
348-
key_value = row[key].strip().lower().replace(' ', '_')
349-
if key_value:
350-
overrides[key][key_value] = row
348+
if key in row:
349+
key_value = row[key].strip().lower().replace(' ', '_')
350+
if key_value:
351+
overrides[key][key_value] = row
351352
return overrides
352353

353354

@@ -618,16 +619,17 @@ def process_row(row):
618619
applied = False
619620
for key_value, override_row in overrides[key].items():
620621
# Check if both keys are unique before applying
621-
if all(override_row.get(k) not in overrided_keys for k in override_keys):
622-
self._log.info("Loading unique entry from overrides for both unique keys")
623-
process_row(override_row)
624-
625-
# Mark both keys as applied
626-
for k in override_keys:
627-
overrided_keys.add(override_row.get(k))
622+
if all(override_row.get(k) for k in override_keys):
623+
if all(override_row.get(k) not in overrided_keys for k in override_keys):
624+
self._log.info("Loading unique entry from overrides for both unique keys")
625+
process_row(override_row)
628626

629-
applied = True
630-
break # Exit inner loop after applying unique entry
627+
# Mark both keys as applied
628+
for k in override_keys:
629+
overrided_keys.add(override_row.get(k))
630+
631+
applied = True
632+
break # Exit inner loop after applying unique entry
631633

632634
if applied:
633635
continue

0 commit comments

Comments
 (0)