diff options
| author | 2016-04-10 17:40:58 +0100 | |
|---|---|---|
| committer | 2016-04-10 17:40:58 +0100 | |
| commit | 190d42fbb527a8710a8e710dc3260ad8054a9d1d (patch) | |
| tree | d69cfbac8105ff18230b9828bec1b412e42db7ea /Utils.py | |
| parent | added a confirmation of message save to in.py. (diff) | |
| signature | ||
simpler boolean channel settings
Diffstat (limited to 'Utils.py')
| -rw-r--r-- | Utils.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -165,3 +165,12 @@ def from_pretty_time(pretty_time): seconds += number if seconds > 0: return seconds + +IS_TRUE = ["true", "yes", "on", "y"] +IS_FALSE = ["false", "no", "off", "n"] +def bool_or_none(s): + s = s.lower() + if s in IS_TRUE: + return True + elif s in IS_FALSE: + return False |
