(self, list_disabled=False)
| 62 | # -- Load / Unload -- |
| 63 | |
| 64 | def listPlugins(self, list_disabled=False): |
| 65 | plugins = [] |
| 66 | for dir_name in sorted(os.listdir(self.path_plugins)): |
| 67 | dir_path = os.path.join(self.path_plugins, dir_name) |
| 68 | plugin_name = dir_name.replace("disabled-", "") |
| 69 | if dir_name.startswith("disabled"): |
| 70 | is_enabled = False |
| 71 | else: |
| 72 | is_enabled = True |
| 73 | |
| 74 | plugin_config = self.config["builtin"].get(plugin_name, {}) |
| 75 | if "enabled" in plugin_config: |
| 76 | is_enabled = plugin_config["enabled"] |
| 77 | |
| 78 | if dir_name == "__pycache__" or not os.path.isdir(dir_path): |
| 79 | continue # skip |
| 80 | if dir_name.startswith("Debug") and not config.debug: |
| 81 | continue # Only load in debug mode if module name starts with Debug |
| 82 | if not is_enabled and not list_disabled: |
| 83 | continue # Dont load if disabled |
| 84 | |
| 85 | plugin = {} |
| 86 | plugin["source"] = "builtin" |
| 87 | plugin["name"] = plugin_name |
| 88 | plugin["dir_name"] = dir_name |
| 89 | plugin["dir_path"] = dir_path |
| 90 | plugin["inner_path"] = plugin_name |
| 91 | plugin["enabled"] = is_enabled |
| 92 | plugin["rev"] = config.rev |
| 93 | plugin["loaded"] = plugin_name in self.plugin_names |
| 94 | plugins.append(plugin) |
| 95 | |
| 96 | plugins += self.listInstalledPlugins(list_disabled) |
| 97 | return plugins |
| 98 | |
| 99 | def listInstalledPlugins(self, list_disabled=False): |
| 100 | plugins = [] |
no test coverage detected