defined shorthands
This commit is contained in:
parent
3238f944b3
commit
f4047b91c1
@ -1,9 +1,13 @@
|
|||||||
from typing import Tuple, Type
|
from typing import Tuple, Type, Dict
|
||||||
|
|
||||||
from ..abstract import Page
|
from ..abstract import Page
|
||||||
from ..encyclopaedia_metallum import EncyclopaediaMetallum
|
from ..encyclopaedia_metallum import EncyclopaediaMetallum
|
||||||
from ..musify import Musify
|
from ..musify import Musify
|
||||||
|
|
||||||
|
page_names: Dict[str, Type[Page]] = dict()
|
||||||
|
|
||||||
|
shorthand_of_page: Dict[Type[Page], str] = dict()
|
||||||
|
|
||||||
ALL_PAGES: Tuple[Type[Page]] = (
|
ALL_PAGES: Tuple[Type[Page]] = (
|
||||||
EncyclopaediaMetallum,
|
EncyclopaediaMetallum,
|
||||||
Musify
|
Musify
|
||||||
@ -17,3 +21,10 @@ SHADY_PAGES: Tuple[Type[Page]] = (
|
|||||||
Musify,
|
Musify,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
shorthand_of_page[page] = SHORTHANDS[i]
|
||||||
|
Loading…
Reference in New Issue
Block a user