Handles one command line during command list definition.
(self, line)
| 486 | return self.handle_command_def(line) |
| 487 | |
| 488 | def handle_command_def(self, line): |
| 489 | """Handles one command line during command list definition.""" |
| 490 | cmd, arg, line = self.parseline(line) |
| 491 | if not cmd: |
| 492 | return False |
| 493 | if cmd == 'silent': |
| 494 | self.commands_silent[self.commands_bnum] = True |
| 495 | return False # continue to handle other cmd def in the cmd list |
| 496 | elif cmd == 'end': |
| 497 | return True # end of cmd list |
| 498 | cmdlist = self.commands[self.commands_bnum] |
| 499 | if arg: |
| 500 | cmdlist.append(cmd+' '+arg) |
| 501 | else: |
| 502 | cmdlist.append(cmd) |
| 503 | # Determine if we must stop |
| 504 | try: |
| 505 | func = getattr(self, 'do_' + cmd) |
| 506 | except AttributeError: |
| 507 | func = self.default |
| 508 | # one of the resuming commands |
| 509 | if func.__name__ in self.commands_resuming: |
| 510 | self.commands_doprompt[self.commands_bnum] = False |
| 511 | return True |
| 512 | return False |
| 513 | |
| 514 | # interface abstraction functions |
| 515 |