feat: auto import pages in page module
This commit is contained in:
parent
c24cf701c1
commit
5af95f1b03
@ -1,9 +1,23 @@
|
|||||||
|
import logging
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
from pathlib import Path
|
||||||
from typing import Dict, Generator, List, Set, Type
|
from typing import Dict, Generator, List, Set, Type
|
||||||
|
|
||||||
|
"""
|
||||||
from ._bandcamp import Bandcamp
|
from ._bandcamp import Bandcamp
|
||||||
from ._encyclopaedia_metallum import EncyclopaediaMetallum
|
from ._encyclopaedia_metallum import EncyclopaediaMetallum
|
||||||
from ._genius import Genius
|
from ._genius import Genius
|
||||||
from ._musify import Musify
|
from ._musify import Musify
|
||||||
from ._youtube import YouTube
|
from ._youtube import YouTube
|
||||||
from ._youtube_music import YoutubeMusic
|
from ._youtube_music import YoutubeMusic
|
||||||
|
"""
|
||||||
|
|
||||||
|
_page_directory = Path(__file__).parent
|
||||||
|
_stem_blacklist = set(["__pycache__", "__init__"])
|
||||||
|
|
||||||
|
for _file in _page_directory.iterdir():
|
||||||
|
if _file.stem in _stem_blacklist:
|
||||||
|
continue
|
||||||
|
|
||||||
|
logging.debug(f"importing {_file.absolute()}")
|
||||||
|
exec(f"from . import {_file.stem}")
|
||||||
|
Loading…
Reference in New Issue
Block a user