~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/dispatch/request.py

  • Committer: William Grant
  • Date: 2009-04-28 04:50:39 UTC
  • Revision ID: grantw@unimelb.edu.au-20090428045039-ibb7gwtjrhe9osq3
Populate req.config in a cleaner manner.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
    HTTP_INSUFFICIENT_STORAGE         = 507
155
155
    HTTP_NOT_EXTENDED                 = 510
156
156
 
157
 
    def __init__(self, req):
158
 
        """Builds an IVLE request object from a mod_python request object.
159
 
        This results in an object with all of the necessary methods and
160
 
        additional fields.
 
157
    def __init__(self, req, config):
 
158
        """Create an IVLE request from a mod_python one.
161
159
 
162
 
        req: A mod_python request object.
 
160
        @param req: A mod_python request.
 
161
        @param config: An IVLE configuration.
163
162
        """
164
163
 
165
164
        # Methods are mostly wrappers around the Apache request object
166
165
        self.apache_req = req
 
166
        self.config = config
167
167
        self.headers_written = False
168
168
 
169
169
        # Determine if the browser used the public host name to make the
170
170
        # request (in which case we are in "public mode")
171
 
        if req.hostname == ivle.conf.public_host:
 
171
        if req.hostname == config['urls']['public_host']:
172
172
            self.publicmode = True
173
173
        else:
174
174
            self.publicmode = False