<s> from binascii import unhexlify <EOL> try : <EOL> True <EOL> except : <EOL> True = <NUM_LIT:1> <EOL> False = <NUM_LIT:0> <EOL> def parsetorrentlist ( filename , parsed ) : <EOL> new_parsed = { } <EOL> added = { } <EOL> removed = parsed <EOL> f = open ( filename , '<STR_LIT:r>' ) <EOL> while <NUM_LIT:1> : <EOL> l = f . readline ( ) <EOL> if not l : <EOL> break <EOL> l = l . strip ( ) <EOL> try : <EOL> if len ( l ) != <NUM_LIT> : <EOL> raise ValueError , '<STR_LIT>' <EOL> h = unhexlify ( l ) <EOL> except : <EOL> print '<STR_LIT>' + l <EOL> if parsed . has_key ( h ) : <EOL> del removed [ h ] <EOL> else : <EOL> added [ h ] = True <EOL> new_parsed [ h ] = True <EOL> f . close ( ) <EOL> return ( new_parsed , added , removed ) </s>
