comparison bitten/web_ui.py @ 876:30134493d3c6 0.6.x

0.6dev: Merged [952:953] from trunk.
author osimons
date Thu, 21 Oct 2010 09:36:28 +0000
parents 8df9bc903edb
children 6b319a8ae32e
comparison
equal deleted inserted replaced
873:4b6ca8cfd8c6 876:30134493d3c6
52 _step_status_label = {BuildStep.SUCCESS: 'success', 52 _step_status_label = {BuildStep.SUCCESS: 'success',
53 BuildStep.FAILURE: 'failed', 53 BuildStep.FAILURE: 'failed',
54 BuildStep.IN_PROGRESS: 'in progress'} 54 BuildStep.IN_PROGRESS: 'in progress'}
55 55
56 def _get_build_data(env, req, build): 56 def _get_build_data(env, req, build):
57 platform = TargetPlatform.fetch(env, build.platform)
57 data = {'id': build.id, 'name': build.slave, 'rev': build.rev, 58 data = {'id': build.id, 'name': build.slave, 'rev': build.rev,
58 'status': _status_label[build.status], 59 'status': _status_label[build.status],
60 'platform': getattr(platform, 'name', 'unknown'),
59 'cls': _status_label[build.status].replace(' ', '-'), 61 'cls': _status_label[build.status].replace(' ', '-'),
60 'href': req.href.build(build.config, build.id), 62 'href': req.href.build(build.config, build.id),
61 'chgset_href': req.href.changeset(build.rev)} 63 'chgset_href': req.href.changeset(build.rev)}
62 if build.started: 64 if build.started:
63 data['started'] = format_datetime(build.started) 65 data['started'] = format_datetime(build.started)
319 321
320 current_builds = 0 322 current_builds = 0
321 builds = [] 323 builds = []
322 # sort correctly by revision. 324 # sort correctly by revision.
323 for build in sorted(in_progress_builds, 325 for build in sorted(in_progress_builds,
324 cmp=lambda x, y: int(y.rev) - int(x.rev)): 326 cmp=lambda x, y: int(y.rev_time) - int(x.rev_time)):
325 rev = build.rev 327 rev = build.rev
326 build_data = _get_build_data(self.env, req, build) 328 build_data = _get_build_data(self.env, req, build)
327 build_data['rev'] = rev 329 build_data['rev'] = rev
328 build_data['rev_href'] = req.href.changeset(rev) 330 build_data['rev_href'] = req.href.changeset(rev)
329 platform = TargetPlatform.fetch(self.env, build.platform) 331 platform = TargetPlatform.fetch(self.env, build.platform)
Copyright (C) 2012-2017 Edgewall Software