ó »ÏâIc@s>ddlZddlZddlZdefd„ƒYZdS(iÿÿÿÿNtCheckercBsðeZdZeZd„Zd„Zd d„Ze Z d„Z d„Z i dd6dd 6d d 6d d 6d d 6dd6dd6dd6dd6dd6Z iZd„Zd„ZgZd„Zd„ZiZd„Zd„Zd„Zd„ZRS(!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|jƒdS(N(t_populate_known_types(tself((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pyt__init__scCsŠ|jr†tj}|jt_zXxQt|ƒD]C}|jdƒr.t||ƒ}|rqt|ƒrq|ƒqqq.q.WWd|t_XndS(sRun all check_* methods.tcheck_N(tontwarningst formatwarningtdirt startswithtgetattrtcallable(Rtoldformatwarningtnametmethod((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pyt__call__s   cCsd|S(sFunction to format a warning.sCherryPy Checker: %s ((Rtmessagetcategorytfilenametlinenotline((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pyR*scCsyxrtjjjƒD]^\}}t|tjƒs7qn|jsd|}|jr`|d7}ntj |ƒ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.7/vendor-packages/cherrypy/_cpchecker.pytcheck_skipped_app_config1s     c CsÙtj}xÉtjjjƒD]µ\}}t|tjƒs@qn||_x…|jD]z}|j |dƒ|jj }|dt ƒrSd}|dƒ}|dƒ}|dkr¸d}nìd} t jj|ƒr$|} |rgd}t jj||dƒ} t jj| ƒr!|d | 7}q!qgnC|s3d }n4t jj||ƒ} t jj| ƒsgd | }n| r¤t jj| ƒ r¤|r“|d 7}n|d | 7}n|rÍtjd||||fƒqÍqSqSWqWdS(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.7/vendor-packages/cherrypy/_cpchecker.pytcheck_static_paths@sH            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.oncCsx|jƒD]\}}t|tƒr®xã|jƒD]r\}}||jkrttjd||j||fƒq5||jkr5tjd||j||fƒq5q5Wq ||jkrÞtjd||j|fƒq ||jkr tjd||j|fƒq 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.7/vendor-packages/cherrypy/_cpchecker.pyt_compatƒs  "  cCs_|jtjƒxHtjjjƒD]4\}}t|tjƒsGq#n|j|jƒq#WdS(s=Process config and warn on each obsolete or deprecated entry.N(R@RRRRRRR(RRR((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pytcheck_compatibility˜s c CsÍdg}|j|jjƒƒ|j|jjƒƒ|j|jjjƒƒ|jtjjjƒƒ||j7}xR|jjƒD]A\}}|j dƒ}|r„t |t ƒr„x|jƒD]ý\}}|j dƒ}t |ƒdkrÁ|d|krh|ddkrA|d|krAd|dj|dƒ|f} nd||d|f} tj| ƒq¾|dd kr¾|dttjƒkr»d ||d|f} tj| ƒq»q¾qÁqÁWq„q„WdS( 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.7/vendor-packages/cherrypy/_cpchecker.pyt _known_ns¥s0    cCsLxEtjjjƒD]1\}}t|tjƒs7qn|j|ƒqWdS(s9Process config and warn on each unknown config namespace.N(RRRRRRRQ(RRR((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pytcheck_config_namespacesÆscs¯ddl}gt|ƒjƒD]$}t|ƒttƒkr|^q‰‡‡fd†}|tjdƒ|tjdƒ|tjdƒ|tj dƒ|tj dƒdS(NiÿÿÿÿcsWxPt|ƒD]B}tt||dƒƒ}|ˆkr |ˆj|d|R?t expected_typeRW((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pyt _known_typesås"     cCs_|jtjƒxHtjjjƒD]4\}}t|tjƒsGq#n|j|jƒq#WdS(sAAssert that config values are of the same type as default values.N(ReRRRRRRR(RRR((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pytcheck_config_typesûs cCsLxEtjjƒD]4\}}|dkr|dkrtjdƒqqWdS(s1Warn if any socket_host is 'localhost'. See #711.sserver.socket_hostt localhosts»The 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.7/vendor-packages/cherrypy/_cpchecker.pytcheck_localhostsN(Rct __module__t__doc__tTrueRRRR'RR&RR!R2R<R=R@RARKRQRRRTRReRfRh(((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pyRs<     3    !    (R(RRtobjectR(((s9/usr/lib/python2.7/vendor-packages/cherrypy/_cpchecker.pyts