|
Methods defined here:
- __init__(self)
- config(self)
- Return the configuration for the CGIWrapper.
This is a combination of defaultConfig() and userConfig().
This method does no caching.
- configFilename(self)
- Return the filename of the optional configuration file.
- defaultConfig(self)
- Return a dictionary with the default configuration.
Subclasses could override to customize the values
or where they're taken from.
- deliver(self)
- Deliver the HTML.
This is used for the output that came from the script being served,
or from our own error reporting.
- docType(self)
- emailException(self, html, excInfo=None)
- Email an exception.
- enhanceThePath(self)
- Enhance sys.path according to our configuration.
- environ(self)
- Get the environment for the request.
- handleException(self, excInfo)
- Handle an exception in the target script.
Invoked by self when an exception occurs in the target script.
<code>excInfo</code> is a sys.exc_info()-style tuple of information
about the exception.
- htmlDebugInfo(self)
- Return an HTML page with debugging info on the current exception.
Used by handleException().
- htmlErrorPage(self, showDebugInfo=True)
- Return an HTML page explaining that there is an error.
There could be more options in the future, so using named arguments
(e.g. showDebugInfo=False) is recommended. Invoked by handleException().
- htmlErrorPageFilename(self)
- Construct a filename for an HTML error page.
This filename does not include the 'ErrorMessagesDir' setting.
- logExceptionToConsole(self, stderr=<__main__.OutputCatcher object>)
- Log an exception in the target script.
Logs the time, script name and traceback to the console
(typically stderr). This usually results in the information
appearing in the web server's error log. Used by handleException().
- logExceptionToDisk(self, errorMsgFilename=None, excInfo=None)
- Write exception info to the log file.
Writes a tuple containing (date-time, filename, pathname,
exception-name, exception-data, error report filename)
to the errors file (typically 'Errors.csv') in CSV format.
Invoked by handleException().
- makeFieldStorage(self)
- Return a default field storage object created from the cgi module.
- makeHeaders(self)
- Return a default header dictionary with Content-Type entry.
- requireEnvs(self, names)
- Check that given environment variable names exist.
If they don't, a basic HTML error message is printed and we exit.
- reset(self)
- Reset CGI output.
Used by handleException() to clear out the current CGI output results
in preparation of delivering an HTML error message page.
Currently resets headers and deletes cookies, if present.
- saveHTMLErrorPage(self, html)
- Save the given HTML error page for later viewing by the developer.
Returns the filename used. Invoked by handleException().
- scriptPathname(self)
- Return the full pathname of the target script.
Scripts that start with an underscore are special -- they run
out of the same directory as the CGI Wrapper and are typically
CGI Wrapper support scripts.
- serve(self, environ={'MASTERMNT': '/z/poudriere-base/data/build/91am...: ''})
- Serve a request.
- setting(self, name)
- Return the value of a particular setting in the configuration.
- userConfig(self)
- Return a dictionary with the user configuration.
This are overrides found in the optional configuration file,
or {} if there is no such file. The config filename is taken
from configFilename().
- version(self)
- writeScriptLog(self)
- Write an entry to the script log file.
Uses settings ScriptLogFilename and ScriptLogColumns.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|