snakeoil.modules module¶
dynamic import functionality
- exception snakeoil.modules.FailedImport(trg, e)[source]¶
Bases:
ImportError
Raised when a requested target cannot be imported
- snakeoil.modules.load_any(name)[source]¶
load an attribute or a module from a namespace
- Parameters:
name – python dotted namespace path of the object to load from a module for example,
snakeoil.modules.load_module
would returnload_module()
, andsnakeoil.modules
would return modules- Raise:
FailedImport if importing fails, or the requested attribute cannot be found
- Returns:
object resolved from name
- snakeoil.modules.load_attribute(name)[source]¶
load an attribute from a module
- Parameters:
name – python dotted namespace path of the attribute to load from a module for example,
snakeoil.modules.load_module
would returnload_module()
- Raise:
FailedImport if importing fails, or the requested attribute cannot be found
- Returns:
attribute resolved from name