def compile_views(folder, skip_failed_views=False):
 path = pjoin(folder, 'views')
 failed_views = []
 for fname in listdir(path, '^[\\w/\\-]+(\\.\\w+)*$'):
  try:
   data = parse_template(fname, path)
  except Exception as e:
   if skip_failed_views:
    failed_views.append(fname)
   else:
    raise Exception(('%s in %s' % (e, fname)))
  else:
   filename = ('views.%s.py' % fname.replace(os.path.sep, '.'))
   filename = pjoin(folder, 'compiled', filename)
   write_file(filename, data)
   save_pyc(filename)
   os.unlink(filename)
 return (failed_views if failed_views else None)

def compile_views ( folder , skip_failed_views = False ) : path = pjoin ( folder , 'views' ) failed_views = [ ] for fname in listdir ( path , '^[\\w/\\-]+(\\.\\w+)*$' ) : try : data = parse_template ( fname , path ) except Exception as e : if skip_failed_views : failed_views . append ( fname ) else : raise Exception ( ( '%s in %s' % ( e , fname ) ) ) else : filename = ( 'views.%s.py' % fname . replace ( os . path . sep , '.' ) ) filename = pjoin ( folder , 'compiled' , filename ) write_file ( filename , data ) save_pyc ( filename ) os . unlink ( filename ) return ( failed_views if failed_views else None )
compiles all the views in the application specified by folder .