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

« back to all changes in this revision

Viewing changes to www/dispatch/request.py

  • Committer: mattgiuca
  • Date: 2008-01-18 05:20:01 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:247
request.py: Added get_cgi_environ method. This asks Apache to emulate CGI
environment vars.
debuginfo: Uses get_cgi_environ instead of hackishly making its own.
interpret.py: Now uses get_cgi_environ to set up the CGI environment, and then
restores the existing environment.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
        self.styles = []
178
178
        self.scripts = []
179
179
        self.write_html_head_foot = False
 
180
        self.got_common_vars = False
180
181
 
181
182
    def __writeheaders(self):
182
183
        """Writes out the HTTP and HTML headers before any real data is
261
262
        if not hasattr(self, 'fields'):
262
263
            self.fields = util.FieldStorage(self.apache_req)
263
264
        return self.fields
 
265
 
 
266
    def get_cgi_environ(self):
 
267
        """Returns the CGI environment emulation for this request. (Calls
 
268
        add_common_vars). The environment is returned as a mapping
 
269
        compatible with os.environ."""
 
270
        if not self.got_common_vars:
 
271
            self.apache_req.add_common_vars()
 
272
            self.got_common_vars = True
 
273
        return self.apache_req.subprocess_env