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


Python Uri.is_remote方法代码示例

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


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

示例1: test_is_remote

# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
 def test_is_remote(self):
     uri = Uri('https://example.com', 'rpm-md')
     assert uri.is_remote() is True
     uri = Uri('dir:///path/to/repo', 'rpm-md')
     assert uri.is_remote() is False
开发者ID:ChrisBr,项目名称:kiwi,代码行数:7,代码来源:system_uri_test.py

示例2: test_is_remote_raises_type_error

# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
 def test_is_remote_raises_type_error(self):
     uri = Uri('xtp://download.example.com', 'rpm-md')
     uri.is_remote()
开发者ID:ChrisBr,项目名称:kiwi,代码行数:5,代码来源:system_uri_test.py

示例3: setup_repositories

# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
    def setup_repositories(self, clear_cache=False, signing_keys=None):
        """
        Set up repositories for software installation and return a
        package manager for performing software installation tasks

        :param bool clear_cache: flag the clear cache before configure
            anything
        :param list signing_keys: keys imported to the package manager

        :return: instance of :class:`PackageManager`

        :rtype: PackageManager
        """
        repository_options = []
        repository_sections = \
            self.xml_state.get_repository_sections_used_for_build()
        package_manager = self.xml_state.get_package_manager()
        if self.xml_state.get_rpm_check_signatures():
            repository_options.append('check_signatures')
        if self.xml_state.get_rpm_excludedocs():
            repository_options.append('exclude_docs')
        repo = Repository(
            self.root_bind, package_manager, repository_options
        )
        if signing_keys:
            repo.import_trusted_keys(signing_keys)
        for xml_repo in repository_sections:
            repo_type = xml_repo.get_type()
            repo_source = xml_repo.get_source().get_path()
            repo_user = xml_repo.get_username()
            repo_secret = xml_repo.get_password()
            repo_alias = xml_repo.get_alias()
            repo_priority = xml_repo.get_priority()
            repo_dist = xml_repo.get_distribution()
            repo_components = xml_repo.get_components()
            repo_repository_gpgcheck = xml_repo.get_repository_gpgcheck()
            repo_package_gpgcheck = xml_repo.get_package_gpgcheck()
            log.info('Setting up repository %s', repo_source)
            log.info('--> Type: %s', repo_type)
            if repo_priority:
                log.info('--> Priority: %s', repo_priority)

            uri = Uri(repo_source, repo_type)
            repo_source_translated = uri.translate()
            log.info('--> Translated: %s', repo_source_translated)
            if not repo_alias:
                repo_alias = uri.alias()
            log.info('--> Alias: %s', repo_alias)

            if not uri.is_remote() and not os.path.exists(
                repo_source_translated
            ):
                log.warning(
                    'repository %s does not exist and will be skipped',
                    repo_source
                )
                continue

            if not uri.is_remote():
                self.root_bind.mount_shared_directory(repo_source_translated)

            repo.add_repo(
                repo_alias, repo_source_translated,
                repo_type, repo_priority, repo_dist, repo_components,
                repo_user, repo_secret, uri.credentials_file_name(),
                repo_repository_gpgcheck, repo_package_gpgcheck
            )
            if clear_cache:
                repo.delete_repo_cache(repo_alias)
            self.uri_list.append(uri)
        repo.cleanup_unused_repos()
        return PackageManager(
            repo, package_manager
        )
开发者ID:Conan-Kudo,项目名称:kiwi,代码行数:76,代码来源:prepare.py

示例4: test_is_remote_raises_style_error

# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
 def test_is_remote_raises_style_error(self):
     uri = Uri('xxx', 'rpm-md')
     uri.is_remote()
开发者ID:ChrisBr,项目名称:kiwi,代码行数:5,代码来源:system_uri_test.py

示例5: test_is_remote_in_buildservice

# 需要导入模块: from kiwi.system.uri import Uri [as 别名]
# 或者: from kiwi.system.uri.Uri import is_remote [as 别名]
 def test_is_remote_in_buildservice(
     self, mock_buildservice
 ):
     mock_buildservice.return_value = True
     uri = Uri('obs://openSUSE:Leap:42.2/standard', 'yast2')
     assert uri.is_remote() is False
开发者ID:AdamMajer,项目名称:kiwi-ng,代码行数:8,代码来源:system_uri_test.py


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