bbangert / Kai

Kai is a Pylons web app that runs the PylonsHQ.com site. It has a simple blog, RSS feeds, pastebin, traceback repository, snippets, and documentation.

Clone this repository (size: 10.4 MB): HTTPS / SSH
$ hg clone http://bitbucket.org/bbangert/kai/
commit 262: e837ad92d7cb
parent 261: a559341bd341
branch: default
Move buildbot controller around
Ben Bangert / bbangert
8 weeks ago

Changed (Δ943 bytes):

raw changeset »

LICENSE (1 lines added, 1 lines removed)

kai/config/routing.py (2 lines added, 2 lines removed)

kai/controllers/buildbot.py

kai/controllers/buildbot2.py (31 lines added, 0 lines removed)

Up to file-list LICENSE:

1
Copyright (c) 2008-2009, Ben Bangert and contributors.
1
Copyright (c) 2008-2010, Ben Bangert and contributors.
2
2
All rights reserved.
3
3
4
4
Redistribution and use in source and binary forms, with or without

Up to file-list kai/config/routing.py:

@@ -125,7 +125,7 @@ def make_map(globs=None):
125
125
    map.connect('jinja2', 'http://jinja.pocoo.org/', _static=True)
126
126
    map.connect('pylons_book', 'http://pylonsbook.com/', _static=True)
127
127
128
    # map.connect('/{controller}/{action}')
129
    # map.connect('/{controller}/{action}/{id}')
128
    map.connect('/{controller}/{action}')
129
    map.connect('/{controller}/{action}/{id}')
130
130
131
131
    return map

Up to file-list kai/controllers/buildbot2.py:

1
import logging
2
3
from pylons import request, response, session, tmpl_context as c
4
from pylons.controllers.util import abort, redirect_to
5
6
from kai.lib.base import BaseController, render
7
from kai.lib.buildbot import recent_builds, build_info
8
9
log = logging.getLogger(__name__)
10
11
class 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')