當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。