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

Changeset 1732

Show
Ignore:
Timestamp:
09/28/07 18:53:38
Author:
fumanchu
Message:

Port to trunk of [1706] and [1714].

Files:

Legend:

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

    r1718 r1732  
    4949    def check_skipped_app_config(self): 
    5050        for sn, app in cherrypy.tree.apps.iteritems(): 
     51            if not isinstance(app, cherrypy.Application): 
     52                continue 
    5153            if not app.config: 
    5254                msg = "The Application mounted at %r has an empty config." % sn 
     
    6466        request = cherrypy.request 
    6567        for sn, app in cherrypy.tree.apps.iteritems(): 
     68            if not isinstance(app, cherrypy.Application): 
     69                continue 
    6670            request.app = app 
    6771            for section in app.config: 
     
    150154        self._compat(cherrypy.config) 
    151155        for sn, app in cherrypy.tree.apps.iteritems(): 
     156            if not isinstance(app, cherrypy.Application): 
     157                continue 
    152158            self._compat(app.config) 
    153159     
     
    171177                    if len(atoms) > 1: 
    172178                        if atoms[0] not in ns: 
     179                            # Spit out a special warning if a known 
     180                            # namespace is preceded by "cherrypy." 
    173181                            if (atoms[0] == "cherrypy" and atoms[1] in ns): 
    174182                                msg = ("The config entry %r is invalid; " 
     
    180188                                       "section: [%s]" % (k, atoms[0], section)) 
    181189                            warnings.warn(msg) 
     190                        elif atoms[0] == "tools": 
     191                            if atoms[1] not in dir(cherrypy.tools): 
     192                                msg = ("The config entry %r may be invalid, " 
     193                                       "because the %r tool was not found.\n" 
     194                                       "section: [%s]" % (k, atoms[1], section)) 
     195                                warnings.warn(msg) 
    182196     
    183197    def check_config_namespaces(self): 
    184198        """Process config and warn on each unknown config namespace.""" 
    185199        for sn, app in cherrypy.tree.apps.iteritems(): 
     200            if not isinstance(app, cherrypy.Application): 
     201                continue 
    186202            self._known_ns(app) 
     203 
     204 
    187205     
    188206     
     
    234252        self._known_types(cherrypy.config) 
    235253        for sn, app in cherrypy.tree.apps.iteritems(): 
     254            if not isinstance(app, cherrypy.Application): 
     255                continue 
    236256            self._known_types(app.config) 
    237257     
  • trunk/cherrypy/test/checkerdemo.py

    r1718 r1732  
    3636            # Warn on mismatched types 
    3737            '/conftype': {'request.show_tracebacks': 14}, 
     38            # Warn on unknown tool. 
     39            '/web': {'tools.unknown.on': True}, 
    3840            # Warn on 'localhost' 
    3941            'global': {'server.socket_host': 'localhost'}, 

Hosted by WebFaction

Log in as guest/cpguest to create tickets