<s> class Price ( object ) : <EOL> def __init__ ( self , amount = <NUM_LIT:0.0> , currency_code = '<STR_LIT>' ) : <EOL> self . amount = amount <EOL> self . currency_code = currency_code <EOL> self . formatted_price = '<STR_LIT>' <EOL> def __repr__ ( self ) : <EOL> if self . formatted_price : <EOL> return self . formatted_price <EOL> else : <EOL> return str ( self . amount ) <EOL> def startElement ( self , name , attrs , connection ) : <EOL> return None <EOL> def endElement ( self , name , value , connection ) : <EOL> if name == '<STR_LIT>' : <EOL> self . amount = float ( value ) <EOL> elif name == '<STR_LIT>' : <EOL> self . currency_code = value <EOL> elif name == '<STR_LIT>' : <EOL> self . formatted_price = value <EOL> def get_as_params ( self , label , ord = <NUM_LIT:1> ) : <EOL> return { '<STR_LIT>' % ( label , ord ) : str ( self . amount ) , <EOL> '<STR_LIT>' % ( label , ord ) : self . currency_code } </s>
