Package buildbot :: Package status :: Package web :: Module base
[frames] | no frames]

Module base

source code

Classes
  ITopBox
I represent a box in the top row of the waterfall display: the one which shows the status of the last build for each builder.
  ICurrentBox
I represent the 'current activity' box, just above the builder name.
  IBox
I represent a box in the waterfall display.
  IHTMLLog
  Box
  ContextMixin
  HtmlResource
  StaticHTML
  DirectoryLister
This variant of the static.DirectoryLister uses a template for rendering.
  StaticFile
This class adds support for templated directory views.
  BuildLineMixin
  AlmostStrictUndefined
An undefined that allows boolean testing but fails properly on every other use.
Functions
 
getAndCheckProperties(req)
Fetch custom build properties from the HTTP request of a "Force build" or "Resubmit build" HTML form.
source code
 
build_get_class(b)
Return the class to use for a finished build or buildstep, based on the result.
source code
 
path_to_root(request) source code
 
path_to_authfail(request) source code
 
path_to_builder(request, builderstatus) source code
 
path_to_build(request, buildstatus) source code
 
path_to_step(request, stepstatus) source code
 
path_to_slave(request, slave) source code
 
path_to_change(request, change) source code
 
plural(word, words, num) source code
 
abbreviate_age(age) source code
 
map_branches(branches) source code
 
createJinjaEnv(revlink=None, changecommentlink=None, repositories=None, projects=None)
Create a jinja environment changecommentlink is used to render HTML in the WebStatus and for mail changes
source code
 
emailfilter(value)
Escape & obfuscate e-mail addresses
source code
 
userfilter(value)
Hide e-mail address from user name when viewing changes
source code
 
shortrevfilter(replace, templates)
Returns a function which shortens the revisison string to 12-chars (chosen as this is the Mercurial short-id length) and add link if replacement string is set.
source code
 
revlinkfilter(replace, templates)
Returns a function which adds an url link to a revision identifiers.
source code
 
changelinkfilter(changelink)
Returns function that does regex search/replace in comments to add links to bug ids and similar.
source code
 
dictlinkfilter(links)
A filter that encloses the given value in a link tag given that the value exists in the dictionary
source code
Variables
  css_classes = {None: '', 0: 'success', 1: 'warnings', 2: 'fail...
  have_DirectoryLister = True
  MINUTE = 60
  HOUR = 3600
  DAY = 86400
  WEEK = 604800
  MONTH = 2592000
Function Details

getAndCheckProperties(req)

source code 

Fetch custom build properties from the HTTP request of a "Force build" or "Resubmit build" HTML form. Check the names for valid strings, and return None if a problem is found. Return a new Properties object containing each property found in req.

createJinjaEnv(revlink=None, changecommentlink=None, repositories=None, projects=None)

source code 

Create a jinja environment changecommentlink is used to render HTML in the WebStatus and for mail changes

Parameters:
  • changecommentlink (None, tuple (2 or 3 strings), dict (string -> 2- or 3-tuple) or callable) - see changelinkfilter()
  • revlink (None, format-string, dict (repository -> format string) or callable) - see revlinkfilter()
  • repositories (None or dict (string -> url)) - an (optinal) mapping from repository identifiers (as given by Change sources) to URLs. Is used to create a link on every place where a repository is listed in the WebStatus.
  • projects (None or dict (string -> url)) - similar to repositories, but for projects.

emailfilter(value)

source code 

Escape & obfuscate e-mail addresses

replacing @ with <span style="display:none> reportedly works well against web-spiders and the next level is to use rot-13 (or something) and decode in javascript

userfilter(value)

source code 

Hide e-mail address from user name when viewing changes

We still include the (obfuscated) e-mail so that we can show it on mouse-over or similar etc

shortrevfilter(replace, templates)

source code 

Returns a function which shortens the revisison string to 12-chars (chosen as this is the Mercurial short-id length) and add link if replacement string is set.

(The full id is still visible in HTML, for mouse-over events etc.)

Parameters:
  • replace - see revlinkfilter()
  • templates - a jinja2 environment

revlinkfilter(replace, templates)

source code 
Returns a function which adds an url link to a 
revision identifiers.

Takes same params as shortrevfilter()

@param replace: either a python format string with an %s,
                or a dict mapping repositories to format strings,
                or a callable taking (revision, repository) arguments
                  and return an URL (or None, if no URL is available),
                or None, in which case revisions do not get decorated 
                  with links

@param templates: a jinja2 environment

changelinkfilter(changelink)

source code 
Returns function that does regex search/replace in 
comments to add links to bug ids and similar.

@param changelink: 
    Either C{None}
    or: a tuple (2 or 3 elements) 
        1. a regex to match what we look for 
        2. an url with regex refs (\g<0>, , , etc) that becomes the 'href' attribute
        3. (optional) an title string with regex ref regex 
    or: a dict mapping projects to above tuples
        (no links will be added if the project isn't found)
    or: a callable taking (changehtml, project) args 
        (where the changetext is HTML escaped in the 
        form of a jinja2.Markup instance) and
        returning another jinja2.Markup instance with 
        the same change text plus any HTML tags added to it.            


Variables Details

css_classes

Value:
{None: '',
 0: 'success',
 1: 'warnings',
 2: 'failure',
 3: 'skipped',
 4: 'exception',
 5: 'retry'}