(path)
| 26 | |
| 27 | |
| 28 | def load_query_plugins(path): |
| 29 | from app import utils |
| 30 | logger = utils.get_logger() |
| 31 | plugins = [] |
| 32 | for file_path, name in walk_py(path): |
| 33 | try: |
| 34 | module = import_source(spec="query_plugins", path=file_path) |
| 35 | plugin = getattr(module, 'Query')() |
| 36 | plugins.append(plugin) |
| 37 | except Exception as e: |
| 38 | logger.warning("load query plugin error from {}".format(file_path)) |
| 39 | logger.exception(e) |
| 40 | |
| 41 | return plugins |
| 42 |
nothing calls this directly
no test coverage detected