Package bitten :: Module recipe :: Class Context

Class Context

object --+
         |
        Context

The context in which a build is executed.
Instance Methods
 
__init__(self, basedir, config=None, vars=None)
Initialize the context.
 
run(self, step, namespace, name, attr)
Run the specified recipe command.
 
error(self, message)
Record an error message.
 
log(self, xml)
Record log output.
 
report(self, category, xml)
Record report data.
 
report_file(self, category=None, file_=None)
Read report data from a file and record it.
 
attach(self, file_=None, description=None, resource=None)
Attach a file to the build or build configuration.
 
resolve(self, *path)
Return the path of a file relative to the base directory.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  step = None
  generator = None
Properties

Inherited from object: __class__

Method Details

__init__(self, basedir, config=None, vars=None)
(Constructor)

 
Initialize the context.
Parameters:
  • basedir - a string containing the working directory for the build. (may be a pattern for replacement ex: 'build_${build}'
  • config (Configuration) - the build slave configuration
Overrides: object.__init__

run(self, step, namespace, name, attr)

 
Run the specified recipe command.
Parameters:
  • step - the build step that the command belongs to
  • namespace - the namespace URI of the command
  • name - the local tag name of the command
  • attr - a dictionary containing the attributes defined on the command element

error(self, message)

 
Record an error message.
Parameters:
  • message - a string containing the error message.

log(self, xml)

 
Record log output.
Parameters:
  • xml - an XML fragment containing the log messages

report(self, category, xml)

 
Record report data.
Parameters:
  • category - the name of category of the report
  • xml - an XML fragment containing the report data

report_file(self, category=None, file_=None)

 
Read report data from a file and record it.
Parameters:
  • category - the name of the category of the report
  • file_ - the path to the file containing the report data, relative to the base directory

attach(self, file_=None, description=None, resource=None)

 
Attach a file to the build or build configuration.
Parameters:
  • file_ - the path to the file to attach, relative to base directory.
  • description - description saved with attachment
  • resource - which resource to attach the file to, either 'build' (default) or 'config'

resolve(self, *path)

 

Return the path of a file relative to the base directory.

Accepts any number of positional arguments, which are joined using the system path separator to form the path.