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


Python ConanInfo.dumps方法代码示例

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


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

示例1: basic_test2

# 需要导入模块: from conans.model.info import ConanInfo [as 别名]
# 或者: from conans.model.info.ConanInfo import dumps [as 别名]
    def basic_test2(self):
        conan_ref1 = ConanFileReference.loads("opencv/[email protected]/testing")
        root_folder = str(conan_ref1).replace("@", "/")
        artifacts = ["a", "b", "c"]
        reg1 = "%s/%s" % (root_folder, EXPORT_FOLDER)
        os.makedirs(reg1)
        for artif_id in artifacts:
            build1 = "%s/%s/%s" % (root_folder, BUILD_FOLDER, artif_id)
            artif1 = "%s/%s/%s" % (root_folder, PACKAGES_FOLDER, artif_id)
            os.makedirs(build1)
            info = ConanInfo().loads("[settings]\n[options]")
            save(os.path.join(artif1, CONANINFO), info.dumps())

        packages = self.search_manager.search_packages(conan_ref1, "")
        all_artif = [_artif for _artif in sorted(packages)]
        self.assertEqual(all_artif, artifacts)
开发者ID:conan-io,项目名称:conan,代码行数:18,代码来源:disk_search_test.py

示例2: basic_test2

# 需要导入模块: from conans.model.info import ConanInfo [as 别名]
# 或者: from conans.model.info.ConanInfo import dumps [as 别名]
    def basic_test2(self):
        folder = temp_folder()
        paths = SimplePaths(folder)
        search_adapter = DiskSearchAdapter()
        search_manager = DiskSearchManager(paths, search_adapter)

        os.chdir(paths.store)

        root_folder1 = "opencv/2.4.10/lasote/testing"
        conan_ref1 = ConanFileReference.loads("opencv/[email protected]/testing")

        artif_id1 = "awqfwf44we5f425fw"
        artif_id2 = "b5wc4q5frg45rgv1g"
        artif_id3 = "cf838regrg783g453"

        reg1 = "%s/%s" % (root_folder1, EXPORT_FOLDER)
        build1 = "%s/%s/%s" % (root_folder1, BUILD_FOLDER, artif_id1)
        artif1 = "%s/%s/%s" % (root_folder1, PACKAGES_FOLDER, artif_id1)
        artif2 = "%s/%s/%s" % (root_folder1, PACKAGES_FOLDER, artif_id2)
        artif3 = "%s/%s/%s" % (root_folder1, PACKAGES_FOLDER, artif_id3)
        os.makedirs(reg1)
        os.makedirs(build1)
        os.makedirs(artif1)
        os.makedirs(artif2)
        os.makedirs(artif3)

        for package_path in [artif1, artif2, artif3]:
            info = ConanInfo().loads("[settings]\n[options]")
            save(os.path.join(paths.store, package_path, CONANINFO),
                 info.dumps())

        packages = search_manager.search_packages(conan_ref1, "")
        all_artif = [_artif for _artif in sorted(packages)]
        self.assertEqual(all_artif, [artif_id1, artif_id2, artif_id3])

        root_folder2 = "sdl/1.5/lasote/stable"
        conan_ref2 = ConanFileReference.loads("sdl/[email protected]/stable")
        os.makedirs("%s/%s" % (root_folder2, EXPORT_FOLDER))

        root_folder3 = "assimp/0.14/phil/testing"
        conan_ref3 = ConanFileReference.loads("assimp/[email protected]/testing")
        os.makedirs("%s/%s" % (root_folder3, EXPORT_FOLDER))

        root_folder4 = "sdl/2.10/lasote/stable"
        conan_ref4 = ConanFileReference.loads("sdl/[email protected]/stable")
        os.makedirs("%s/%s" % (root_folder4, EXPORT_FOLDER))

        root_folder5 = "SDL_fake/1.10/lasote/testing"
        conan_ref5 = ConanFileReference.loads("SDL_fake/[email protected]/testing")
        os.makedirs("%s/%s" % (root_folder5, EXPORT_FOLDER))

        # Case insensitive searches
        search_adapter = DiskSearchAdapter()
        search_manager = DiskSearchManager(paths, search_adapter)

        reg_conans = sorted([str(_reg) for _reg in search_manager.search("*")])
        self.assertEqual(reg_conans, [str(conan_ref5),
                                      str(conan_ref3),
                                      str(conan_ref1),
                                      str(conan_ref2),
                                      str(conan_ref4)])

        reg_conans = sorted([str(_reg) for _reg in search_manager.search(pattern="sdl*")])
        self.assertEqual(reg_conans, [str(conan_ref5), str(conan_ref2), str(conan_ref4)])

        # Case sensitive search
        self.assertEqual(str(search_manager.search(pattern="SDL*", ignorecase=False)[0]),
                         str(conan_ref5))
开发者ID:lasote,项目名称:conan,代码行数:70,代码来源:paths_test.py


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