def fixup_enums(obj, name_class_map, suffix='AsString'):
 for n in name_class_map.keys():
  c = name_class_map[n]
  setattr(obj, (n + suffix), c._VALUES_TO_NAMES[getattr(obj, n)])
 return obj

def fixup_enums ( obj , name_class_map , suffix = 'AsString' ) : for n in name_class_map . keys ( ) : c = name_class_map [ n ] setattr ( obj , ( n + suffix ) , c . _VALUES_TO_NAMES [ getattr ( obj , n ) ] ) return obj
relying on todds thrift-546 patch .