PageRenderTime 216ms CodeModel.GetById 80ms app.highlight 13ms RepoModel.GetById 118ms app.codeStats 0ms

/kai/controllers/buildbot2.py

https://bitbucket.org/bbangert/kai/
Python | 31 lines | 25 code | 6 blank | 0 comment | 3 complexity | 32f9191294cf03f616f2a3a171e8d2dc MD5 | raw file
 1import logging
 2
 3from pylons import request, response, session, tmpl_context as c
 4from pylons.controllers.util import abort, redirect_to
 5
 6from kai.lib.base import BaseController, render
 7from kai.lib.buildbot import recent_builds, build_info
 8
 9log = logging.getLogger(__name__)
10
11class BuildbotController(BaseController):
12    def __before__(self):
13        c.active_tab = 'Code'
14        c.active_sub = 'Buildbots'
15
16    def index(self):
17        builds = recent_builds(20)
18        releases = {}
19        dev = {}
20        for ver in builds:
21            if ver.startswith('Release'):
22                releases[ver] = builds[ver]
23            else:
24                dev[ver] =  builds[ver]
25        c.releases, c.dev = releases, dev
26        return render('/buildbot/index.mako')
27    
28    def details(self, id):
29        buildname, version = id.split('__')
30        c.details = build_info(buildname, version)
31        return render('/buildbot/details.mako')