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


Python SCMDetector.timestamp_of_latest_commit方法代码示例

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


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

示例1: _generate_results_dict

# 需要导入模块: from webkitpy.common.checkout.scm.detection import SCMDetector [as 别名]
# 或者: from webkitpy.common.checkout.scm.detection.SCMDetector import timestamp_of_latest_commit [as 别名]
    def _generate_results_dict(self, timestamp, description, platform, builder_name, build_number):
        contents = {'tests': {}}
        if description:
            contents['description'] = description

        revisions = {}
        for (name, path) in self._port.repository_paths():
            scm = SCMDetector(self._host.filesystem, self._host.executive).detect_scm_system(path) or self._host.scm()
            revision = scm.svn_revision(path)
            revisions[name] = {'revision': str(revision), 'timestamp': scm.timestamp_of_latest_commit(path, revision)}

        meta_info = {
            'buildTime': self._datetime_in_ES5_compatible_iso_format(self._utc_timestamp),
            'platform': platform,
            'revisions': revisions,
            'builderName': builder_name,
            'buildNumber': int(build_number) if build_number else None}

        for key, value in meta_info.items():
            if value:
                contents[key] = value

        # FIXME: Make this function shorter once we've transitioned to use perf.webkit.org.
        for metric_full_name, result in self._results.iteritems():
            if not isinstance(result, dict):  # We can't reports results without indivisual measurements.
                continue

            assert metric_full_name.count(':') <= 1
            test_full_name, _, metric = metric_full_name.partition(':')
            if not metric:
                metric = {'fps': 'FrameRate', 'runs/s': 'Runs', 'ms': 'Time'}[result['unit']]

            tests = contents['tests']
            path = test_full_name.split('/')
            for i in range(0, len(path)):
                # FIXME: We shouldn't assume HTML extension.
                is_last_token = i + 1 == len(path)
                url = 'http://trac.webkit.org/browser/trunk/PerformanceTests/' + '/'.join(path[0:i + 1])
                if is_last_token:
                    url += '.html'

                tests.setdefault(path[i], {'url': url})
                current_test = tests[path[i]]
                if is_last_token:
                    current_test.setdefault('metrics', {})
                    assert metric not in current_test['metrics']
                    current_test['metrics'][metric] = {'current': result['values']}
                else:
                    current_test.setdefault('tests', {})
                    tests = current_test['tests']

        return contents
开发者ID:,项目名称:,代码行数:54,代码来源:


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