| 1187 | |
| 1188 | @staticmethod |
| 1189 | def show_modules(): |
| 1190 | categories = defaultdict(list) |
| 1191 | for module in modules().values(): |
| 1192 | categories[module.category].append(module) |
| 1193 | |
| 1194 | print() |
| 1195 | for category in categories: |
| 1196 | print(" " + str(paint(category).BLUE)) |
| 1197 | table = Table(joinchar=' │ ') |
| 1198 | for module in categories[category]: |
| 1199 | description = module.run.__doc__ or "" |
| 1200 | if description: |
| 1201 | description = module.run.__doc__.strip().splitlines()[0] |
| 1202 | table += [paint(module.__name__).red, description] |
| 1203 | print(indent(str(table), ' '), "\n", sep="") |
| 1204 | |
| 1205 | @session_operation(current=True) |
| 1206 | def do_run(self, line): |