from .settings import AACOMM_DLL_PATH, AACOMM_SERVER_EXE_PATH

__all__ = ['AACOMM_DLL_PATH', 'AACOMM_SERVER_EXE_PATH', 'CommAPI', 'Services', 'Shared']

# Lazy-load AAComm types so the DLL is only loaded when actually accessed.
# This prevents the DLL from being locked when running CLI commands
# (e.g. 'aacommpy dotnetfw') that need to overwrite it.
def __getattr__(name):
    if name in ('CommAPI', 'Services', 'Shared'):
        try:
            from .AAComm import CommAPI, Services, Shared
            globals()['CommAPI'] = CommAPI
            globals()['Services'] = Services
            globals()['Shared'] = Shared
            return globals()[name]
        except ImportError:
            raise AttributeError(f"module 'aacommpy' has no attribute '{name}'")
    raise AttributeError(f"module 'aacommpy' has no attribute '{name}'")
