def tar_compiled(file, dir, expression='^.+$', exclude_content_from=None):
 tar = tarfile.TarFile(file, 'w')
 for file in listdir(dir, expression, add_dirs=True, exclude_content_from=exclude_content_from):
  filename = os.path.join(dir, file)
  if os.path.islink(filename):
   continue
  if (os.path.isfile(filename) and (file[(-4):] != '.pyc')):
   if (file[:6] == 'models'):
    continue
   if (file[:5] == 'views'):
    continue
   if (file[:11] == 'controllers'):
    continue
   if (file[:7] == 'modules'):
    continue
  tar.add(filename, file, False)
 tar.close()

def tar_compiled ( file , dir , expression = '^.+$' , exclude_content_from = None ) : tar = tarfile . TarFile ( file , 'w' ) for file in listdir ( dir , expression , add_dirs = True , exclude_content_from = exclude_content_from ) : filename = os . path . join ( dir , file ) if os . path . islink ( filename ) : continue if ( os . path . isfile ( filename ) and ( file [ ( - 4 ) : ] != '.pyc' ) ) : if ( file [ : 6 ] == 'models' ) : continue if ( file [ : 5 ] == 'views' ) : continue if ( file [ : 11 ] == 'controllers' ) : continue if ( file [ : 7 ] == 'modules' ) : continue tar . add ( filename , file , False ) tar . close ( )
used to tar a compiled application .