Load plugin based on name
(module_name)
| 46 | |
| 47 | |
| 48 | def load_plugin(module_name): |
| 49 | """Load plugin based on name""" |
| 50 | if module_name == 'noop': |
| 51 | return noop |
| 52 | |
| 53 | if module_name not in imported_plugins: |
| 54 | full_name = 'keepercommander.plugins.' + module_name |
| 55 | try: |
| 56 | logging.debug('Importing %s', str(full_name)) |
| 57 | imported_plugins[module_name] = importlib.import_module(full_name) |
| 58 | except ModuleNotFoundError as e: |
| 59 | logging.error('The required module is not installed:\n\tpip install %s', e.name) |
| 60 | |
| 61 | if module_name in imported_plugins: |
| 62 | return imported_plugins[module_name] |
| 63 | else: |
| 64 | return '' |
| 65 | |
| 66 | |
| 67 | def get_host_field_dict(record): |
no test coverage detected