当前位置: 首页>>代码示例>>Python>>正文


Python misc.redact_password_from_url方法代码示例

本文整理汇总了Python中pip._internal.utils.misc.redact_password_from_url方法的典型用法代码示例。如果您正苦于以下问题:Python misc.redact_password_from_url方法的具体用法?Python misc.redact_password_from_url怎么用?Python misc.redact_password_from_url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pip._internal.utils.misc的用法示例。


在下文中一共展示了misc.redact_password_from_url方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: make_search_scope

# 需要导入模块: from pip._internal.utils import misc [as 别名]
# 或者: from pip._internal.utils.misc import redact_password_from_url [as 别名]
def make_search_scope(options, suppress_no_index=False):
    # type: (Values, bool) -> SearchScope
    """
    :param suppress_no_index: Whether to ignore the --no-index option
        when constructing the SearchScope object.
    """
    index_urls = [options.index_url] + options.extra_index_urls
    if options.no_index and not suppress_no_index:
        logger.debug(
            'Ignoring indexes: %s',
            ','.join(redact_password_from_url(url) for url in index_urls),
        )
        index_urls = []

    # Make sure find_links is a list before passing to create().
    find_links = options.find_links or []

    search_scope = SearchScope.create(
        find_links=find_links, index_urls=index_urls,
    )

    return search_scope 
开发者ID:V1EngineeringInc,项目名称:V1EngineeringInc-Docs,代码行数:24,代码来源:cmdoptions.py

示例2: fetch_new

# 需要导入模块: from pip._internal.utils import misc [as 别名]
# 或者: from pip._internal.utils.misc import redact_password_from_url [as 别名]
def fetch_new(cls, dest, url, rev_options):
        rev_display = rev_options.to_display()
        logger.info(
            'Cloning %s%s to %s', redact_password_from_url(url),
            rev_display, display_path(dest),
        )
        cls.run_command(['clone', '-q', url, dest])

        if rev_options.rev:
            # Then a specific revision was requested.
            rev_options = cls.resolve_revision(dest, url, rev_options)
            branch_name = getattr(rev_options, 'branch_name', None)
            if branch_name is None:
                # Only do a checkout if the current commit id doesn't match
                # the requested revision.
                if not cls.is_commit_id_equal(dest, rev_options.rev):
                    cmd_args = ['checkout', '-q'] + rev_options.to_args()
                    cls.run_command(cmd_args, cwd=dest)
            elif cls.get_current_branch(dest) != branch_name:
                # Then a specific branch was requested, and that branch
                # is not yet checked out.
                track_branch = 'origin/{}'.format(branch_name)
                cmd_args = [
                    'checkout', '-b', branch_name, '--track', track_branch,
                ]
                cls.run_command(cmd_args, cwd=dest)

        #: repo may contain submodules
        cls.update_submodules(dest) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:31,代码来源:git.py

示例3: fetch_new

# 需要导入模块: from pip._internal.utils import misc [as 别名]
# 或者: from pip._internal.utils.misc import redact_password_from_url [as 别名]
def fetch_new(self, dest, url, rev_options):
        rev_display = rev_options.to_display()
        logger.info(
            'Cloning %s%s to %s', redact_password_from_url(url),
            rev_display, display_path(dest),
        )
        self.run_command(['clone', '-q', url, dest])

        if rev_options.rev:
            # Then a specific revision was requested.
            rev_options = self.resolve_revision(dest, url, rev_options)
            branch_name = getattr(rev_options, 'branch_name', None)
            if branch_name is None:
                # Only do a checkout if the current commit id doesn't match
                # the requested revision.
                if not self.is_commit_id_equal(dest, rev_options.rev):
                    cmd_args = ['checkout', '-q'] + rev_options.to_args()
                    self.run_command(cmd_args, cwd=dest)
            elif self.get_current_branch(dest) != branch_name:
                # Then a specific branch was requested, and that branch
                # is not yet checked out.
                track_branch = 'origin/{}'.format(branch_name)
                cmd_args = [
                    'checkout', '-b', branch_name, '--track', track_branch,
                ]
                self.run_command(cmd_args, cwd=dest)

        #: repo may contain submodules
        self.update_submodules(dest) 
开发者ID:V1EngineeringInc,项目名称:V1EngineeringInc-Docs,代码行数:31,代码来源:git.py


注:本文中的pip._internal.utils.misc.redact_password_from_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。