def parse_attribute_map(filenames):
 forward = {}
 backward = {}
 for filename in filenames:
  for line in open(filename).readlines():
   (name, friendly_name, name_format) = line.strip().split()
   forward[(name, name_format)] = friendly_name
   backward[friendly_name] = (name, name_format)
 return (forward, backward)

def parse_attribute_map ( filenames ) : forward = { } backward = { } for filename in filenames : for line in open ( filename ) . readlines ( ) : ( name , friendly_name , name_format ) = line . strip ( ) . split ( ) forward [ ( name , name_format ) ] = friendly_name backward [ friendly_name ] = ( name , name_format ) return ( forward , backward )
expects a file with each line being composed of the oid for the attribute exactly one space .