This module creates Inca reporters--objects that produce XML that
follows the Inca Report schema. The constructor may be called with a
number of reporter attributes that can later be set and queried with
their corresponding get/set functions (described below). For
example:
|
|
|
|
|
_helpXml(self)
Returns help information formatted as the body of an Inca report. |
source code
|
|
|
_iso8601Time(self,
when)
Returns the UTC time for the time() return value when in ISO 8601
format: CCMM-MM-DDTHH:MM:SSZ |
source code
|
|
|
_reportXml(self,
*contents)
Returns XML report beginning with the header and input sections plus
any contents specified in the arguments. |
source code
|
|
|
_timeoutException(*args)
SIGALRM handler that throws an exception. |
source code
|
|
|
addArg(self,
name,
description=None,
default=None,
pattern=None)
Adds a command line argument (invocation syntax -name=value) to the
reporter. |
source code
|
|
|
addDependency(self,
*dependencies)
Add one or more dependencies to the list of modules on which this
reporter depends. |
source code
|
|
|
argValue(self,
name,
position=None)
Called after the processArgv method, this returns the value of the
position'th instance (starting with 1) of the name command-line
argument. |
source code
|
|
|
argValues(self,
name)
Called after the processArgv method, this returns an array of all
values specified for the name command-line argument. |
source code
|
|
|
compiledProgramOutput(self,
**params)
A convenience; compiles and runs a program, removes the source and
exec files, and returns the program's combined stderr/out output. |
source code
|
|
|
compiledProgramStatusOutput(self,
**params)
A convenience; compiles and runs a program, removes the source and
exec files, and returns a tuple that contains the program's exit
code and its combined stderr/out output. |
source code
|
|
|
failPrintAndExit(self,
msg)
A convenience; calls setResult(0, msg) and printReport() before
exiting the reporter. |
source code
|
|
|
getBody(self)
Returns the body of the report. |
source code
|
|
|
getCompleted(self)
Returns the completion indicator of the reporter. |
source code
|
|
|
getCwd(self)
Returns the initial working directory of the reporter. |
source code
|
|
|
getDescription(self)
Returns the initial working directory of the reporter. |
source code
|
|
|
getFailMessage(self)
Returns the failure message of the reporter. |
source code
|
|
|
getName(self)
Returns the name that identifies this reporter. |
source code
|
|
|
getUrl(self)
Returns the url which describes the reporter in more detail. |
source code
|
|
|
getVersion(self)
Returns the version of the reporter. |
source code
|
|
|
log(self,
type,
*msgs)
Appends each element of msgs to the list of type log messages stored
in the reporter. |
source code
|
|
|
loggedCommandOutput(self,
cmd,
timeout=None)
A convenience; appends cmd to the 'system'-type log messages stored
in the reporter, then runs cmd and returns its combined
stderr/stdout. |
source code
|
|
|
loggedCommandStatusOutput(self,
cmd,
timeout=None)
A convenience; appends cmd to the 'system'-type log messages stored
in the reporter, then runs cmd and returns a tuple that contains its
exit code and combined stderr/stdout. |
source code
|
|
|
printReport(self,
verbose=None)
A convenience; prints report(verbose) to stdout. |
source code
|
|
|
processArgv(self,
argv)
Processes argv which is a list of command-line arguments of the form
-name=value |
source code
|
|
|
report(self,
verbose=None)
Returns report text or XML, depending on the value (0, 1, 2) of
verbose. |
source code
|
|
|
|
|
setBody(self,
body)
Sets the body of the report to body. |
source code
|
|
|
setCompleted(self,
completed)
Sets the completion indicator of the reporter to completed. |
source code
|
|
|
setCwd(self,
cwd)
Sets the initial working directory of the reporter to cwd. |
source code
|
|
|
setDescription(self,
description)
Sets the description of the reporter to description. |
source code
|
|
|
setFailMessage(self,
msg)
Sets the failure message of the reporter to msg. |
source code
|
|
|
setName(self,
name)
Sets the name that identifies this reporter to name. |
source code
|
|
|
setResult(self,
completed,
msg=None)
A convenience; calls setCompleted(completed) and setFailMessage(msg). |
source code
|
|
|
setUrl(self,
url)
Sets the url for the reporter to url. |
source code
|
|
|
|
|
|
|
|