Args: show_all: show installed and official supported if True, else only those installed Returns: local_plugins_info: show the list of plugins info
(
self,
show_all=False,
)
| 1114 | print('{:<15} |{:<10} |{:<100}'.format(k, v['version'], v['desc'])) |
| 1115 | |
| 1116 | def list_plugins( |
| 1117 | self, |
| 1118 | show_all=False, |
| 1119 | ): |
| 1120 | """ |
| 1121 | |
| 1122 | Args: |
| 1123 | show_all: show installed and official supported if True, else only those installed |
| 1124 | |
| 1125 | Returns: |
| 1126 | local_plugins_info: show the list of plugins info |
| 1127 | |
| 1128 | """ |
| 1129 | local_plugins_info = self._get_plugins_from_file() |
| 1130 | |
| 1131 | # update plugins with default |
| 1132 | |
| 1133 | local_official_plugins = copy.deepcopy(OFFICIAL_PLUGINS) |
| 1134 | local_plugins_info = self._update_plugins(local_official_plugins, |
| 1135 | local_plugins_info) |
| 1136 | |
| 1137 | if show_all is True: |
| 1138 | self._print_plugins_info(local_plugins_info) |
| 1139 | return local_plugins_info |
| 1140 | |
| 1141 | # Consider those package with version is installed |
| 1142 | not_installed_list = [] |
| 1143 | for item in local_plugins_info: |
| 1144 | if local_plugins_info[item]['version'] == '': |
| 1145 | not_installed_list.append(item) |
| 1146 | |
| 1147 | for item in not_installed_list: |
| 1148 | local_plugins_info.pop(item) |
| 1149 | |
| 1150 | self._print_plugins_info(local_plugins_info) |
| 1151 | return local_plugins_info |
| 1152 | |
| 1153 | def update_plugins_file( |
| 1154 | self, |