aboutsummaryrefslogtreecommitdiff
path: root/Utils.py
diff options
context:
space:
mode:
authorGravatar Evelyn2016-04-10 17:40:58 +0100
committerGravatar Evelyn2016-04-10 17:40:58 +0100
commit190d42fbb527a8710a8e710dc3260ad8054a9d1d (patch)
treed69cfbac8105ff18230b9828bec1b412e42db7ea /Utils.py
parentadded a confirmation of message save to in.py. (diff)
signature
simpler boolean channel settings
Diffstat (limited to 'Utils.py')
-rw-r--r--Utils.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Utils.py b/Utils.py
index 092946df..9cbc3a3f 100644
--- a/Utils.py
+++ b/Utils.py
@@ -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