Populate a list of commands in the shell. Each command has its own method of the form do_ , and can be extracted by introspecting the class directory.
(self)
| 379 | self.close_connection() |
| 380 | |
| 381 | def _populate_command_list(self): |
| 382 | """Populate a list of commands in the shell. |
| 383 | |
| 384 | Each command has its own method of the form do_<command>, and can be extracted by |
| 385 | introspecting the class directory. |
| 386 | """ |
| 387 | # Slice the command method name to get the name of the command. |
| 388 | self.commands = [cmd[3:] for cmd in dir(self.__class__) if cmd.startswith('do_')] |
| 389 | |
| 390 | def _disable_readline(self): |
| 391 | """Disables the readline module. |