bgddlmZddlZddlZddlZddlmZmZddlm Z ddl m Z ddl m Z mZddlmZmZddlmZmZdd lmZdd lmZ dd lmZdd lmZn#e$r ed wxYwddlmZer&>&>@ "3r#cddlm}|jfd}||_ttdrtjfd}|t_|jjfd}||j_dS)Nr)routerc\tj}|t}|w|5}t ||j||ttj ||dddn #1swxYwY||g|Ri|Sr) rcurrentget_integrationr(configure_scope _set_transaction_name_and_sourcer/add_event_processor_make_event_processorweakrefref)registryr!argskwargshub integrationscope old_call_views r"sentry_patched_call_viewz?PyramidIntegration.setup_once..sentry_patched_call_viewMs+C--.@AAK&((**e4{r?rvold_invoke_exception_views r"$sentry_patched_invoke_exception_viewzKPyramidIntegration.setup_once..sentry_patched_invoke_exception_viewbs|..tEdEEEfEEM6DM**6 ,, 334FGGS&t}555 r#ctj}|t}| ||Sfd}t |||S)Nc ||S#t$r/tj}t|t |YdSwxYwr) ExceptionsysrGrJr )environstart_responseeinfo old_wsgi_callr0s r"sentry_patched_inner_wsgi_callzgPyramidIntegration.setup_once..sentry_patched_wsgi_call..sentry_patched_inner_wsgi_call{s_$(=wGGG $$$LNNE&u---UOOOOO$s 5A A )rr5r6r(r)r0rRrSr@rArVrUs` r"sentry_patched_wsgi_callz?PyramidIntegration.setup_once..sentry_patched_wsgi_callts}+C--.@AAK"$}T7NCCC $ $ $ $ $ $H'(FGG r#)r)r3 _call_viewhasattrrrERouter__call__)r3rDrMrWrCrLrUs @@@r" setup_oncezPyramidIntegration.setup_onceFs #""""")  E E E E E 5 73 4 4 Q(/(E %     -QG ) .      (": r#N)r%)__name__ __module__ __qualname__ identifierr/r1 staticmethodr\r#r"r(r(8sSJ3333A:A:\A:A:A:r#r(c|dt|dtrdStj}|t dS|j}t||jddd\}}| ||dS)Nrr)F)typehandled)client_options mechanism)hint) issubclassrrr5r6r(clientr options capture_event)rGr@rjeventrhs r"rJrJs{j!mDD +C -..6ZF&~$77KE4 e$'''''r#c |jj|jjd}|||t|dS#t $rYdSwxYw)Nr$)source) matched_routenamepatternset_transaction_namerrP)rBr/r!name_for_styles r"r8r8s  !/4$2:   "" , -#$56 #           sAA AAc8eZdZdZdZdZdZdZdZdZ dS) PyramidRequestExtractorc|jjSr)r!path_urlr0s r"urlzPyramidRequestExtractor.urls |$$r#c|jjSr)r!rRrys r"envzPyramidRequestExtractor.env |##r#c|jjSr)r!cookiesrys r"rzPyramidRequestExtractor.cookiesr}r#c|jjSr)r!textrys r"raw_dataz PyramidRequestExtractor.raw_datas |  r#cHdt|jjDS)Nc<i|]\}}t|dd||SfilenameNgetattr.0keyvalues r" z0PyramidRequestExtractor.form..s@   U5*d33    r#r r!POSTrys r"formzPyramidRequestExtractor.form0  ' (9::    r#cHdt|jjDS)Nc<i|]\}}t|dd||Srrrs r"rz1PyramidRequestExtractor.files..s@   Uuj$//    r#rrys r"fileszPyramidRequestExtractor.filesrr#c|j} tj|jS#t $rYdSwxYw)Nr)fileosfstatfilenost_sizerP)r0postdatars r" size_of_filez$PyramidRequestExtractor.size_of_filesK} 8DKKMM**2 2   11 s*4 AAN) r]r^r_rzr|rrrrrrbr#r"rvrvs}%%%$$$$$$!!!      r#rvcfd}|S)Nc}||St5t||dddn #1swxYwYtr_t5|di}|dt |dddn #1swxYwY|S)Nuserid)rrvextract_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#)7 __future__rrrQr;sentry_sdk.hubrrsentry_sdk.scopersentry_sdk.tracingrsentry_sdk.utilsrr sentry_sdk._compatr r sentry_sdk.integrationsr r $sentry_sdk.integrations._wsgi_commonrsentry_sdk.integrations.wsgirpyramid.httpexceptionsrpyramid.requestr ImportErrorsentry_sdk._typesrpyramid.responsertypingrrrrr webob.cookiesr webob.compatrrrrrpyramid.securityr-r(rJr8rvr:rbr#r"rs&&&&&& 88888888""""""//////21111111========AAAAAA======0444444'''''''000 ,. / //0,+++++ 1))))))<<<<<<,,,,,,------((((((000000 77*D116,,,, 655555;P:P:P:P:P:P:P:P:f((((    '''''.'''Ts AA*