3t!/PddlmZddlmZddlmZmZmZddlm Z m Z ddl m Z ddl mZddlmZer.ddl mZdd lmZdd lmZdd lmZdd lmZdd lmZmZmZddlmZ ddlmZmZmZm Z m!Z"n#e#$r e dwxYwdZ$Gdde Z%GddeZ&dZ'dS))absolute_import)Hub)capture_internal_exceptionsevent_from_exceptiontransaction_from_function) Integration DidNotEnable)SentryWsgiMiddleware)RequestExtractor)MYPY)_ScopedResponse)Any)Dict)Callable)Optional) FileUpload FormsDict LocalRequest)EventProcessor)BottleRouterequest HTTPResponse __version__zBottle not installed)endpointurlc4eZdZdZdZddZedZdS)BottleIntegrationbottleNrc\|tvrtd|dtd||_dS)Nz%Invalid value for transaction_style: z (must be in ))TRANSACTION_STYLE_VALUES ValueErrortransaction_style)selfr$s ~/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/sentry_sdk/integrations/bottle.py__init__zBottleIntegration.__init__-sL $< < <*$$$&>&>&>@ "3c ttttjd}n7#t t f$r#td|wxYw|dkrtdtj fd}|t_ tj fd}|t_ tj fd}|t_ dS)N.zUnparsable 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..Ns!9P9P9P9PR9P9Pr()rcurrentget_integrationrr )r%environstart_responsehub integrationr2s` r&sentry_patched_wsgi_appz=BottleIntegration.setup_once..sentry_patched_wsgi_appFsj+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) rr4r5r push_scopeconfigure_scope_nameadd_event_processor_make_request_event_processorbottle_request) r%r6r8r9 scope_managerappscoperes old_handles r&_patched_handlez5BottleIntegration.setup_once.._patched_handleWsS+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)NrF)typehandled)client_options mechanism)hint)r Exceptionroptions capture_event) argskwargsrE exceptioneventrNclientr8prepared_callbacks r&wrapped_callbackzUBottleIntegration.setup_once..patched_make_callback..wrapped_callback}s $++T.patched_make_callbackrs+C--.?@@K 1 1$ H H H H H H "((ZF       $$ #r()tuplemapintBOTTLE_VERSIONsplit TypeErrorr#r formatr__call___handler_make_callback)versionr:rGrZr2rFrYs @@@r& setup_oncezBottleIntegration.setup_once7s PC^%9#%>%>??@@GG:& P P P>EEgNNOO O P W  ?@@ @/     2^      ,)"0 $ $ $ $ $> 5s 4:4A.)r)__name__ __module__ __qualname__ identifierr$r' staticmethodrfr/r(r&rr(sSJ3333Y5Y5\Y5Y5Y5r(rc2eZdZdZdZdZdZdZdZdS)BottleRequestExtractorc|jjSr.)rr6r%s r&envzBottleRequestExtractor.env |##r(c|jjSr.)rcookiesros r&rszBottleRequestExtractor.cookiesrqr(c>|jjSr.)rbodyreadros r&raw_datazBottleRequestExtractor.raw_datas| %%'''r(cj|rdS|jjSr.)is_jsonrformsdecoderos r&formzBottleRequestExtractor.forms. <<>> 4|!((***r(cF|rdS|jjSr.)ryrfilesros r&r~zBottleRequestExtractor.filess" <<>> 4|!!r(c|jSr.)content_length)r%files r& size_of_filez#BottleRequestExtractor.size_of_files ""r(N) rgrhrirprsrwr|r~rr/r(r&rmrmsn$$$$$$(((+++ """#####r(rmcfd}|S)NcX jdkr)jjptjj|d<njdkrjj|d<n#t $rYnwxYwt5t |dddn #1swxYwY|S)Nr transactionr) r$routenamercallbackrulerOrrmextract_into_event)rUrNr9rs r&innerz,_make_request_event_processor..inners , ::'.}'9(=VM*>>m$$.%77'.}'9m$    D ) * * F F "7 + + > >u E E E F F F F F F F F F F F F F F F s$AA AA0#BB#&B#r/)rCrr9rs `` r&r@r@s)$ Lr(N)( __future__rsentry_sdk.hubrsentry_sdk.utilsrrrsentry_sdk.integrationsrr sentry_sdk.integrations.wsgir $sentry_sdk.integrations._wsgi_commonr sentry_sdk._typesr r typingrrrrrrrrrrrrrArrr^ ImportErrorr"rrmr@r/r(r&rs:&&&&&& >=============AAAAAA""""""1<<<<<<::::::::::000000 //// ,- . ..//i5i5i5i5i5 i5i5i5X#####-###>s "A11B