def collect_dynamic_libs(package, destdir=None):
 if (not isinstance(package, string_types)):
  raise ValueError
 logger.debug(('Collecting dynamic libraries for %s' % package))
 (pkg_base, pkg_dir) = get_package_paths(package)
 dylibs = []
 for (dirpath, _, __) in os.walk(pkg_dir):
  for pattern in PY_DYLIB_PATTERNS:
   files = glob.glob(os.path.join(dirpath, pattern))
   for source in files:
    if destdir:
     dest = destdir
    else:
     dest = remove_prefix(dirpath, (os.path.dirname(pkg_base) + os.sep))
    logger.debug((' %s, %s' % (source, dest)))
    dylibs.append((source, dest))
 return dylibs

def collect_dynamic_libs ( package , destdir = None ) : if ( not isinstance ( package , string_types ) ) : raise ValueError logger . debug ( ( 'Collecting dynamic libraries for %s' % package ) ) ( pkg_base , pkg_dir ) = get_package_paths ( package ) dylibs = [ ] for ( dirpath , _ , __ ) in os . walk ( pkg_dir ) : for pattern in PY_DYLIB_PATTERNS : files = glob . glob ( os . path . join ( dirpath , pattern ) ) for source in files : if destdir : dest = destdir else : dest = remove_prefix ( dirpath , ( os . path . dirname ( pkg_base ) + os . sep ) ) logger . debug ( ( ' %s, %s' % ( source , dest ) ) ) dylibs . append ( ( source , dest ) ) return dylibs
this routine produces a list of of dynamic library files which reside in package .