Source code for betty.load
"""
Provide the Ancestry loading API.
"""
import logging
from betty.app import App
from betty.warnings import deprecated
[docs]
@deprecated(
"This function is deprecated as of Betty 0.3.2, and will be removed in Betty 0.4.x. Instead, use `logging.getLogger()`."
)
def getLogger() -> logging.Logger:
"""
Get the ancestry loading logger.
"""
return logging.getLogger(__name__)
[docs]
class Loader:
[docs]
async def load(self) -> None:
raise NotImplementedError(repr(self))
[docs]
class PostLoader:
[docs]
async def post_load(self) -> None:
raise NotImplementedError(repr(self))
[docs]
async def load(app: App) -> None:
"""
Load an ancestry.
"""
await app.dispatcher.dispatch(Loader)()
await app.dispatcher.dispatch(PostLoader)()