def find_template(template_name):
 template_paths = config['pylons.app_globals'].template_paths
 for path in template_paths:
  if os.path.exists(os.path.join(path, template_name.encode('utf-8'))):
   return os.path.join(path, template_name)

def find_template ( template_name ) : template_paths = config [ 'pylons.app_globals' ] . template_paths for path in template_paths : if os . path . exists ( os . path . join ( path , template_name . encode ( 'utf-8' ) ) ) : return os . path . join ( path , template_name )
looks through the possible template paths to find a template returns the full path is it exists .