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