def get_messages_from_file(path):
 apps_path = get_bench_dir()
 if os.path.exists(path):
  with open(path, u'r') as sourcefile:
   return [(os.path.relpath(u' +'.join([path, str(pos)]), apps_path), message) for (pos, message) in extract_messages_from_code(sourcefile.read(), path.endswith(u'.py'))]
 else:
  return []

def get_messages_from_file ( path ) : apps_path = get_bench_dir ( ) if os . path . exists ( path ) : with open ( path , u'r' ) as sourcefile : return [ ( os . path . relpath ( u' +' . join ( [ path , str ( pos ) ] ) , apps_path ) , message ) for ( pos , message ) in extract_messages_from_code ( sourcefile . read ( ) , path . endswith ( u'.py' ) ) ] else : return [ ]
returns a list of transatable strings from a code file .