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

Changeset 1055

Show
Ignore:
Timestamp:
04/22/06 13:05:04
Author:
fumanchu
Message:

Fixed xmlrpc tool and test. Plus:

  1. 'path' arg is now required when calling dispatchers.
  2. fixed default favicon declaration of staticfile.
  3. missing import in lib/static.
  4. fixed test_combinedfilters.py
Files:

Legend:

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

    r1050 r1055  
    234234    def main(self, path=None): 
    235235        """Obtain and set cherrypy.response.body from a page handler.""" 
     236        if path is None: 
     237            path = self.object_path 
    236238        dispatch = cherrypy.config.get("dispatcher") or Dispatcher() 
    237239        handler = dispatch(path) 
     
    298300class Dispatcher(object): 
    299301     
    300     def __call__(self, path=None): 
     302    def __call__(self, path): 
    301303        """Find the appropriate page handler.""" 
    302304        request = cherrypy.request 
    303         if path is None: 
    304             path = request.object_path 
    305          
    306305        handler, opath, vpath = self.find(request.browser_url, path) 
    307306         
  • trunk/cherrypy/config.py

    r1047 r1055  
    2727    'server.environment': "development", 
    2828     
    29     '/favicon.ico': {'hooks.static.on': True, 
    30                      'hooks.static.file': _favicon_path}, 
     29    '/favicon.ico': {'tools.staticfile.on': True, 
     30                     'tools.staticfile.filename': _favicon_path}, 
    3131    } 
    3232 
  • trunk/cherrypy/lib/static.py

    r1052 r1055  
    77import os 
    88import re 
     9import time 
    910import urllib 
    1011 
  • trunk/cherrypy/lib/xmlrpc.py

    r1047 r1055  
    33 
    44import cherrypy 
    5 from cherrypy import _cprequest 
    65 
    76 
     
    3635    using it via an extension, provide a true value for allow_none. 
    3736    """ 
     37    from cherrypy import _cprequest 
    3838    dispatch = cherrypy.config.get("dispatcher") or _cprequest.Dispatcher() 
    39     handler = dispatch(path) 
     39     
    4040    request = cherrypy.request 
     41    handler = dispatch(request.object_path) 
    4142    body = handler(*(request.virtual_path + request.paramList), 
    4243                   **request.params) 
     
    6263def setup(conf): 
    6364    """Hook this tool into cherrypy.request using the given conf.""" 
    64     cherrypy.request.hooks.attach('before_process_body', process_body, conf) 
    65     cherrypy.request.hooks.attach_main(main, conf) 
     65    cherrypy.request.hooks.attach('before_request_body', process_body, conf) 
     66    def wrapper(): 
     67        if main(**conf): 
     68            cherrypy.request.execute_main = False 
     69    cherrypy.request.hooks.attach('before_main', wrapper) 
    6670    cherrypy.request.hooks.attach('after_error_response', error_response, conf) 
  • trunk/cherrypy/test/test_combinedfilters.py

    r1017 r1055  
    1919            'server.log_to_screen': False, 
    2020            'server.environment': 'production', 
    21             'gzip_filter.on': True, 
    22             'encoding_filter.on': True, 
     21            'tools.gzip.on': True, 
     22            'tools.encode.on': True, 
    2323    }) 
    2424 
  • trunk/cherrypy/test/test_xmlrpc_filter.py

    r1017 r1055  
    6060        'server.environment': 'production', 
    6161        'server.show_tracebacks': True, 
    62         '/xmlrpc': {'xmlrpc_filter.on': True}, 
     62        '/xmlrpc': {'tools.xmlrpc.on': True}, 
    6363        }) 
    6464 
  • trunk/cherrypy/tools.py

    r1053 r1055  
    2929 
    3030# These modules are themselves Tools 
    31 from cherrypy.lib import caching 
     31from cherrypy.lib import caching, xmlrpc 
    3232 
    3333 

Hosted by WebFaction

Log in as guest/cpguest to create tickets