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

Changeset 1706

Show
Ignore:
Timestamp:
08/22/07 01:02:00
Author:
fumanchu
Message:

Fix for #716 (Checker should warn on unknown tool).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-3.0.x/cherrypy/_cpchecker.py

    r1575 r1706  
    156156                    if len(atoms) > 1: 
    157157                        if atoms[0] not in ns: 
     158                            # Spit out a special warning if a known 
     159                            # namespace is preceded by "cherrypy." 
    158160                            if (atoms[0] == "cherrypy" and atoms[1] in ns): 
    159161                                msg = ("The config entry %r is invalid; " 
     
    165167                                       "section: [%s]" % (k, atoms[0], section)) 
    166168                            warnings.warn(msg) 
     169                        elif atoms[0] == "tools": 
     170                            if atoms[1] not in dir(cherrypy.tools): 
     171                                msg = ("The config entry %r may be invalid, " 
     172                                       "because the %r tool was not found.\n" 
     173                                       "section: [%s]" % (k, atoms[1], section)) 
     174                                warnings.warn(msg) 
    167175     
    168176    def check_config_namespaces(self): 
  • branches/cherrypy-3.0.x/cherrypy/test/checkerdemo.py

    r1574 r1706  
    3636            # Warn on mismatched types 
    3737            '/conftype': {'request.show_tracebacks': 14}, 
     38            # Warn on unknown tool. 
     39            '/web': {'tools.unknown.on': True}, 
    3840            } 
    3941    cherrypy.quickstart(Root(), config=conf) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets