def w2p_pack(filename, path, compiled=False, filenames=None):
 filename = abspath(filename)
 path = abspath(path)
 tarname = (filename + '.tar')
 if compiled:
  tar_compiled(tarname, path, '^[\\w\\.\\-]+$', exclude_content_from=['cache', 'sessions', 'errors'])
 else:
  tar(tarname, path, '^[\\w\\.\\-]+$', filenames=filenames, exclude_content_from=['cache', 'sessions', 'errors'])
 w2pfp = gzopen(filename, 'wb')
 tarfp = open(tarname, 'rb')
 w2pfp.write(tarfp.read())
 w2pfp.close()
 tarfp.close()
 os.unlink(tarname)

def w2p_pack ( filename , path , compiled = False , filenames = None ) : filename = abspath ( filename ) path = abspath ( path ) tarname = ( filename + '.tar' ) if compiled : tar_compiled ( tarname , path , '^[\\w\\.\\-]+$' , exclude_content_from = [ 'cache' , 'sessions' , 'errors' ] ) else : tar ( tarname , path , '^[\\w\\.\\-]+$' , filenames = filenames , exclude_content_from = [ 'cache' , 'sessions' , 'errors' ] ) w2pfp = gzopen ( filename , 'wb' ) tarfp = open ( tarname , 'rb' ) w2pfp . write ( tarfp . read ( ) ) w2pfp . close ( ) tarfp . close ( ) os . unlink ( tarname )
packs a web2py application .