Changeset 96
- Timestamp:
- 12/29/04 09:48:29
- Files:
-
- trunk/ChangeLog.txt (modified) (1 diff)
- trunk/cherrypy/__init__.py (modified) (1 diff)
- trunk/cherrypy/_cphttptools.py (modified) (3 diffs)
- trunk/cherrypy/lib/filter/tidyfilter.py (modified) (2 diffs)
- trunk/cherrypy/lib/httptools.py (modified) (1 diff)
- trunk/setup.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ChangeLog.txt
r79 r96 1 2004/12-29: 2 * CherryPY-2.0-beta released 3 * cpg.response.body is now always an iterable type - ticket #59 (Carlos) 1 4 * Allowed default session functions to be accessed by other modules - 2 5 ticket #56 (Remi) trunk/cherrypy/__init__.py
r8 r96 1 __version__ = '2.0.0 a2'1 __version__ = '2.0.0b' trunk/cherrypy/_cphttptools.py
r95 r96 206 206 207 207 wfile.write('%s %s\r\n' % (cpg.response.headerMap['protocolVersion'], cpg.response.headerMap['Status'])) 208 if cpg.response.headerMap.has_key('Content-Length') and cpg.response.headerMap['Content-Length'] == 0: 209 cpg.response.headerMap['Content-Length'] = len(cpg.response.body) 208 209 if (cpg.response.headerMap.has_key('Content-Length') and 210 cpg.response.headerMap['Content-Length']==0): 211 buf = StringIO.StringIO() 212 [buf.write(x) for x in cpg.response.body] 213 buf.seek(0) 214 cpg.response.body = [buf.read()] 215 cpg.response.headerMap['Content-Length'] = len(cpg.response.body[0]) 216 210 217 for key, valueList in cpg.response.headerMap.items(): 211 218 if key not in ('Status', 'protocolVersion'): … … 214 221 wfile.write('%s: %s\r\n'%(key, value)) 215 222 wfile.write('\r\n') 216 wfile.write(cpg.response.body) 223 for line in cpg.response.body: 224 wfile.write(line) 217 225 except: 218 226 bodyFile = StringIO.StringIO() … … 236 244 # Set the content-length 237 245 if (cpg.response.headerMap.has_key('Content-Length') and 238 cpg.response.headerMap['Content-Length']==0): 239 #body = "" 240 #body = ''.join(list(cpg.response.body)) # a local var is more efficient here 241 #body = u''.join(cpg.response.body) # a local var is more efficient here 242 #body = '' 243 #for line in cpg.response.body: 244 # print body 245 # body += line 246 cpg.response.headerMap['Content-Length']==0): 246 247 buf = StringIO.StringIO() 247 248 [buf.write(x) for x in cpg.response.body] trunk/cherrypy/lib/filter/tidyfilter.py
r95 r96 34 34 # so we just collect the body and work with it. 35 35 originalBody = ''.join(cpg.response.body) 36 cpg.response.body = [originalBody] 36 37 37 ct = cpg.response.headerMap.get('Content-Type') 38 ct = cpg.response.headerMap.get('Content-Type').split(';')[0] 38 39 if ct == 'text/html': 39 40 pageFile = os.path.join(self.tmpDir, 'page.html') … … 67 68 newBody += '<br><br>' 68 69 i=0 69 for line in o ldHtml.splitlines():70 for line in originalBody.splitlines(): 70 71 i += 1 71 72 newBody += "%03d - "%i + cgi.escape(line).replace('\t',' ').replace(' ',' ') + '<br>' trunk/cherrypy/lib/httptools.py
r13 r96 34 34 cpg.response.headerMap['Status'] = 302 35 35 cpg.response.headerMap['Location'] = newUrl 36 return ""36 return [] trunk/setup.py
r15 r96 9 9 10 10 setup(name="CherryPy", 11 version="2.0.0 a2",11 version="2.0.0b", 12 12 description="Object-Oriented web development framework", 13 13 long_description="""CherryPy is a pythonic, object-oriented web development framework.""",

