def _handle_builder(self, req): m = self.BUILDER_RE.match(req.path_info) try: builder = m.group(1) or None except Exception as e: builder = None master = BuildBotSystem(self.buildbot_url) if builder is None: data = {'names': master.getAllBuilders()} return 'bbw_allbuilders.html', data, 'text/html' else: class Foo: pass b = Foo() b.name = str(builder) b.current = 'CURRENT-TEXT' b.recent = [] b.slaves = [] data = {'builder': b} try: master = BuildBotSystem(self.buildbot_url) data = {'builder': master.getBuilder(builder)} except Exception as e: print('Error fetching builder stats', e) data['context'] = Context.from_request(req, ('buildbot', builder)) return 'bbw_builder.html', data, 'text/html'
except Exception, e: builder = None master = BuildBotSystem(self.buildbot_url) if builder is None: data = { 'names': master.getAllBuilders() } return 'bbw_allbuilders.html', data, 'text/html' else: class Foo: pass b = Foo() b.name = str(builder) b.current = 'CURRENT-TEXT' b.recent = [] b.slaves = [] data = { 'builder': b } try: master = BuildBotSystem(self.buildbot_url) data = { 'builder': master.getBuilder(builder) } except Exception, e: print 'Error fetching builder stats', e data['context'] = Context.from_request(req, ('buildbot', builder)) return 'bbw_builder.html', data, 'text/html' def match_request(self, req): return req.path_info.startswith('/buildbot') and 1 or 0 def process_request(self, req): if req.path_info.startswith('/buildbot/builder'): return self._handle_builder(req) return 'bbw_welcome.html', { 'url': self.buildbot_url }, 'text/html'
master = BuildBotSystem(self.buildbot_url) if builder is None: data = {'names': master.getAllBuilders()} return 'bbw_allbuilders.html', data, 'text/html' else: class Foo: pass b = Foo() b.name = str(builder) b.current = 'CURRENT-TEXT' b.recent = [] b.slaves = [] data = {'builder': b} try: master = BuildBotSystem(self.buildbot_url) data = {'builder': master.getBuilder(builder)} except Exception, e: print 'Error fetching builder stats', e data['context'] = Context.from_request(req, ('buildbot', builder)) return 'bbw_builder.html', data, 'text/html' def match_request(self, req): return req.path_info.startswith('/buildbot') and 1 or 0 def process_request(self, req): if req.path_info.startswith('/buildbot/builder'): return self._handle_builder(req) return 'bbw_welcome.html', {'url': self.buildbot_url}, 'text/html'