| | |
| | | truthy = frozenset(('t', 'true', 'y', 'yes', 'on', '1')) |
| | | falsey = frozenset(('f', 'false', 'n', 'no', 'off', '0')) |
| | | |
| | | |
| | | def asbool(s): |
| | | """ Return the boolean value ``True`` if the case-lowered value of string |
| | | input ``s`` is a :term:`truthy string`. If ``s`` is already one of the |
| | |
| | | s = str(s).strip() |
| | | return s.lower() in truthy |
| | | |
| | | |
| | | def aslist_cronly(value): |
| | | if isinstance(value, string_types): |
| | | value = filter(None, [x.strip() for x in value.splitlines()]) |
| | | return list(value) |
| | | |
| | | |
| | | def aslist(value, flatten=True): |
| | | """ Return a list of strings, separating the input based on newlines |
| | | and, if flatten=True (the default), also split on spaces within |