bgGjddlmZddlmZddlmZddlmZmZm Z m Z ddl m Z m Z ddlmZddlmZddlmZer0dd lmZdd lmZdd lmZdd lmZdd lmZddlmZmZmZddlmZmZ ddlm Z m!Z!m"Z#m$Z$m%Z&n#e'$r e dwxYwdZ(Gdde Z)GddeZ*dZ+dZ,dS))absolute_import)Hub)SOURCE_FOR_STYLE)capture_internal_exceptionsevent_from_exception parse_versiontransaction_from_function) Integration DidNotEnable)SentryWsgiMiddleware)RequestExtractor) TYPE_CHECKING)_ScopedResponse)Any)Dict)Callable)Optional) FileUpload FormsDict LocalRequest)EventProcessorEvent)BottleRouterequest HTTPResponse __version__zBottle not installed)endpointurlc4eZdZdZdZddZedZdS)BottleIntegrationbottlerc\|tvrtd|dtd||_dS)Nz%Invalid value for transaction_style: z (must be in ))TRANSACTION_STYLE_VALUES ValueErrortransaction_style)selfr(s U/opt/cloudlinux/venv/lib64/python3.11/site-packages/sentry_sdk/integrations/bottle.py__init__zBottleIntegration.__init__/sL $< < <*$$$&>&>&>@ "3c^tt}|'tdt|dkrtdtjfd}|t_tjfd}|t_tjfd}|t_dS)NzUnparsable Bottle version: {})r zBottle 0.12 or newer required.ctj}|t}| ||St fd||S)Ncg|Ri|SN)akwold_appr)s r*zOBottleIntegration.setup_once..sentry_patched_wsgi_app..Ps!9P9P9P9PR9P9Pr,)rcurrentget_integrationr!r )r)environstart_responsehub integrationr5s` r*sentry_patched_wsgi_appz=BottleIntegration.setup_once..sentry_patched_wsgi_appHsj+C--.?@@K"wtWn===Q'(P(P(P(P(PQQ r,c tj}|t}| ||S|}|5|}|5}d|_|t|t|dddn #1swxYwY||}dddn #1swxYwY|S)Nr") rr7r8r! push_scopeconfigure_scope_nameadd_event_processor_make_request_event_processorbottle_request) r)r9r;r< scope_managerappscoperes old_handles r*_patched_handlez5BottleIntegration.setup_once.._patched_handleYsS+C--.?@@K"!z$000 NN,,M 0 0((**e"*EK--5c>;WW !jw// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0Js6 C#1B  C B$ $C'B$ (CC Cctjt}|g|Ri||Sjfd}|S)Nc |i|}nR#t$rt$r;}t|jddd\}}|||d}~wwxYw|S)Nr"F)typehandled)client_options mechanism)hint)r Exceptionroptions capture_event) argskwargsrH exceptioneventrQclientr;prepared_callbacks r*wrapped_callbackzUBottleIntegration.setup_once..patched_make_callback..wrapped_callbacks $++T.patched_make_callbackts+C--.?@@K 1 1$ H H H H H H "((ZF       $$ #r,) rBOTTLE_VERSIONr formatr__call___handler_make_callback)versionr=rJr]r5rIr\s @@@r* setup_oncezBottleIntegration.setup_once9s // ?>EEnUUVV V W  ?@@ @/     2^      ,)"0 $ $ $ $ $> 5r,N)r)__name__ __module__ __qualname__ identifierr(r+ staticmethodrdr2r,r*r!r!*sSJ3333Y5Y5\Y5Y5Y5r,r!c2eZdZdZdZdZdZdZdZdS)BottleRequestExtractorc|jjSr1)rr9r)s r*envzBottleRequestExtractor.env |##r,c|jjSr1)rcookiesrms r*rqzBottleRequestExtractor.cookiesror,c>|jjSr1)rbodyreadrms r*raw_datazBottleRequestExtractor.raw_datas| %%'''r,cj|rdS|jjSr1)is_jsonrformsdecoderms r*formzBottleRequestExtractor.forms. <<>> 4|!((***r,cF|rdS|jjSr1)rwrfilesrms r*r|zBottleRequestExtractor.filess" <<>> 4|!!r,c|jSr1)content_length)r)files r* size_of_filez#BottleRequestExtractor.size_of_files ""r,N) rerfrgrnrqrurzr|rr2r,r*rkrksn$$$$$$(((+++ """#####r,rkcd}|dkr|jjpd}n-|dkr'|jjpt|jjpd}||d<dt |i|d<dS)Nr#rr transactionsourcetransaction_info)routerulenamer callbackr)rXr(rrs r* _set_transaction_name_and_sourcers DE!!}!'R j ( ( M  ()?@@   E-!)+;.event_processors( 0MwWWW ( * * F F "7 + + > >u E E E F F F F F F F F F F F F F F F s#AAAr2)rFrr<rs `` r*rCrCs* r,N)- __future__rsentry_sdk.hubrsentry_sdk.tracingrsentry_sdk.utilsrrrr sentry_sdk.integrationsr r sentry_sdk.integrations.wsgir $sentry_sdk.integrations._wsgi_commonr sentry_sdk._typesrrtypingrrrrr"rrrrrrrrrDrrr^ ImportErrorr&r!rkrrCr2r,r*rsn&&&&&&////// >=============AAAAAA++++++8<<<<<<::::::::::77777777 //// ,- . ..//i5i5i5i5i5 i5i5i5X#####-###>PPP$     s ,A;;B