def _get_buildout_scripts(module_path):
 project_root = _get_parent_dir_with_file(module_path, 'buildout.cfg')
 if (not project_root):
  return []
 bin_path = os.path.join(project_root, 'bin')
 if (not os.path.exists(bin_path)):
  return []
 extra_module_paths = []
 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)):
     extra_module_paths.append(filepath)
  except (UnicodeDecodeError, IOError) as e:
   debug.warning(unicode(e))
   continue
 return extra_module_paths

def _get_buildout_scripts ( module_path ) : project_root = _get_parent_dir_with_file ( module_path , 'buildout.cfg' ) if ( not project_root ) : return [ ] bin_path = os . path . join ( project_root , 'bin' ) if ( not os . path . exists ( bin_path ) ) : return [ ] extra_module_paths = [ ] 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 ) ) : extra_module_paths . append ( filepath ) except ( UnicodeDecodeError , IOError ) as e : debug . warning ( unicode ( e ) ) continue return extra_module_paths
if there is a buildout .