diff options
| author | pepperpepperpepper <pepper@scannerjammer.com> | 2015-10-09 15:52:02 -0700 |
|---|---|---|
| committer | pepperpepperpepper <pepper@scannerjammer.com> | 2015-10-09 15:52:02 -0700 |
| commit | 42da3b72a8ee7deac3abe238fbdb1591d8d945b9 (patch) | |
| tree | 004eff4289ff5e01d8d66fbb29942cb2f94f47a9 /lib/param/bool_.py | |
| parent | 0c965a54861e779ca51b235e7a3c2475d8a84dfb (diff) | |
alright got rid of most relative paths
Diffstat (limited to 'lib/param/bool_.py')
| -rw-r--r-- | lib/param/bool_.py | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/param/bool_.py b/lib/param/bool_.py deleted file mode 100644 index fb688e3..0000000 --- a/lib/param/bool_.py +++ /dev/null @@ -1,24 +0,0 @@ -"""Defines the bool param type""" -from .param import Param -import re -class Bool(Param): - """Defines the bool param type - Args: - value: the value of the bool (string or python bool) - classname: the name of the class to which the param belongs - """ - def __init__(self, value, classname=""): - super(Bool, self).__init__(classname=classname) - if value: - self.value = self._bool_correct(value) - else: - self.value = False - def _bool_correct(self, b): - if isinstance(b, str) or isinstance(b, unicode): - if re.match(r'true', b, re.IGNORECASE): - return True - elif re.match(r'false', b, re.IGNORECASE): - return False - elif isinstance(b, bool): - return b - self.err_warn("Not a bool: %s" % str(b)) |
