linkcheck.loader
Functions to load plugin modules.
Example usage:
modules = loader.get_package_modules('plugins')
plugins = loader.get_plugins(modules, PluginClass)
Functions
|
Check if file is writable by others on POSIX systems. |
|
|
|
Find all module files in the given folder that end with '.py' and don't start with an underscore. |
|
Return all subclasses of a class in the module. |
|
Find all valid modules in the given package which must be a folder in the same directory as this loader.py module. |
|
Find all given (sub-)classes in all modules. |
- linkcheck.loader.check_writable_by_others(filename)[source]
Check if file is writable by others on POSIX systems. On non-POSIX systems the check is ignored.
- linkcheck.loader.get_importable_files(folder)[source]
Find all module files in the given folder that end with ‘.py’ and don’t start with an underscore.
- Returns:
module names
- Return type:
iterator of string
- linkcheck.loader.get_module_plugins(module, classes)[source]
Return all subclasses of a class in the module. If the module defines __all__, only those entries will be searched, otherwise all objects not starting with ‘_’ will be searched.
- linkcheck.loader.get_package_modules(packagename, packagepath)[source]
Find all valid modules in the given package which must be a folder in the same directory as this loader.py module. A valid module has a .py extension, and is importable.
- Returns:
all loaded valid modules
- Return type:
iterator of module