view martini/utils.py @ 7:7c8f23eae311

discriminate on case
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 24 Nov 2010 10:55:59 -0800
parents 3c3522ce6e3a
children
line wrap: on
line source

def getlist(string, separator=','):
    if not string:
        return []
    _list = [ i.strip() for i in string.split(',') ]
    if not _list:
        return _list
    if not _list[-1]:
        return _list[:-1]
    return _list

def getbool(string):
    return string.strip().lower() == 'true'