[Buildbot-devel] Jinja templates

Jean-Michel Beuken jean-michel.beuken at uclouvain.be
Mon Mar 22 20:38:04 UTC 2010


Hello,

on my production environment (bb 0.7.12, tw 8.2.0),
I use this useful code, found in the net,  to show elapsed time for each 
steps in waterfall :

-------------------------------------------------------------------
####### OUTPUT TWEAKING
from twisted.python import components
from buildbot.status.web import waterfall
from buildbot.status.web.base import IBox
from buildbot.status import builder

class StepBox(waterfall.StepBox):
    def getBox(self, req):
        box = waterfall.StepBox.getBox(self, req)
[...]
        box.text.append('<span class="duration">%s</span>' % duration)
        return box
-------------------------------------------------------------------

Now, I have recently installed  the new version of buildbot on a test 
machine :

Version Information
    Buildbot: latest
    Twisted: 10.0.0
    Jinja: 2.3.1
    Python: 2.6.5 (r265:79063, Mar 22 2010, 00:27:11) [GCC 4.1.2 
20080704 (Red Hat 4.1.2-46)]
    Buildmaster platform: linux2

obviously, this code doesn't work : "<type 'exceptions.AttributeError'>: 
'unicode' object has no attribute 'append'"

as a tutorial, someone can show me how to transform this code to a 
"jinja"  code ?

thanks in advance,

regards

jmb
 
-- 
----------------------------------------------------
Jean-Michel Beuken
Computer Scientist
Software Engineer for ETSF

Universite catholique de Louvain-La-Neuve
Lab. PCPM/FSA, Bat. BOLTZMANN
1,Place Croix du Sud
1348 Louvain-la-Neuve BELGIUM
----------------------------------------------------
Tel : (3210) 473570 Fax : (3210) 473452
HTTP://www.pcpm.ucl.ac.be/~beuken
----------------------------------------------------




More information about the devel mailing list