Modify idlemove module to be able to chain thresholds for moving and add source channel filters

This commit is contained in:
Stefan Hacker
2010-12-27 02:42:23 +01:00
parent bf006394da
commit b25b446f84
6 changed files with 96 additions and 58 deletions

View File

@@ -93,7 +93,7 @@ def x2bool(s):
if isinstance(s, bool):
return s
elif isinstance(s, basestring):
return s.lower() in ['1', 'true']
return s.strip().lower() in ['1', 'true']
raise ValueError()
def commaSeperatedIntegers(s):
@@ -109,3 +109,10 @@ def commaSeperatedStrings(s):
containing comma seperated strings into a list of strings
"""
return map(str.strip, s.split(','))
def commaSeperatedBool(s):
"""
Helper function to convert a string from the config
containing comma seperated strings into a list of booleans
"""
return map(x2bool, s.split(','))