Changeset 1732
- Timestamp:
- 09/28/07 18:53:38
- Files:
-
- trunk/cherrypy/_cpchecker.py (modified) (6 diffs)
- trunk/cherrypy/test/checkerdemo.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpchecker.py
r1718 r1732 49 49 def check_skipped_app_config(self): 50 50 for sn, app in cherrypy.tree.apps.iteritems(): 51 if not isinstance(app, cherrypy.Application): 52 continue 51 53 if not app.config: 52 54 msg = "The Application mounted at %r has an empty config." % sn … … 64 66 request = cherrypy.request 65 67 for sn, app in cherrypy.tree.apps.iteritems(): 68 if not isinstance(app, cherrypy.Application): 69 continue 66 70 request.app = app 67 71 for section in app.config: … … 150 154 self._compat(cherrypy.config) 151 155 for sn, app in cherrypy.tree.apps.iteritems(): 156 if not isinstance(app, cherrypy.Application): 157 continue 152 158 self._compat(app.config) 153 159 … … 171 177 if len(atoms) > 1: 172 178 if atoms[0] not in ns: 179 # Spit out a special warning if a known 180 # namespace is preceded by "cherrypy." 173 181 if (atoms[0] == "cherrypy" and atoms[1] in ns): 174 182 msg = ("The config entry %r is invalid; " … … 180 188 "section: [%s]" % (k, atoms[0], section)) 181 189 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) 182 196 183 197 def check_config_namespaces(self): 184 198 """Process config and warn on each unknown config namespace.""" 185 199 for sn, app in cherrypy.tree.apps.iteritems(): 200 if not isinstance(app, cherrypy.Application): 201 continue 186 202 self._known_ns(app) 203 204 187 205 188 206 … … 234 252 self._known_types(cherrypy.config) 235 253 for sn, app in cherrypy.tree.apps.iteritems(): 254 if not isinstance(app, cherrypy.Application): 255 continue 236 256 self._known_types(app.config) 237 257 trunk/cherrypy/test/checkerdemo.py
r1718 r1732 36 36 # Warn on mismatched types 37 37 '/conftype': {'request.show_tracebacks': 14}, 38 # Warn on unknown tool. 39 '/web': {'tools.unknown.on': True}, 38 40 # Warn on 'localhost' 39 41 'global': {'server.socket_host': 'localhost'},

