All pastes #96589 Raw Edit

Someone

public text v1 · immutable
#96589 ·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[2] }" }[len(fields)]

    resultDict = eval(resultDict)
    return resultDict