(search_path)
if there is a 'buildout.cfg' file in one of the parent directories of the
    given module it will return a list of all files in the buildout bin
    directory that look like python files.

    :param search_path: absolute path to the module.
    :type search_path: str
if there is a 'buildout.cfg' file in one of the parent directories of the
    given module it will return a list of all files in the buildout bin
    directory that look like python files.
if there is a buildout . cfg file in one of the parent directories of the given module it will return a list of all files in the buildout bin directory that look like python files .
def _get_buildout_script_paths(search_path):
    """
    if there is a 'buildout.cfg' file in one of the parent directories of the
    given module it will return a list of all files in the buildout bin
    directory that look like python files.

    :param search_path: absolute path to the module.
    :type search_path: str
    """
    project_root = _get_parent_dir_with_file(search_path, 'buildout.cfg')
    if not project_root:
        return
    bin_path = os.path.join(project_root, 'bin')
    if not os.path.exists(bin_path):
        return

    for filename in os.listdir(bin_path):
        try:
            filepath = os.path.join(bin_path, filename)
            with open(filepath, 'r') as f:
                firstline = f.readline()
                if firstline.startswith('#!') and 'python' in firstline:
                    yield filepath
        except (UnicodeDecodeError, IOError) as e:
            # Probably a binary file; permission error or race cond. because
            # file got deleted. Ignore it.
            debug.warning(unicode(e))
            continue
def _get_buildout_script_paths ( search_path ) : project_root = _get_parent_dir_with_file ( search_path , 'buildout.cfg' ) if not project_root : return bin_path = os . path . join ( project_root , 'bin' ) if not os . path . exists ( bin_path ) : return for filename in os . listdir ( bin_path ) : try : filepath = os . path . join ( bin_path , filename ) with open ( filepath , 'r' ) as f : firstline = f . readline ( ) if firstline . startswith ( '#!' ) and 'python' in firstline : yield filepath except ( UnicodeDecodeError , IOError ) as e : # Probably a binary file; permission error or race cond. because # file got deleted. Ignore it. debug . warning ( unicode ( e ) ) continue