Mercurial > python-cmd2
comparison docs/pycon2010/pirate7.py @ 356:d275d3beceff
fix usage help name-stripping bug
author | catherine@dellzilla |
---|---|
date | Wed, 17 Feb 2010 14:32:04 -0500 |
parents | 8a5bc9f5c28e |
children | 89e38f922c25 |
comparison
equal
deleted
inserted
replaced
355:5972ae04515e | 356:d275d3beceff |
---|---|
33 print("Quiterrr!") | 33 print("Quiterrr!") |
34 return True | 34 return True |
35 default_to_shell = True | 35 default_to_shell = True |
36 multilineCommands = ['sing'] | 36 multilineCommands = ['sing'] |
37 terminators = Cmd.terminators + ['...'] | 37 terminators = Cmd.terminators + ['...'] |
38 songcolor = 'blue' | |
39 settable = Cmd.settable + 'songcolor Color to ``sing`` in (red/blue/green/cyan/magenta, bold, underline)' | |
40 Cmd.shortcuts.update({'~': 'sing'}) | |
38 def do_sing(self, arg): | 41 def do_sing(self, arg): |
39 print(self.colorize(arg, 'blue')) | 42 print(self.colorize(arg, self.songcolor)) |
40 | 43 |
41 pirate = Pirate() | 44 pirate = Pirate() |
42 pirate.cmdloop() | 45 pirate.cmdloop() |