diff options
author | Eric Lin <anselor@gmail.com> | 2021-03-16 12:25:34 -0400 |
---|---|---|
committer | Eric Lin <anselor@gmail.com> | 2021-03-18 14:16:03 -0400 |
commit | 0cd626ebbef273aa78c2d1154ebdd5f9055028cf (patch) | |
tree | 9a822b245312b3b515b64a69d772fab75fce8121 /examples/environment.py | |
parent | a649286b9468ebadbafeca1abf20a946351ceefe (diff) | |
download | cmd2-git-cmdset_settables.tar.gz |
Resolves comments from PRcmdset_settables
Diffstat (limited to 'examples/environment.py')
-rwxr-xr-x | examples/environment.py | 6 |
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.""" |