implemented the choosing of pages
This commit is contained in:
parent
f4047b91c1
commit
fcee8c1f84
@ -21,10 +21,10 @@ SHADY_PAGES: Tuple[Type[Page]] = (
|
||||
Musify,
|
||||
)
|
||||
|
||||
|
||||
# this needs to be case insensitive
|
||||
SHORTHANDS = ('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z')
|
||||
for i, page in enumerate(ALL_PAGES):
|
||||
page_names[page.__name__] = page
|
||||
page_names[SHORTHANDS[i]] = page
|
||||
page_names[page.__name__.lower()] = page
|
||||
page_names[SHORTHANDS[i].lower()] = page
|
||||
|
||||
shorthand_of_page[page] = SHORTHANDS[i]
|
||||
|
@ -203,4 +203,7 @@ class Search(Download):
|
||||
except IndexError:
|
||||
return self
|
||||
|
||||
if query.lower() in page_attributes.page_names:
|
||||
return self.choose_page(page_attributes.page_names[query.lower()])
|
||||
|
||||
return self.search(query=query)
|
||||
|
Loading…
Reference in New Issue
Block a user