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


Python ConanMultiPackager.deserialize方法代码示例

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


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

示例1: testSerialize

# 需要导入模块: from conan.packager import ConanMultiPackager [as 别名]
# 或者: from conan.packager.ConanMultiPackager import deserialize [as 别名]
    def testSerialize(self):
        self.packager.add({"os": "Windows", "compiler": "Visual Studio"},
                          {"option1": "value1", "option2": "value2"})

        serial = self.packager.serialize()
        self.assertEquals(serial, '{"username": "lasote", "conan_pip_package": null, "args": "--build missing -r conan.io", '\
                          '"builds": [[{"os": "Windows", "compiler": "Visual Studio"}, '\
                          '{"option2": "value2", "option1": "value1"}]], "channel": "mychannel"}')

        mp = ConanMultiPackager.deserialize(serial, username="lasote")
        self.assertEqual(mp.conan_pip_package, None)

        self.packager.conan_pip_package = "conan==0.0.1rc7"
        serial = self.packager.serialize()
        mp = ConanMultiPackager.deserialize(serial, username="lasote")
        self.assertEqual(mp.conan_pip_package, "conan==0.0.1rc7")
开发者ID:Chaosteil,项目名称:conan-package-tools,代码行数:18,代码来源:app_tests.py

示例2: run

# 需要导入模块: from conan.packager import ConanMultiPackager [as 别名]
# 或者: from conan.packager.ConanMultiPackager import deserialize [as 别名]
def run():
    """Reads environment json to create a ConanMultiPackager,
    It can run packages with pagination with
    CONAN_TOTAL_PAGES and CONAN_CURRENT_PAGE"""
    the_json = os.getenv("CONAN_BUILDER_ENCODED", None)
    current_page = int(os.getenv("CONAN_CURRENT_PAGE", "1"))
    total_pages = int(os.getenv("CONAN_TOTAL_PAGES", "1"))

    builder = ConanMultiPackager.deserialize(the_json)
    builder.pack(current_page, total_pages)
开发者ID:Chaosteil,项目名称:conan-package-tools,代码行数:12,代码来源:conan_json_packager.py


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