All pastes #742253 Raw Edit

Anonymous

public python v1 · immutable
·published 2007-10-19 11:16 UTC
rendered paste body
import stateimport itemnamefile = open('properties.diff', 'r')for line in file:    if line.startswith("typeID: "):        line = line.strip()        id = int(line.replace("typeID: ", "") ))        id = itemname.state()[id]        output = "Item:", id        print output        if line.startswith("    attribute["):        line = line.strip()    if line.endswith(")"):        l = line.replace("attribute[", "")        attribute, values = l.split("]")        new, old = values.replace(" = ", "").replace(")", "").split(" (")        output += " attribute: %s old value: %s new value: %s" % ( state.state[int(attribute)] , new, old)