Load a module, initializing it and checking that it has the proper attributes
(self, module_path)
| 47 | return not module_error |
| 48 | |
| 49 | def load_module(self, module_path): |
| 50 | """Load a module, initializing it and checking that it has the proper attributes""" |
| 51 | try: |
| 52 | spec = importlib.util.spec_from_file_location("NXCModule", module_path) |
| 53 | module = spec.loader.load_module().NXCModule() |
| 54 | |
| 55 | if self.module_is_sane(module, module_path): |
| 56 | return module |
| 57 | except Exception as e: |
| 58 | self.logger.fail(f"Failed loading module at {module_path}: {e}") |
| 59 | self.logger.debug(traceback.format_exc()) |
| 60 | |
| 61 | def init_module(self, module_path): |
| 62 | """Initialize a module for execution""" |
no test coverage detected