aboutsummaryrefslogtreecommitdiff
blob: 7b23585e50a0ae18204f84304efc75fba6a13ef4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from importlib import import_module as _import

from .api import keywords, scan
from .base import PkgcheckException
from .results import Result

__all__ = ("keywords", "scan", "PkgcheckException", "Result")
__title__ = "pkgcheck"
__version__ = "0.10.31"


def __getattr__(name):
    """Provide import access to keyword classes."""
    if name in keywords:
        return keywords[name]

    try:
        return _import("." + name, __name__)
    except ImportError:
        raise AttributeError(f"module {__name__} has no attribute {name}")


def __dir__():
    return sorted(__all__ + tuple(keywords))