python: added __nonzero__ function to SimObject Bool params
This commit is contained in:
parent
f050ebe3a8
commit
f12961bf25
1 changed files with 5 additions and 0 deletions
|
@ -639,6 +639,11 @@ class Bool(ParamValue):
|
|||
def __str__(self):
|
||||
return str(self.value)
|
||||
|
||||
# implement truth value testing for Bool parameters so that these params
|
||||
# evaluate correctly during the python configuration phase
|
||||
def __nonzero__(self):
|
||||
return bool(self.value)
|
||||
|
||||
def ini_str(self):
|
||||
if self.value:
|
||||
return 'true'
|
||||
|
|
Loading…
Reference in a new issue