Module server :: Class Co2Handler
[show private | hide private]
[frames | no frames]

Class Co2Handler

BaseRequestHandler --+            
                     |            
  StreamRequestHandler --+        
                         |        
    BaseHTTPRequestHandler --+    
                             |    
    SimpleXMLRPCRequestHandler --+
                                 |
                                Co2Handler


handles all incoming xmlrpc requests.
Method Summary
  __init__(self, request, client_address, server)
(inherited from BaseRequestHandler)
  address_string(self)
Return the client address formatted for logging. (inherited from BaseHTTPRequestHandler)
  date_time_string(self)
Return the current date and time formatted for a message header. (inherited from BaseHTTPRequestHandler)
  do_GET(self)
called by the underlying http server on a GET request.
  do_POST(self)
Handles the HTTP POST request. (inherited from SimpleXMLRPCRequestHandler)
  end_headers(self)
Send the blank line ending the MIME headers. (inherited from BaseHTTPRequestHandler)
  finish(self)
(inherited from StreamRequestHandler)
  handle(self)
Handle multiple requests if necessary. (inherited from BaseHTTPRequestHandler)
  handle_one_request(self)
Handle a single HTTP request. (inherited from BaseHTTPRequestHandler)
  log_date_time_string(self)
Return the current time formatted for logging. (inherited from BaseHTTPRequestHandler)
  log_error(self, *args)
Log an error. (inherited from BaseHTTPRequestHandler)
  log_message(self, format, *args)
Log an arbitrary message. (inherited from BaseHTTPRequestHandler)
  log_request(self, code, size)
Selectively log an accepted request. (inherited from SimpleXMLRPCRequestHandler)
  parse_request(self)
Parse a request (internal). (inherited from BaseHTTPRequestHandler)
  send_error(self, code, message)
Send and log an error reply. (inherited from BaseHTTPRequestHandler)
  send_header(self, keyword, value)
Send a MIME header. (inherited from BaseHTTPRequestHandler)
  send_response(self, code, message)
Send the response header and log the response code. (inherited from BaseHTTPRequestHandler)
  setup(self)
(inherited from StreamRequestHandler)
  version_string(self)
Return the server software version string. (inherited from BaseHTTPRequestHandler)
dictionary _dispatch(self, method_name, params)
dispatch an incoming xmlrpc call.
string _dispatch_html(self, method_name, param_dict)
builtin webserver, dispatches html GET requests.

Method Details

do_GET(self)

called by the underlying http server on a GET request. returns html formatted data to the client since we assume the request originates from a web browser.

_dispatch(self, method_name, params=({},))

dispatch an incoming xmlrpc call.
Parameters:
method_name - name of the method to be called
           (type=string)
params - optional parameters to be passed on to the method
           (type=

tuple

arguments to the method must be in the first element of the tuple (why tuple? SimpleXMLRPCServer.SimpleXMLRPCRequestHandler uses apply() which expects a tuple as argument parameter) and formatted according to the signature of the method <method_name>. see registry.Co2Registry's x_co2_get_method_signature method.

if the second argument is missing, it is set to a tuple containing an empty dictionary. the key 'client_address' is set to the address of the request's originating host, the value is a tuple (<host>, <port>). the host part is used later on, e.g. to verify requests.)
Returns:
whatever the called method returns
           (type=dictionary)

_dispatch_html(self, method_name, param_dict={})

builtin webserver, dispatches html GET requests. basically the same as _dispatch, but restricted to methods whose names begin with 'web.'.
Parameters:
method_name - name of the method to be called
           (type=string)
param_dict - optional argument to be passed on to the method
           (type=dictionary)
Returns:
whatever the called method returns
           (type=string)
Raises:
Co2Error - Co2Error if the method is not allowed to be called through the webinterface
KeyError -

exceptions.KeyError if no such method is registered

Exceptions raised here cause a trace to be sent back to the client.

Generated by Epydoc 1.1 on Thu Oct 16 16:37:23 2003 http://epydoc.sf.net