| |
- builtins.object
-
- AddonLoader
class AddonLoader(builtins.object) |
|
Addon Loader class, scans, validates, loads the addons and used to get the instance of the addons |
|
Methods defined here:
- __init__(self, verbose=False, logger=None, recursive=False, lazy_load=False)
- Initialize with optional verbose mode (print information) and optional logger (not implemented)
:param verbose: print loading information
:param logger: custom logger used in verbose mode
:param recursive: recursively search for addons
:param lazy_load: scan first load when called
:return: void
- get_instance(self, addon)
- get instance of specific addon loaded by addonpy.
:param addon: addon name for which instance will be returned
:return: instance of loaded addon
:rtype: class instance
:raises: ImportWarning, NameError
- get_loaded_addons(self, by_type=None, list_all=False)
- get addons based on specific user specified type. will show only loaded modules, if lazy_load is set it will
return 0 at start and as addons are requested this will be populated
:param by_type: type name
:param list_all: list all loaded modules
:return: list of loaded addons
- load_addons(self)
- Load addons from specified directories
- scan files
- load them
- validate for required methods
- load
:return: void (sets class level dict)
- log(self, message, level='debug')
- log messages to console
:param message: message to log
:param level: message level, default: debug
:return: void
- print_current_config(self)
- prints current configuration recursive & lazy load mode status, if On or Off
:return: void
- set_addon_dirs(self, dirs)
- override the default config value to look for addons
:param dirs: directories to search for addons as list
:return: void
:raises: TypeError
- set_lazy_load(self, state)
- Change lazy_load mode. Recommended: Either set while initializing or leave it default
:param state: true or false
:return: void
- set_logger(self, logger)
- set logger for addonpy explicitly once module is initialized
:param logger: logger instance
- set_recursive_search(self, state)
- Change recursive search mode for addons, Recommended: Either set while initializing or leave it default
:param state: true or false
:return: void
Static methods defined here:
- get_loaded_addon_instance(addon_name)
- Use to for nested addon calls.
:param addon_name: addon to load
:return: addon instance
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- ext = '.info'
| |