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

Class Request

source code

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.

Instance Methods [hide private]
 
__init__(self, config, environ, data)
Sets configuration and environment.
source code
 
__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.
source code
 
buffer_input_stream(self)
Buffer the input stream in a StringIO instance.
source code
 
setResponse(self, response)
Sets the Response object.
source code
object
getResponse(self)
Returns the Response object which handles all output related functionality.
source code
object
__getform(self)
Parses and returns the form data submitted by the client.
source code
object
getForm(self)
Returns the form data submitted by the client.
source code
dict
getConfiguration(self)
Returns the _actual_ configuration dict.
source code
dict
getHttp(self)
Returns the _actual_ http dict.
source code
dict
getData(self)
Returns the _actual_ data dict.
source code
 
__populatedict(self, currdict, newdict)
Internal helper method for populating an existing dict with data from the new dict.
source code
 
addHttp(self, d)
Takes in a dict and adds/overrides values in the existing http dict with the new values.
source code
 
addData(self, d)
Takes in a dict and adds/overrides values in the existing data dict with the new values.
source code
 
addConfiguration(self, newdict)
Takes in a dict and adds/overrides values in the existing configuration dict with the new values.
source code
 
__getattr__(self, name, default=None)
Sort of simulates the dict except we only have three valid attributes: config, data, and http.
source code
string
__repr__(self)
Returns a representation of this request which is "Request".
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

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

__iter__(self)

source code 

Can't copy the __iter__ method over from the StringIO instance cause iter looks for the method in the class instead of the instance.

See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/252151

buffer_input_stream(self)

source code 
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.

setResponse(self, response)

source code 
Sets the Response object.
Parameters:
  • response (Response) - A pyblosxom Response object

getResponse(self)

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

__getform(self)

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

getForm(self)

source code 
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: object
cgi.FieldStorage

getConfiguration(self)

source code 

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
the configuration dict

getHttp(self)

source code 

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
the http environment dict

getData(self)

source code 

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
the run-time data dict

__populatedict(self, currdict, newdict)

source code 
Internal helper method for populating an existing dict with data from the new dict.
Parameters:
  • currdict (dict) - the existing dict to update
  • newdict (dict) - the new dict with values to update with

addHttp(self, d)

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

addData(self, d)

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

addConfiguration(self, newdict)

source code 
Takes in a dict and adds/overrides values in the existing configuration dict with the new values.
Parameters:
  • newdict (dict) - the dict with the new keys/values to add

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

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

__repr__(self)
(Representation operator)

source code 
Returns a representation of this request which is "Request".
Returns: string
"Request"
Overrides: object.__repr__