All pastes #96588 Raw Edit

Miscellany

public text v1 · immutable
#96588 ·published 2006-07-23 00:25 UTC
rendered paste body
def makePropDict(propertiesLine):
    #This will definitively not work if there is more than 3 items in the value

    fields = propertiesLine.split("|")
    resultDict =    {1: {"name" : fields[0],"type" : "bool" },
                    2: {"name" : fields[0],"type" : fields[1] },
                    3: {"name" : fields[0],"type" : fields[1],"defval" : fields[-1] } }[len(fields)]

    return resultDict