Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1540

Show
Ignore:
Timestamp:
12/20/06 23:49:52
Author:
fumanchu
Message:

Minor cleanups.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/__init__.py

    r1535 r1540  
    2525 
    2626def quickstart(root, script_name="", config=None): 
    27     """Mount the given app, start the engine and builtin server, then block.""" 
     27    """Mount the given root, start the engine and builtin server, then block.""" 
    2828    if config: 
    2929        _global_conf_alias.update(config) 
  • trunk/cherrypy/_cperror.py

    r1467 r1540  
    164164        # Remove headers which applied to the original content, 
    165165        # but do not apply to the error page. 
     166        respheaders = response.headers 
    166167        for key in ["Accept-Ranges", "Age", "ETag", "Location", "Retry-After", 
    167168                    "Vary", "Content-Encoding", "Content-Length", "Expires", 
    168169                    "Content-Location", "Content-MD5", "Last-Modified"]: 
    169             if response.headers.has_key(key): 
    170                 del response.headers[key] 
     170            if respheaders.has_key(key): 
     171                del respheaders[key] 
    171172         
    172173        if self.status != 416: 
     
    177178            # A response with status code 206 (Partial Content) MUST NOT 
    178179            # include a Content-Range field with a byte-range- resp-spec of "*". 
    179             if response.headers.has_key("Content-Range"): 
    180                 del response.headers["Content-Range"] 
     180            if respheaders.has_key("Content-Range"): 
     181                del respheaders["Content-Range"] 
    181182         
    182183        # In all cases, finalize will be called after this method, 
     
    189190                                 message=self.message) 
    190191        response.body = content 
    191         response.headers['Content-Length'] = len(content) 
    192         response.headers['Content-Type'] = "text/html" 
     192        respheaders['Content-Length'] = len(content) 
     193        respheaders['Content-Type'] = "text/html" 
    193194         
    194195        _be_ie_unfriendly(self.status) 
  • trunk/cherrypy/test/test_xmlrpc.py

    r1528 r1540  
    33import xmlrpclib 
    44 
    5 from cherrypy import _cpdispatch 
     5import cherrypy 
    66 
    77 
    88def setup_server(): 
    9     import cherrypy 
    109    from cherrypy import _cptools 
    1110     
     
    6160    root.xmlrpc = XmlRpc() 
    6261    cherrypy.tree.mount(root, config={'/': { 
    63         'request.dispatch': _cpdispatch.XMLRPCDispatcher(), 
     62        'request.dispatch': cherrypy.dispatch.XMLRPCDispatcher(), 
    6463        }}) 
    6564    cherrypy.config.update({'environment': 'test_suite'}) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets