def makeDictFromCommaSepString(s):
    """
    Reads in comma-separated list and converts to dictionary of successive
    keyword,value pairs.
    """
    if s.count(",") % 2 == 0:
        raise Exception("Must provide even number of items in argument of commas-separated pairs of values: " + s)

    d = {}
    items = s.split(",")
    while len(items) > 0:
        d[items[0]] = items[1]
        items = items[2:] 
    return d