[Buildbot-commits] buildbot/buildbot/status/web base.py, 1.3, 1.4 baseweb.py, 1.8, 1.9 waterfall.py, 1.8, 1.9

Brian Warner warner at users.sourceforge.net
Wed Aug 1 22:09:17 UTC 2007


Update of /cvsroot/buildbot/buildbot/buildbot/status/web
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29737/buildbot/status/web

Modified Files:
	base.py baseweb.py waterfall.py 
Log Message:
[project @ WebStatus: remove css= argument, all pages use root/buildbot.css]

Original author: warner at lothar.com
Date: 2007-08-01 02:37:35+00:00

Index: base.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/base.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- base.py	1 Aug 2007 22:08:47 -0000	1.3
+++ base.py	1 Aug 2007 22:09:15 -0000	1.4
@@ -124,7 +124,6 @@
 
 class HtmlResource(resource.Resource):
     # this is a cheap sort of template thingy
-    css = None
     contentType = "text/html; charset=UTF-8"
     title = "Dummy"
 
@@ -161,13 +160,6 @@
         values['title'] = self.getTitle(request)
         return template % values
 
-    def getCSSlink(self, request):
-        css = request.site.css # might be None
-        if not css:
-            return None
-        url = "/".join([".." * self.depth] + [css])
-        return url
-
     def content(self, request):
         s = request.site.buildbot_service
         data = ""

Index: baseweb.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/baseweb.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- baseweb.py	1 Aug 2007 22:09:11 -0000	1.8
+++ baseweb.py	1 Aug 2007 22:09:15 -0000	1.9
@@ -253,12 +253,16 @@
     bottom.
 
     This webserver defines class attributes on elements so they can be styled
-    with CSS stylesheets. Buildbot uses some generic classes to identify the
-    type of object, and some more specific classes for the various kinds of
-    those types. It does this by specifying both in the class attributes
-    where applicable, separated by a space. It is important that in your CSS
-    you declare the more generic class styles above the more specific ones.
-    For example, first define a style for .Event, and below that for .SUCCESS
+    with CSS stylesheets. All pages pull in public_html/buildbot.css, and you
+    can cause additional stylesheets to be loaded by adding a suitable <link>
+    to the WebStatus instance's .head_elements attribute.
+
+    Buildbot uses some generic classes to identify the type of object, and
+    some more specific classes for the various kinds of those types. It does
+    this by specifying both in the class attributes where applicable,
+    separated by a space. It is important that in your CSS you declare the
+    more generic class styles above the more specific ones. For example,
+    first define a style for .Event, and below that for .SUCCESS
 
     The following CSS class names are used:
         - Activity, Event, BuildStep, LastBuild: general classes
@@ -275,8 +279,7 @@
     # we are not a ComparableMixin, and therefore the webserver will be
     # rebuilt every time we reconfig.
 
-    def __init__(self, http_port=None, distrib_port=None,
-                 allowForce=False, css="buildbot.css"):
+    def __init__(self, http_port=None, distrib_port=None, allowForce=False):
         """Run a web server that provides Buildbot status.
 
         @type  http_port: int or L{twisted.application.strports} string
@@ -311,9 +314,6 @@
                              the strports parser.
         @param allowForce: boolean, if True then the webserver will allow
                            visitors to trigger and cancel builds
-        @param css: a URL. If set, the header of each generated page will
-                    include a link to add the given URL as a CSS stylesheet
-                    for the page.
         """
 
         service.MultiService.__init__(self)
@@ -327,7 +327,6 @@
                 distrib_port = "unix:%s" % distrib_port
         self.distrib_port = distrib_port
         self.allowForce = allowForce
-        self.css = css
 
         # this will be replaced once we've been attached to a parent (and
         # thus have a basedir and can reference BASEDIR/public_html/)
@@ -443,11 +442,14 @@
     def __init__(self, http_port=None, distrib_port=None, allowForce=True,
                  categories=None, css=buildbot_css, favicon=buildbot_icon,
                  robots_txt=None):
-        WebStatus.__init__(self, http_port, distrib_port, allowForce, css)
+        WebStatus.__init__(self, http_port, distrib_port, allowForce)
+        self.css = css
+        self.favicon = favicon
+        self.robots_txt = robots_txt
         if favicon:
             data = open(favicon, "rb").read()
             self.putChild("favicon.ico", static.Data(data, "image/x-icon"))
         if robots_txt:
             data = open(robots_txt, "rb").read()
             self.putChild("robots.txt", static.Data(data, "text/plain"))
-        self.putChild("", WaterfallStatusResource(categories, css))
+        self.putChild("", WaterfallStatusResource(categories))

Index: waterfall.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/status/web/waterfall.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- waterfall.py	1 Aug 2007 22:08:32 -0000	1.8
+++ waterfall.py	1 Aug 2007 22:09:15 -0000	1.9
@@ -238,10 +238,9 @@
     """This builds the main status page, with the waterfall display, and
     all child pages."""
 
-    def __init__(self, categories=None, css=None):
+    def __init__(self, categories=None):
         HtmlResource.__init__(self)
         self.categories = categories
-        self.css = css
 
     def getTitle(self, request):
         status = self.getStatus(request)





More information about the Commits mailing list