def copy_asset(source, destination, excluded=(lambda path: False), context=None, renderer=None):
 if (not os.path.exists(source)):
  return
 ensuredir(destination)
 if os.path.isfile(source):
  copy_asset_file(source, destination, context, renderer)
  return
 for (root, dirs, files) in walk(source):
  reldir = relative_path(source, root)
  for dir in dirs[:]:
   if excluded(posixpath.join(reldir, dir)):
    dirs.remove(dir)
   else:
    ensuredir(posixpath.join(destination, reldir, dir))
  for filename in files:
   if (not excluded(posixpath.join(reldir, filename))):
    copy_asset_file(posixpath.join(root, filename), posixpath.join(destination, reldir), context, renderer)

def copy_asset ( source , destination , excluded = ( lambda path : False ) , context = None , renderer = None ) : if ( not os . path . exists ( source ) ) : return ensuredir ( destination ) if os . path . isfile ( source ) : copy_asset_file ( source , destination , context , renderer ) return for ( root , dirs , files ) in walk ( source ) : reldir = relative_path ( source , root ) for dir in dirs [ : ] : if excluded ( posixpath . join ( reldir , dir ) ) : dirs . remove ( dir ) else : ensuredir ( posixpath . join ( destination , reldir , dir ) ) for filename in files : if ( not excluded ( posixpath . join ( reldir , filename ) ) ) : copy_asset_file ( posixpath . join ( root , filename ) , posixpath . join ( destination , reldir ) , context , renderer )
copy asset files to destination recursively .