| |
- 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: <UNUSED> kept it so that program running with addonpy will run addonpyLite
:return: void
- get_instance(self, addon)
- get instance of addon loaded by name
: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)
- get loaded addons by addonpy
: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)
- 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_logger(self, logger)
- set logger for addonpy explicitly once module is initialized
:param logger: logger instance
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 = '.py'
| |