autodetect.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:rcli 作者: contains-io 项目源码 文件源码
def setup_keyword(dist, _, value):
    # type: (setuptools.dist.Distribution, str, bool) -> None
    """Add autodetected commands as entry points.

    Args:
        dist: The distutils Distribution object for the project being
            installed.
        _: The keyword used in the setup function. Unused.
        value: The value set to the keyword in the setup function. If the value
            is not True, this function will do nothing.
    """
    if value is not True:
        return
    if dist.entry_points is None:
        dist.entry_points = {}
    for command, subcommands in six.iteritems(_get_commands(dist)):
        entry_point = '{command} = rcli.dispatcher:main'.format(
            command=command)
        entry_points = dist.entry_points.setdefault('console_scripts', [])
        if entry_point not in entry_points:
            entry_points.append(entry_point)
        dist.entry_points.setdefault('rcli', []).extend(subcommands)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号