Given a path to a management directory, return a list of all the command names that are available.
(management_dir)
| 27 | |
| 28 | |
| 29 | def find_commands(management_dir): |
| 30 | """ |
| 31 | Given a path to a management directory, return a list of all the command |
| 32 | names that are available. |
| 33 | """ |
| 34 | command_dir = os.path.join(management_dir, "commands") |
| 35 | return [ |
| 36 | name |
| 37 | for _, name, is_pkg in pkgutil.iter_modules([command_dir]) |
| 38 | if not is_pkg and not name.startswith("_") |
| 39 | ] |
| 40 | |
| 41 | |
| 42 | def load_command_class(app_name, name): |