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

« back to all changes in this revision

Viewing changes to lib/common/cgirequest.py

  • Committer: mattgiuca
  • Date: 2008-02-15 05:33:05 UTC
  • Revision ID: svn-v3-trunk0:2b9c9e99-6f39-0410-b283-7f802c844ae2:trunk:474
makeuser.py: Uncommented a try block I commented out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import cgi
34
34
 
35
35
import conf
 
36
import common
 
37
import common.util
36
38
 
37
39
# Utility functions
38
40
 
119
121
        """
120
122
        self.headers_written = False
121
123
 
 
124
        if ('SERVER_NAME' not in os.environ or
 
125
            'REQUEST_METHOD' not in os.environ or
 
126
            'REQUEST_URI' not in os.environ):
 
127
            raise Exception("No CGI environment found")
 
128
 
122
129
        # Determine if the browser used the public host name to make the
123
130
        # request (in which case we are in "public mode")
124
131
        if os.environ['SERVER_NAME'] == conf.public_host:
222
229
        f = open(filename)
223
230
        buf = f.read(1024)
224
231
        while len(buf) > 0:
225
 
            sys.stdout.flush(buf)
 
232
            sys.stdout.write(buf)
 
233
            sys.stdout.flush()
226
234
            buf = f.read(1024)
227
235
        f.close()
228
236