aboutsummaryrefslogtreecommitdiff
blob: 23aba96dcbe5b1ca3a83aaedf612f02aef69e5e6 (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.27"


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))