Package Pyblosxom :: Module pyblosxom :: Class Request
[show private | hide private]
[frames | no frames]

Type Request

object --+
         |
        Request


This class holds the PyBlosxom request. It holds configuration information, HTTP/CGI information, and data that we calculate and transform over the course of execution.

There should be only one instance of this class floating around and it should get created by pyblosxom.cgi and passed into the PyBlosxom instance which will do further manipulation on the Request instance.
Method Summary
  __init__(self, config, environ, data)
Sets configuration and environment.
  __getattr__(self, name, default)
Sort of simulates the dict except we only have three valid attributes: config, data, and http.
  __iter__(self)
Can't copy the __iter__ method over from the StringIO instance cause iter looks for the method in the class instead of the instance.
  __repr__(self)
  addConfiguration(self, d)
Takes in a dict and adds/overrides values in the existing configuration dict with the new values.
  addData(self, d)
Takes in a dict and adds/overrides values in the existing data dict with the new values.
  addHttp(self, d)
Takes in a dict and adds/overrides values in the existing http dict with the new values.
  buffer_input_stream(self)
Buffer the input stream in a StringIO instance.
  dumpRequest(self)
  getConfiguration(self)
Returns the _actual_ configuration dict.
  getData(self)
Returns the _actual_ data dict.
  getForm(self)
Returns the form data submitted by the client.
  getHttp(self)
Returns the _actual_ http dict.
  getResponse(self)
Returns the Response object which handles all output related functionality.
  setResponse(self, response)
Sets the Response object.
  __copy_members(self)
Copies methods from the underlying input stream to the request object.
  __getForm(self)
Parses and returns the form data submitted by the client.
  __populateDict(self, currdict, newdict)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Method Details

__init__(self, config, environ, data)
(Constructor)

Sets configuration and environment. Creates the Response object which handles all output related functionality.
Parameters:
config - A dict containing the configuration variables.
           (type=dict)
environ - A dict containing the environment variables.
           (type=dict)
data - A dict containing data variables.
           (type=dict)
Overrides:
__builtin__.object.__init__

__getattr__(self, name, default=None)
(Qualification operator)

Sort of simulates the dict except we only have three valid attributes: config, data, and http.
Parameters:
name - the name of the attribute to get
           (type=string)
default - varies
           (type=varies)

__iter__(self)

Can't copy the __iter__ method over from the StringIO instance cause iter looks for the method in the class instead of the instance. So can't do this with __copy_members, have to define it seperatly. See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252151

addConfiguration(self, d)

Takes in a dict and adds/overrides values in the existing configuration dict with the new values.
Parameters:
d - the dict with the new keys/values to add
           (type=dict)

addData(self, d)

Takes in a dict and adds/overrides values in the existing data dict with the new values.
Parameters:
d - the dict with the new keys/values to add
           (type=dict)

addHttp(self, d)

Takes in a dict and adds/overrides values in the existing http dict with the new values.
Parameters:
d - the dict with the new keys/values to add
           (type=dict)

buffer_input_stream(self)

Buffer the input stream in a StringIO instance. This is done to have a known/consistent way of accessing incomming data. For example the input stream passed by mod_python does not offer the same functionallity as sys.stdin.

getConfiguration(self)

Returns the _actual_ configuration dict. The configuration dict holds values that the user sets in their config.py file.

Modifying the contents of the dict will affect all downstream processing.
Returns:
dict

getData(self)

Returns the _actual_ data dict. Holds run-time data which is created and transformed by pyblosxom during execution.

Modifying the contents of the dict will affect all downstream processing.
Returns:
dict

getForm(self)

Returns the form data submitted by the client. The form instance is created only when requested to prevent overhead and unnecessary consumption of the input stream.
Returns:
cgi.FieldStorage

getHttp(self)

Returns the _actual_ http dict. Holds HTTP/CGI data derived from the environment of execution.

Modifying the contents of the dict will affect all downstream processing.
Returns:
dict

getResponse(self)

Returns the Response object which handles all output related functionality.
Returns:
Response

setResponse(self, response)

Sets the Response object.
Parameters:
response - A pyblosxom Response object
           (type=Response)

__copy_members(self)

Copies methods from the underlying input stream to the request object.

__getForm(self)

Parses and returns the form data submitted by the client. Rewinds the input buffer after calling cgi.FieldStorage.
Returns:
cgi.FieldStorage

Generated by Epydoc 2.1 on Tue Feb 7 21:43:58 2006 http://epydoc.sf.net