˺hddlmZddlZddlZddlZddlmZddlmZddl m Z m Z ddl m Z mZddlmZmZddlmZdd lmZdd lmZdd lmZer&>&>@ "3r!cddlm}ddlm}|jfd}||_t |dr|jfd}||_|jjfd}||j_dS)Nr)routerrctj}|t}||5} |jdkr|jj|_n|jdkr|jj |_n#t$rYnwxYw| ttj||dddn #1swxYwY||g|Ri|S)Nr"r#)rcurrentget_integrationr%configure_scoper+ matched_routename transactionpattern Exceptionadd_event_processor_make_event_processorweakrefref)registryrargskwargshub integrationscope old_call_views r sentry_patched_call_viewz?PyramidIntegration.setup_once..sentry_patched_call_viewGs>+C--.@AAK&((** e&8LHH070E0JE--(:oMM070E0ME-$---gk'.B.BKPP               !=7DTDDDVDD Ds5C 9A:9C : BC B8C  CCinvoke_exception_viewc|g|Ri|}|jrWt|jrC|jdkr8tjt t|j|S)Ni)exc_infoall status_intrr1r2r%_capture_exception)r,r>r?rvold_invoke_exception_views r $sentry_patched_invoke_exception_viewzKPyramidIntegration.setup_once..sentry_patched_invoke_exception_viewas|..tEdEEEfEEM6DM**6 ,, 334FGGS&t}555 r!ctj}|t}| ||Sfd}t |||S)Nc ||S#t$r/tj}t|t |YdSwxYwr)r8sysrGrJr )environstart_responseeinfo old_wsgi_callr,s r sentry_patched_inner_wsgi_callzgPyramidIntegration.setup_once..sentry_patched_wsgi_call..sentry_patched_inner_wsgi_callzs_$(=wGGG $$$LNNE&u---UOOOOO$s 5A A )rr1r2r%r)r,rQrRr@rArUrTs` r sentry_patched_wsgi_callz?PyramidIntegration.setup_once..sentry_patched_wsgi_callss}+C--.@AAK"$}T7NCCC $ $ $ $ $ $H'(FGG r!) r&r/pyramid.requestr _call_viewhasattrrERouter__call__)r/rrDrMrVrCrLrTs @@@r setup_oncezPyramidIntegration.setup_once?s #"""""++++++)  E E E E E*5 73 4 4 Q(/(E %     -QG ) .      (": r!)r")__name__ __module__ __qualname__ identifierr+r- staticmethodr\r!r r%r%1sSJ3333G:G:\G:G:G:r!r%c|dt|dtrdStj}|t dS|j}t||jddd\}}| ||dS)Nrr&F)typehandled)client_options mechanism)hint) issubclassrrr1r2r%clientr options capture_event)rGr@rjeventrhs r rJrJs{j!mDD +C -..6ZF&~$77KE4 e$'''''r!c8eZdZdZdZdZdZdZdZdZ dS) PyramidRequestExtractorc|jjSr)rpath_urlr,s r urlzPyramidRequestExtractor.urls |$$r!c|jjSr)rrQrrs r envzPyramidRequestExtractor.env |##r!c|jjSr)rcookiesrrs r rxzPyramidRequestExtractor.cookiesrvr!c|jjSr)rtextrrs r raw_dataz PyramidRequestExtractor.raw_datas |  r!cHdt|jjDS)Nc<i|]\}}t|dd||SfilenameNgetattr.0keyvalues r z0PyramidRequestExtractor.form..s@   U5*d33    r!r rPOSTrrs r formzPyramidRequestExtractor.form0  ' (9::    r!cHdt|jjDS)Nc<i|]\}}t|dd||Sr~rrs r rz1PyramidRequestExtractor.files..s@   Uuj$//    r!rrrs r fileszPyramidRequestExtractor.filesrr!c|j} tj|jS#t $rYdSwxYw)Nr)fileosfstatfilenost_sizer8)r,postdatars r size_of_filez$PyramidRequestExtractor.size_of_filesK} 8DKKMM**2 2   11 s*4 AAN) r]r^r_rsrurxr{rrrrbr!r roros}%%%$$$$$$!!!      r!rocfd}|S)Nc}||St5t||dddn #1swxYwYtr_t5|di}|dt |dddn #1swxYwY|S)Nuserid)r roextract_into_eventr setdefaultr)rmrhr user_info weak_requests r event_processorz._make_event_processor..event_processorsd,.. ?L ( * * G G #G , , ? ? F F F G G G G G G G G G G G G G G G $ % % J,.. J J!,,VR88 $$T+?+H+HIII J J J J J J J J J J J J J J J s##A  AA4:B::B>B>rb)rrArs` r r:r:s$ r!)0 __future__rrrPr;pyramid.httpexceptionsrrWrsentry_sdk.hubrrsentry_sdk.utilsr r sentry_sdk._compatr r sentry_sdk.integrationsr $sentry_sdk.integrations._wsgi_commonrsentry_sdk.integrations.wsgirsentry_sdk._typesrpyramid.responsertypingrrrrr webob.cookiesr webob.compatrrrrrpyramid.securityr)r%rJror:rbr!r rsr&&&&&& 000000######88888888NNNNNNNN11111111//////AAAAAA======"""""" 1))))))<<<<<<,,,,,,------((((((000000 77*D11 6,,,,655555;V:V:V:V:V:V:V:V:r(((('''''.'''Tr!