summaryrefslogtreecommitdiff
path: root/examples/environment.py
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2021-03-16 12:25:34 -0400
committerEric Lin <anselor@gmail.com>2021-03-18 14:16:03 -0400
commit0cd626ebbef273aa78c2d1154ebdd5f9055028cf (patch)
tree9a822b245312b3b515b64a69d772fab75fce8121 /examples/environment.py
parenta649286b9468ebadbafeca1abf20a946351ceefe (diff)
downloadcmd2-git-cmdset_settables.tar.gz
Resolves comments from PRcmdset_settables
Diffstat (limited to 'examples/environment.py')
-rwxr-xr-xexamples/environment.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/environment.py b/examples/environment.py
index 5f5d927b..151c55af 100755
--- a/examples/environment.py
+++ b/examples/environment.py
@@ -13,8 +13,10 @@ class EnvironmentApp(cmd2.Cmd):
super().__init__()
self.degrees_c = 22
self.sunny = False
- self.add_settable(cmd2.Settable('degrees_c', int, 'Temperature in Celsius', onchange_cb=self._onchange_degrees_c))
- self.add_settable(cmd2.Settable('sunny', bool, 'Is it sunny outside?'))
+ self.add_settable(
+ cmd2.Settable('degrees_c', int, 'Temperature in Celsius', self, onchange_cb=self._onchange_degrees_c)
+ )
+ self.add_settable(cmd2.Settable('sunny', bool, 'Is it sunny outside?', self))
def do_sunbathe(self, arg):
"""Attempt to sunbathe."""