Commits

mattip committed 600464f

add a header line of links to the nightly listing pages

Comments (0)

Files changed (2)

bot2/pypybuildbot/pypylist.py

 import urllib
 import sys
 from twisted.web.static import File, DirectoryLister
+from buildbot.status.web.base import path_to_root
 
 class PyPyTarball(object):
 
             Listener = PyPyDirectoryLister
         else:
             names = self.sortDirectoryNames(File.listEntities(self))
-            Listener = DirectoryLister
+            Listener = PyPyDirectoryLister
         return Listener(self.path,
                         names,
                         self.contentTypes,
 class PyPyDirectoryLister(DirectoryLister):
     template = """<html>
 <head>
-<title>%(header)s</title>
+<title>%%(header)s</title>
+    <link rel="stylesheet" href="%(path_to_root)sdefault.css" type="text/css" />
+    <link rel="alternate" type="application/rss+xml" title="RSS" href="%(path_to_root)srss">
+    <link rel="shortcut icon" href="%(path_to_root)sfavicon.ico">
 <style>
 .even        { background-color: #eee    }
 .odd         { background-color: #dedede }
 .listing {
     margin-left: auto;
     margin-right: auto;
-    width: 50%%;
+    width: 50%%%%;
     padding: 0.1em;
     }
 
 </style>
 </head>
 
-<body>
-<h1>%(header)s</h1>
+<body class="interface">
+   <div class="header">
+        <a href="%(path_to_root)s">Home</a>
+        -
+        <!-- PyPy specific items -->
+        <a href="http://speed.pypy.org/">Speed</a>
+        <a href="%(path_to_root)ssummary?branch=&lt;trunk&gt;">Summary (trunk)</a>
+        <a href="%(path_to_root)ssummary">Summary</a>
+        <a href="%(path_to_root)snightly/">Nightly builds</a>
+        <!-- end of PyPy specific items -->
+
+        <a href="%(path_to_root)swaterfall">Waterfall</a>
+        <!-- <a href="%(path_to_root)sgrid">Grid</a> -->
+        <!-- <a href="%(path_to_root)stgrid">T-Grid</a> -->
+        <!-- <a href="%(path_to_root)sconsole">Console</a> -->
+        <a href="%(path_to_root)sbuilders">Builders</a>
+        <!-- <a href="%(path_to_root)sone_line_per_build">Recent Builds</a> -->
+        <!-- <a href="%(path_to_root)sbuildslaves">Buildslaves</a> -->
+        <!-- <a href="%(path_to_root)schanges">Changesources</a> -->
+        <!-- - <a href="%(path_to_root)sjson/help">JSON API</a> -->
+        - <a href="%(path_to_root)sabout">About</a>
+    </div>
+<h1>%%(header)s</h1>
 
 <table>
     <thead>
         </tr>
     </thead>
     <tbody>
-%(tableContent)s
+%%(tableContent)s
     </tbody>
 </table>
 
 
     def render(self, request):
         self.status = request.site.buildbot_service.getStatus()
+        self.template = self.template % {'path_to_root': path_to_root(request)}
         return DirectoryLister.render(self, request)
 
     def _buildTableContent(self, elements):

slave/buildbot.tac

-# -*- mode: python -*-
+
+import os
+
 from twisted.application import service
-try:
-    # 8.x
-    from buildslave.bot import BuildSlave
-except ImportError:
-    #7.x
-    from buildbot.slave.bot import BuildSlave
+from buildslave.bot import BuildSlave
 
-# ---------------------------------------------------------------
-# manual editing of the automatically generated buildbot.tac
-#
-import os.path
-thisfile = os.path.join(os.getcwd(), __file__)
-basedir = os.path.abspath(os.path.dirname(thisfile))
-#
-# ---------------------------------------------------------------
+basedir = r'/home/matti/pypy_stuff/buildbot/slave'
+rotateLength = 10000000
+maxRotatedFiles = 10
 
-def find_passwd(slavename):
-  masterdir = os.path.join(basedir, '..', 'master')
-  slaveinfo = os.path.join(masterdir, 'slaveinfo.py')
-  d = {}
-  try:
-    execfile(slaveinfo, d)
-    return d['passwords'][slavename]
-  except Exception, e:
-    print 'error when executing ../master/slaveinfo.py: %s' % repr(e)
-    print 'using default password for the slave'
-    return 'default_password'
-  
+# if this is a relocatable tac file, get the directory containing the TAC
+if basedir == '.':
+    import os.path
+    basedir = os.path.abspath(os.path.dirname(__file__))
 
-buildmaster_host = 'localhost'
-port = 10407
-slavename = 'localhost'
-passwd = find_passwd(slavename)
-keepalive = 600
-usepty = 0
-umask = None
-maxdelay = 300
-rotateLength = 1000000
-maxRotatedFiles = None
+# note: this line is matched against to check that this is a buildslave
+# directory; do not edit it.
+application = service.Application('buildslave')
 
-application = service.Application('buildslave')
 try:
   from twisted.python.logfile import LogFile
   from twisted.python.log import ILogObserver, FileLogObserver
-  logfile = LogFile.fromFullPath("twistd.log", rotateLength=rotateLength,
+  logfile = LogFile.fromFullPath(os.path.join(basedir, "twistd.log"), rotateLength=rotateLength,
                                  maxRotatedFiles=maxRotatedFiles)
   application.setComponent(ILogObserver, FileLogObserver(logfile).emit)
 except ImportError:
   # probably not yet twisted 8.2.0 and beyond, can't set log yet
   pass
+
+buildmaster_host = 'localhost'
+port = 10407
+slavename = 'localhost'
+passwd = 'stam'
+keepalive = 600
+usepty = 0
+umask = None
+maxdelay = 300
+allow_shutdown = None
+
 s = BuildSlave(buildmaster_host, port, slavename, passwd, basedir,
-               keepalive, usepty, umask=umask, maxdelay=maxdelay)
+               keepalive, usepty, umask=umask, maxdelay=maxdelay,
+               allow_shutdown=allow_shutdown)
 s.setServiceParent(application)