diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-02-20 22:56:25 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-02-20 22:56:25 -0500 |
commit | 6cb882e3420fef1497955c9b4c7f0d8674e1557d (patch) | |
tree | 0256863a9846acd5001ab6a97b1756a54ccd3df7 /examples/pirate.py | |
parent | 6e4d4801827559b3dc150b1dd29de482cfba2626 (diff) | |
download | cmd2-git-6cb882e3420fef1497955c9b4c7f0d8674e1557d.tar.gz |
Changed examples to reflect that settable doesn't need to be updated before calling init()
Diffstat (limited to 'examples/pirate.py')
-rwxr-xr-x | examples/pirate.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/pirate.py b/examples/pirate.py index 2da3fcaa..32330404 100755 --- a/examples/pirate.py +++ b/examples/pirate.py @@ -32,12 +32,15 @@ class Pirate(cmd2.Cmd): self.terminators = self.terminators + ['...'] self.songcolor = Fore.BLUE - # Add stuff to settable and/or shortcuts before calling base class initializer - self.settable['songcolor'] = 'Color to ``sing`` in (black/red/green/yellow/blue/magenta/cyan/white)' + # Add stuff to shortcuts before calling base class initializer self.shortcuts.update({'~': 'sing'}) """Initialize the base class as well as this one""" super().__init__() + + # Make songcolor settable at runtime + self.settable['songcolor'] = 'Color to ``sing`` in (black/red/green/yellow/blue/magenta/cyan/white)' + # prompts and defaults self.gold = 0 self.initial_gold = self.gold |