comparison docs/pycon2010/pirate8.py @ 356:d275d3beceff

fix usage help name-stripping bug
author catherine@dellzilla
date Wed, 17 Feb 2010 14:32:04 -0500
parents 798c7f32a960
children bf314710e64b
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 @options([make_option('--ho', type='int', help="How often to chant 'ho'", default=2), 43 @options([make_option('--ho', type='int', help="How often to chant 'ho'", default=2),
41 make_option('-c', '--commas', action="store_true", help="Interspers commas")]) 44 make_option('-c', '--commas', action="store_true", help="Interspers commas")])
42 def do_yo(self, arg, opts): 45 def do_yo(self, arg, opts):
43 chant = ['yo'] + ['ho'] * opts.ho 46 chant = ['yo'] + ['ho'] * opts.ho
44 if opts.commas: 47 if opts.commas: