List modules without initializing them
(self)
| 107 | self.logger.debug(traceback.format_exc()) |
| 108 | |
| 109 | def list_modules(self): |
| 110 | """List modules without initializing them""" |
| 111 | modules = {} |
| 112 | modules_paths = [ |
| 113 | path_join(dirname(nxc.__file__), "modules"), |
| 114 | path_join(NXC_PATH, "modules"), |
| 115 | ] |
| 116 | |
| 117 | for path in modules_paths: |
| 118 | for module in listdir(path): |
| 119 | if module[-3:] == ".py" and module != "example_module.py": |
| 120 | try: |
| 121 | module_path = path_join(path, module) |
| 122 | module_data = self.get_module_info(module_path) |
| 123 | modules.update(module_data) |
| 124 | except Exception as e: |
| 125 | self.logger.debug(f"Error loading module {module}: {e}") |
| 126 | return modules |