choose_single works

This commit is contained in:
Hellow2 2023-03-29 11:53:55 +02:00
parent c4079efc4b
commit 8c01ee4198
2 changed files with 6 additions and 3 deletions

View File

@ -9,6 +9,9 @@ def search_pages():
print()
print(search)
search.choose(1)
print(search)
if __name__ == "__main__":
search_pages()

View File

@ -53,10 +53,10 @@ class MultiPageOptions:
if option_len > self.max_displayed_options:
option_len = self.max_displayed_options
if index < j + option_len:
return options[j + option_len - 1], Page
if j <= index < j + option_len:
return options[j + option_len - 1], page
j += option_len - 1
j += option_len
raise KeyError("index is out of range")