OLD | NEW |
---|---|
1 # This file is part of Buildbot. Buildbot is free software: you can | 1 # This file is part of Buildbot. Buildbot is free software: you can |
2 # redistribute it and/or modify it under the terms of the GNU General Public | 2 # redistribute it and/or modify it under the terms of the GNU General Public |
3 # License as published by the Free Software Foundation, version 2. | 3 # License as published by the Free Software Foundation, version 2. |
4 # | 4 # |
5 # This program is distributed in the hope that it will be useful, but WITHOUT | 5 # This program is distributed in the hope that it will be useful, but WITHOUT |
6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
8 # details. | 8 # details. |
9 # | 9 # |
10 # You should have received a copy of the GNU General Public License along with | 10 # You should have received a copy of the GNU General Public License along with |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 step['time_to_run'] = "" | 114 step['time_to_run'] = "" |
115 | 115 |
116 cxt['steps'].append(step) | 116 cxt['steps'].append(step) |
117 | 117 |
118 step['link'] = req.childLink("steps/%s" % urllib.quote(s.getName(), | 118 step['link'] = req.childLink("steps/%s" % urllib.quote(s.getName(), |
119 safe='')) | 119 safe='')) |
120 step['text'] = " ".join(s.getText()) | 120 step['text'] = " ".join(s.getText()) |
121 step['urls'] = map(lambda x:dict(url=x[1],logname=x[0]), s.getURLs() .items()) | 121 step['urls'] = map(lambda x:dict(url=x[1],logname=x[0]), s.getURLs() .items()) |
122 step['nest_level'] = s.getNestLevel() | 122 step['nest_level'] = s.getNestLevel() |
123 | 123 |
124 step['aliases'] = {} | |
125 for base, aliases in s.getAliases().iteritems(): | |
126 step['aliases'][base] = [{ | |
127 'text': a[0], | |
128 'url': a[1], | |
129 } for a in aliases] | |
130 | |
131 step['logs']= [] | 124 step['logs']= [] |
132 | 125 |
133 for l in s.getLogs(): | 126 for l in s.getLogs(): |
134 logname = l.getName() | 127 logname = l.getName() |
135 step['logs'].append({ 'link': req.childLink("steps/%s/logs/%s" % | 128 step['logs'].append({ 'link': req.childLink("steps/%s/logs/%s" % |
136 (urllib.quote(s.getName(), safe=''), | 129 (urllib.quote(s.getName(), safe=''), |
137 urllib.quote(logname, safe=''))), | 130 urllib.quote(logname, safe=''))), |
138 'name': logname }) | 131 'name': logname }) |
139 | 132 |
133 step['aliases'] = {} | |
134 seen_aliases = set() | |
135 for base, aliases in s.getAliases().iteritems(): | |
136 step['aliases'][base] = [{ | |
137 'text': a[0], | |
138 'url': a[1], | |
139 } for a in aliases] | |
140 seen_aliases.add(base) | |
141 | |
142 seen_aliases.difference_update(s['logname'] for s in step['urls']) | |
143 seen_aliases.difference_update(s['name'] for s in step['logs']) | |
144 | |
145 # Append link-less log anchors for unbased aliases to attach to. | |
146 # | |
147 # We include an empty link so that custom templates that don't | |
148 # support aliases don't crash when trying to render these anchors. | |
149 # This will cause waterfalls that have alias data but haven't | |
150 # updated their templates to render them to show blank links. This | |
151 # is okay, since waterfalls that accept alias data should have | |
152 # their templates updated to render this data. | |
153 for base in sorted(seen_aliases): | |
154 step['logs'].append({'name': base, 'link': ''}) | |
155 | |
dnj
2016/04/13 15:39:59
Note: because templates are immediately loaded pos
| |
140 ps = cxt['properties'] = [] | 156 ps = cxt['properties'] = [] |
141 for name, value, source in b.getProperties().asList(): | 157 for name, value, source in b.getProperties().asList(): |
142 value = str(value) | 158 value = str(value) |
143 p = { 'name': name, 'value': value, 'source': source} | 159 p = { 'name': name, 'value': value, 'source': source} |
144 if len(value) > 500: | 160 if len(value) > 500: |
145 p['short_value'] = value[:500] | 161 p['short_value'] = value[:500] |
146 | 162 |
147 ps.append(p) | 163 ps.append(p) |
148 | 164 |
149 | 165 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 try: | 278 try: |
263 num = int(path) | 279 num = int(path) |
264 except ValueError: | 280 except ValueError: |
265 num = None | 281 num = None |
266 if num is not None: | 282 if num is not None: |
267 build_status = self.builder_status.getBuild(num) | 283 build_status = self.builder_status.getBuild(num) |
268 if build_status: | 284 if build_status: |
269 return StatusResourceBuild(build_status) | 285 return StatusResourceBuild(build_status) |
270 | 286 |
271 return HtmlResource.getChild(self, path, req) | 287 return HtmlResource.getChild(self, path, req) |
OLD | NEW |