You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current implementation of MenuPages.show_checked_page() is the following:
asyncdefshow_checked_page(self, page_number):
max_pages=self._source.get_max_pages()
try:
ifmax_pagesisNone:
# If it doesn't give maximum pages, it cannot be checkedawaitself.show_page(page_number)
elifmax_pages>page_number>=0:
awaitself.show_page(page_number)
exceptIndexError:
# An error happened that can be handled, so ignore it.pass
Before making a PR I wanted to check if the following implementation is something you would like to see implemented Danny.
asyncdefshow_checked_page(self, page_number: int) ->None:
max_pages=self._source.get_max_pages()
try:
ifmax_pagesisNone:
# If it doesn't give maximum pages, it cannot be checkedawaitself.show_page(page_number)
elifpage_number>=max_pages:
awaitself.show_page(0)
elifpage_number<0:
awaitself.show_page(max_pages-1)
elifmax_pages>page_number>=0:
awaitself.show_page(page_number)
exceptIndexError:
# An error happened that can be handled, so ignore it.pass
This implementation would allow the menu to go to the last page when pressing back on Page 0, and go to first page when pressing Next on Page -1
The text was updated successfully, but these errors were encountered:
Current implementation of
MenuPages.show_checked_page()
is the following:Before making a PR I wanted to check if the following implementation is something you would like to see implemented Danny.
This implementation would allow the menu to go to the last page when pressing back on Page 0, and go to first page when pressing Next on Page -1
The text was updated successfully, but these errors were encountered: