def compile_models(folder):
 path = pjoin(folder, 'models')
 for fname in listdir(path, '.+\\.py$'):
  data = read_file(pjoin(path, fname))
  modelfile = ('models.' + fname.replace(os.path.sep, '.'))
  filename = pjoin(folder, 'compiled', modelfile)
  mktree(filename)
  write_file(filename, data)
  save_pyc(filename)
  os.unlink(filename)

def compile_models ( folder ) : path = pjoin ( folder , 'models' ) for fname in listdir ( path , '.+\\.py$' ) : data = read_file ( pjoin ( path , fname ) ) modelfile = ( 'models.' + fname . replace ( os . path . sep , '.' ) ) filename = pjoin ( folder , 'compiled' , modelfile ) mktree ( filename ) write_file ( filename , data ) save_pyc ( filename ) os . unlink ( filename )
compiles all the models in the application specified by folder .