summaryrefslogtreecommitdiff
path: root/examples/pirate.py
diff options
context:
space:
mode:
authorkmvanbrunt <kmvanbrunt@gmail.com>2019-02-20 23:12:02 -0500
committerGitHub <noreply@github.com>2019-02-20 23:12:02 -0500
commit086d4db5e10b9bfe64c767a2dad9c38fe95f299c (patch)
tree0256863a9846acd5001ab6a97b1756a54ccd3df7 /examples/pirate.py
parentd8ae68b8c151b8aea17b6299b601098910bf6373 (diff)
parent7218eb4f86da34f66ec484ad2db4b4d4a129a6e8 (diff)
downloadcmd2-git-086d4db5e10b9bfe64c767a2dad9c38fe95f299c.tar.gz
Merge pull request #627 from python-cmd2/tab_settables
Tab settables
Diffstat (limited to 'examples/pirate.py')
-rwxr-xr-xexamples/pirate.py7
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