Interactive shell.
| 1 | import cmd |
| 2 | |
| 3 | class Shell(cmd.Cmd): |
| 4 | """Interactive shell.""" |
| 5 | |
| 6 | def __init__(self, inject_function, prompt): |
| 7 | cmd.Cmd.__init__(self) |
| 8 | |
| 9 | self.inject_function = inject_function |
| 10 | self.prompt = prompt |
| 11 | |
| 12 | def default(self, line): |
| 13 | print self.inject_function(line) |
| 14 | |
| 15 | def emptyline(self): |
| 16 | pass |
| 17 | |
| 18 | class MultilineShell(cmd.Cmd): |
| 19 | """Interactive multiline shell.""" |
no outgoing calls
no test coverage detected