Ic@s>ddkZddkZddkZdefdYZdS(iNtCheckercBseZdZeZdZdZd dZe Z dZ dZ h dd6dd 6d d 6d d 6d d 6dd6dd6dd6dd6dd6Z hZdZdZgZdZdZhZdZdZdZdZRS(!sA checker for CherryPy sites and their mounted applications. on: set this to False to turn off the checker completely. When this object is called at engine startup, it executes each of its own methods whose names start with "check_". If you wish to disable selected checks, simply add a line in your global config which sets the appropriate method to False: [global] checker.check_skipped_app_config = False You may also dynamically add or replace check_* methods in this way. cCs|idS(N(t_populate_known_types(tself((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyt__init__scCs|ioti}|it_z]xVt|D]H}|ido2t||}|ot|o |qwq/q/WWd|t_XndS(sRun all check_* methods.tcheck_N(tontwarningst formatwarningtdirt startswithtgetattrtcallable(Rtoldformatwarningtnametmethod((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyt__call__s    cCsd|S(sFunction to format a warning.sCherryPy Checker: %s ((Rtmessagetcategorytfilenametlinenotline((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyR*scCsxxtiiiD]d\}}t|tipqn|ip4d|}|io|d7}nti |dSqWdS(Ns2The Application mounted at %r has an empty config.s It looks like the config you passed to cherrypy.config.update() contains application-specific sections. You must explicitly pass application config via cherrypy.tree.mount(..., config=app_config)( tcherrypyttreetappst iteritemst isinstancet Applicationtconfigtglobal_config_contained_pathsRtwarn(Rtsntapptmsg((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pytcheck_skipped_app_config1s     c Csti}xtiiiD]\}}t|tipqn||_x|iD]}|i |d|ii }|dt o\d}|d}|d}|djo d}nd} t ii|oY|} |oHd}t ii||d} t ii| o|d | 7}q+qvnH|p d }n7t ii||} t ii| pd | }n| o;t ii|  o'|o|d 7}n|d | 7}n|o!tid||||fqqUqUWqWdS(Ns /dummy.htmlstools.staticdir.ontstools.staticdir.rootstools.staticdir.dirstools.staticdir.dir is not set.s8dir is an absolute path, even though a root is provided.isV If you meant to serve the filesystem folder at %r, remove the leading slash from dir.s,dir is a relative path and no root provided.s%r is not an absolute path.s s3%r (root + dir) is not an existing filesystem path.s!%s section: [%s] root: %r dir: %r(RtrequestRRRRRRRt get_resourcetgettFalsetNonetostpathtisabstjointexistsRR( RR#RRtsectiontconfR trootRtfulldirttestdir((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pytcheck_static_paths@sL            stools.response_headers.headerssserver.default_content_typeslog.access_filetlog_access_filetlog_config_optionsslog.error_filetlog_filetlog_file_not_foundstools.log_headers.ontlog_request_headerss log.screent log_to_screensrequest.show_tracebackstshow_tracebackssrequest.throw_errorst throw_errorssDcherrypy.tree.mount(profiler.make_app(cherrypy.Application(Root())))s profiler.oncCs x|iD] \}}t|tox|iD]v\}}||ijo%tid||i||fq6||ijo%tid||i||fq6q6Wq ||ijo"tid||i|fq ||ijo"tid||i|fq q WdS(s=Process config and warn on each obsolete or deprecated entry.s-%r is obsolete. Use %r instead. section: [%s]s/%r is deprecated. Use %r instead. section: [%s]s%r is obsolete. Use %r instead.s!%r is deprecated. Use %r instead.N(RRtdicttobsoleteRRt deprecated(RRR-R.tktv((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyt_compats"    $  cCsa|itixJtiiiD]6\}}t|tipq#n|i|iq#WdS(s=Process config and warn on each obsolete or deprecated entry.N(R@RRRRRRR(RRR((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pytcheck_compatibilitys  c Csdg}|i|ii|i|ii|i|iii|itiii||i7}x`|iiD]O\}}|i d}|o-t |t ox|iD]\}}|i d}t |djo|d|jon|ddjo5|d|jo$d|di|d|f} nd||d|f} ti| q|dd joF|dttijo(d ||d|f} ti| qqqqWqqWdS( Ntwsgit/t.iiRs=The config entry %r is invalid; try %r instead. section: [%s]sYThe config entry %r is invalid, because the %r config namespace is unknown. section: [%s]ttoolssTThe config entry %r may be invalid, because the %r tool was not found. section: [%s](textendt toolboxestkeyst namespacest request_classRRtextra_config_namespacesRR RR;tsplittlenR+RRRRE( RRtnsR-R.tis_path_sectionR>R?tatomsR ((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyt _known_nss4    "!cCsNxGtiiiD]3\}}t|tipqn|i|qWdS(s9Process config and warn on each unknown config namespace.N(RRRRRRRQ(RRR((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pytcheck_config_namespacess  csddk}g}t|iD]*}t|ttjo ||q#q#~fd}|tid|tid|tid|ti d|ti ddS(NicsYxRt|D]D}tt||d}|jo|i|d|R?t expected_typeRW((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyt _known_typess&       cCsa|itixJtiiiD]6\}}t|tipq#n|i|iq#WdS(sAAssert that config values are of the same type as default values.N(RfRRRRRRR(RRR((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pytcheck_config_typess  cCsOxHtiiD]7\}}|djo|djotidqqWdS(s1Warn if any socket_host is 'localhost'. See #711.sserver.socket_hostt localhostsThe use of 'localhost' as a socket host can cause problems on newer systems, since 'localhost' can map to either an IPv4 or an IPv6 address. You should use '127.0.0.1' or '[::1]' instead.N(RRRRR(RR>R?((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pytcheck_localhosts N(Rdt __module__t__doc__tTrueRRRR'RR&RR!R2R<R=R@RARKRQRRRTRRfRgRi(((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyRs<     3    !    (R(RRtobjectR(((s9/usr/lib/python2.6/vendor-packages/cherrypy/_cpchecker.pyts