comparison bitten/web_ui.py @ 875:a68027e2245d

Add 'Platform' name to build report for web display and notifications. Fixes #541 and #633.
author osimons
date Thu, 21 Oct 2010 08:41:16 +0000
parents e695efec5b28
children dfbf2f857a50
comparison
equal deleted inserted replaced
874:e695efec5b28 875:a68027e2245d
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)
Copyright (C) 2012-2017 Edgewall Software