INNER CODE UNIT · Python

autoload_modules

bkbilly/lnxlink · lnxlink/modules/__init__.py:13

def autoload_modules(exclude=None):
    """Gather a list of all modules"""
    if exclude is None:
        exclude = []
    modules = []
    modules_path = f"{os.path.dirname(__file__)}/*.py"
    for module_path in glob.glob(modules_path):
        module = os.path.basename(module_path)
        if "__" not in module and module.endswith(".py"):
            module = module.replace(".py", "")
            if module not in exclude:
                modules.append(module)

    modules.sort()
    return modules


def parse_modules(list_modules=None, custom_modules=None, exclude=None):

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…