Regenerate the entry_points console_scripts for the named distribution.
485237
def install_scripts(distributions):
    
    try:
        if "__PEX_UNVENDORED__" in __import__("os").environ:
          from setuptools.command import easy_install  # vendor:skip
        else:
          from pex.third_party.setuptools.command import easy_install

        if "__PEX_UNVENDORED__" in __import__("os").environ:
          import pkg_resources  # vendor:skip
        else:
          import pex.third_party.pkg_resources as pkg_resources

    except ImportError:
        raise RuntimeError("'wheel install_scripts' needs setuptools.")

    for dist in distributions:
        pkg_resources_dist = pkg_resources.get_distribution(dist)
        install = get_install_command(dist)
        command = easy_install.easy_install(install.distribution)
        command.args = ['wheel']  # dummy argument
        command.finalize_options()
        command.install_egg_scripts(pkg_resources_dist)
842896
def reset_namespace(self):
        """"""
        self.shellwidget.reset_namespace(warning=self.reset_warning,
                                         message=True)
703957
def entry_point(entry_point_name):
    
    def wrap(f):
        ENTRY_POINT_TABLE[entry_point_name] = f
        @wraps(f)
        def wrapped_f(*args, **kwargs):
            return f(*args, **kwargs)
        return wrapped_f
    return wrap
138534
def make_entry_point(patches, original_entry_point):
    
    def entry(argv=None):
        argv = argv if argv is not None else sys.argv[1:]
        return main(
            tuple(patches) + ('--', original_entry_point) + tuple(argv)
        )

    return entry
1170406
def set_entry_points(self, names):
        
        names = util.return_set(names)
        self.entry_point_names = names
446642
def _newConsole(cls, console):
        """"""
        self = cls.__new__(cls)
        _BaseConsole.__init__(self)
        self.console_c = console
        self.console = self
        self.width = _lib.TCOD_console_get_width(console)
        self.height = _lib.TCOD_console_get_height(console)
        return self
968331
def register_entry_points(self):
        
        for entrypoint in entrypoints.get_group_all("papermill.engine"):
            self.register(entrypoint.name, entrypoint.load())
1021624
def add_entrypoint(self, entry_point_group):
        """"""
        for ep in iter_entry_points(group=entry_point_group):
            if not resource_isdir(ep.module_name, 'translations'):
                continue
            dirname = resource_filename(ep.module_name, 'translations')
            self.add_path(dirname)
1290018
def _create_console_handles(self, project):
        
        """
        import __main__
        for item in project:
            __main__.__dict__[item.name] = item
773796
def rename_cmd(argv):
    """"""
    parser = argparse.ArgumentParser()
    parser.add_argument('source')
    parser.add_argument('target')
    pargs = parser.parse_args(argv)
    copy_virtualenv_project(pargs.source, pargs.target)
    return rmvirtualenvs([pargs.source])
1096954
def _ep_to_kv(entrypoint):
    '''
    
    '''
    cls = entrypoint.load()
    cls.name = entrypoint.name
    return (entrypoint.name, cls)
113624
def init(name, subnames, dest, skeleton, description, project_type, skip_core):
    """"""
    dest = dest or CUR_DIR
    skeleton = join(skeleton or SKEL_PATH, project_type)
    project = join(dest, name)
    script = join(project, name + '.py')
    core = join(project, name)
    if project_type == 'standalone':
        renames = [
            (join(project, 'project.py'), script),
            (join(project, 'project'), core)]
        copy_skeleton(
            name, skeleton, project, renames=renames, description=description,
            ignore=False)
    else:
        renames = [
            (join(project, 'project.py'), script),
            (join(project, 'project'), core)]
        exclude_dirs = ['submodule'] + (['project'] if skip_core else [])
        copy_skeleton(
            name, skeleton, project, renames=renames, description=description,
            exclude_dirs=exclude_dirs, ignore=True)
        for subname in subnames:
            renames = [
                (join(project, 'submodule'), join(project, subname))
            ]
            copy_skeleton(
                subname, skeleton, project, renames=renames,
                description=description, ignore=True,
                exclude_dirs=['project'], exclude_files=['project.py'])
    return 0, "\n{}\n".format(project)
1043965
def reapply(config):
    """"""
    with open(config, 'r'):
        main.reapply(yaml.load(open(config)))
5311
def apply_fixes(args, tmpdir):
  """"""
  invocation = [args.clang_apply_replacements_binary]
  if args.format:
    invocation.append('-format')
  if args.style:
    invocation.append('-style=' + args.style)
  invocation.append(tmpdir)
  subprocess.call(invocation)
1030141
def rebuild_app(app_name, quiet=False, force=True, without_exec=False,
                restart=False):
    '''
        
    '''
    user = 'cozy-{app_name}'.format(app_name=app_name)
    home = '{prefix}/{app_name}'.format(prefix=PREFIX, app_name=app_name)
    command_line = 'cd {home}'.format(home=home)
    command_line += ' && git pull'
    if force:
        command_line += ' && ([ -d node_modules ] && rm -rf node_modules || true)'
        command_line += ' && ([ -d .node-gyp ] && rm -rf .node-gyp || true)'
        command_line += ' && ([ -d .npm ] && rm -rf .npm || true)'
    command_line += ' && chown -R {user}:{user} .'.format(user=user)
    command_line += ' && sudo -u {user} env HOME={home} npm install --production'.format(
        user=user,
        home=home
    )
    if restart:
        command_line += ' && cozy-monitor update {app_name}'.format(
            app_name=app_name)
        command_line += ' && cozy-monitor restart {app_name}'.format(
            app_name=app_name)

    if not quiet:
        print 'Execute:'
        print command_line

    if not without_exec:
        result = helpers.cmd_exec(command_line)
        print result['stdout']
        print result['stderr']
        print result['error']
20480
def activate_script(self):
        """"""

        # must be rethought
        # ./scripts
        # deploydir/./scripts
        self._add_scope("script")
        self.scripts = {}
        self.script_files = [
            "./scripts/script_*.txt", "~/.cloudmesh/scripts/script_*.txt"]
        self._load_scripts(self.script_files)
905990
def path_mapped(script_name, *args)
    return cleanup_paths("/#{script_name}/#{@locations[:root]}") if args.empty?
    a = replace_symbols(script_name, *args)
    cleanup_paths("/#{script_name}/#{@locations[:root]}/#{a.join('/')}")
  end