當前位置: 首頁>>代碼示例>>Python>>正文


Python Build.build_number方法代碼示例

本文整理匯總了Python中webkitpy.common.net.buildbot.Build.build_number方法的典型用法代碼示例。如果您正苦於以下問題:Python Build.build_number方法的具體用法?Python Build.build_number怎麽用?Python Build.build_number使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在webkitpy.common.net.buildbot.Build的用法示例。


在下文中一共展示了Build.build_number方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: latest_try_jobs

# 需要導入模塊: from webkitpy.common.net.buildbot import Build [as 別名]
# 或者: from webkitpy.common.net.buildbot.Build import build_number [as 別名]
    def latest_try_jobs(self, issue_number, builder_names=None, patchset_number=None):
        """Returns a list of Build objects for builds on the latest patchset.

        Args:
            issue_number: A Rietveld issue number.
            builder_names: A collection of builder names. If specified, only results
                from the given list of builders will be kept.
            patchset_number: If given, a specific patchset will be used instead of the latest one.

        Returns:
            A list of Build objects, where Build objects for completed jobs have a build number,
            and Build objects for pending jobs have no build number.
        """
        try:
            if patchset_number:
                url = self._patchset_url(issue_number, patchset_number)
            else:
                url = self._latest_patchset_url(issue_number)
            patchset_data = self._get_json(url)
        except (urllib2.URLError, ValueError):
            return []

        builds = []
        for result_dict in patchset_data["try_job_results"]:
            build = Build(result_dict["builder"], result_dict["buildnumber"])
            # Normally, a value of -1 or 6 in the "result" field indicates the job is
            # started or pending, and the "buildnumber" field is null.
            if build.build_number and result_dict["result"] in (-1, 6):
                _log.warning(
                    "Build %s has result %d, but unexpectedly has a build number.", build, result_dict["result"]
                )
                build.build_number = None
            builds.append(build)

        if builder_names is not None:
            builds = [b for b in builds if b.builder_name in builder_names]

        return self._filter_latest_builds(builds)
開發者ID:,項目名稱:,代碼行數:40,代碼來源:


注:本文中的webkitpy.common.net.buildbot.Build.build_number方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。