def get_template_engine(themes):
 for theme_name in themes:
  engine_path = os.path.join(theme_name, u'engine')
  if os.path.isfile(engine_path):
   with open(engine_path) as fd:
    return fd.readlines()[0].strip()
 return u'mako'

def get_template_engine ( themes ) : for theme_name in themes : engine_path = os . path . join ( theme_name , u'engine' ) if os . path . isfile ( engine_path ) : with open ( engine_path ) as fd : return fd . readlines ( ) [ 0 ] . strip ( ) return u'mako'
get template engine used by a given theme .