Skip to content

Commit

Permalink
Fix config.py
Browse files Browse the repository at this point in the history
  • Loading branch information
robotman2412 authored Sep 2, 2024
1 parent ccbecf0 commit 4dd876b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ def select(self, desc: Desc) -> T:
while True:
print(f"Available {desc.name} options:")
for i in range(len(keys)):
print(f"[{i+1}] {options[keys[i]]}")
print(f"[{i+1}] {self.options[keys[i]]}")
defidx = keys.index(self.defval)+1
idx = input(f"Select {desc.name} [{defidx}] ") or str(defidx+1)
idx = input(f"Select {desc.name} [{defidx}] ") or str(defidx)
try:
idx = str(idx)
idx = int(idx)
if idx >= 1 and idx <= len(keys):
return options[keys[idx-1]]
return self.options[keys[idx-1]]
except ValueError:
continue

Expand Down

0 comments on commit 4dd876b

Please sign in to comment.