Qf ddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z m Z dZejZdaddZdZdZdZdZd Zd Zd Zej4d ej6Zd ZGddeZGdde eZ!Gdde"eZ#Gdde$eZ%GddeZ&dZ'Gdde&Z(e(Z)dZ*edfdZ+dZ,y)N)ThreadingTCPServerStreamRequestHandleriF#c ddl}t|trZtjj |st |dtjj|st|dt||jr|}nX |j|}t|dr|j|n(tj|}|j||t#|}t%j& t)t+||}t-|||t%j.y#|j $r}t|d|d}~wwxYw#t%j.wxYw)Nrz doesn't existz is an empty filereadline)encodingz is invalid: ) configparser isinstancestrospathexistsFileNotFoundErrorgetsize RuntimeErrorRawConfigParser ConfigParserhasattr read_fileio text_encodingread ParsingError_create_formatterslogging _acquireLock_clearExistingHandlers_install_handlers_install_loggers _releaseLock) fnamedefaultsdisable_existing_loggersrrcpe formattershandlerss 5/opt/alt/python312/lib64/python3.12/logging/config.py fileConfigr(5sD%ww~~e$#ug^$<= ='%(9:; ;%556  ;**84Buj) U#++H51$B'J  %R4X'?@(( ;% aS9: : ; s% AD9#E 9EEE E6c |jd}|jd}t|}|D]}|dz|z} t||}|S#t$rt|t||}Y>wxYw)N.r)splitpop __import__getattrAttributeError)nameusedfoundns r'_resolver4as}3 ::c?D 88A;D t E czA~ &E1%E L & t E1%E &s A  A0/A0c6ttj|SN)mapr strip)alists r' _strip_spacesr:os syy%  c |dd}t|siS|jd}t|}i}|D]}d|z}|j|ddd}|j|ddd}|j|d dd }|j|d dd}tj } ||jd } | r t | } |&t|tt}| |||| } n | |||} | ||<|S)Nr%keys,z formatter_%sformatT)rawfallbackdatefmtstyle%r!class)r!) lenr+r:getr Formatterr4evalvars) r#flistr%formsectnamefsdfsstlr!c class_namefs r'rrrs& | V $E u: KK E % EJ!D( VVHhD4V @ffXydTfBffXwD3f?66(JD46H   \%%g. $A  Hd7m4H"c32A"c3A 4#$ r;cb |dd}t|siS|jd}t|}i}g}|D]3}|d|z}|d}|jdd} t |t t }|jdd } t | t t } |jd d } t | t t } || i| } || _ d |vr|d } | j| t|r| j||t|t jjr0|jd d} t| r|j!| | f| ||<6|D]\} }| j#|||S#ttf$rt|}Y7wxYw)Nr&r=r>z handler_%srE formatterargs()kwargsz{}leveltarget)rFr+r:rGrIrJrr/ NameErrorr4r0setLevel setFormatter issubclassr& MemoryHandlerappend setTarget)r#r%hlistr&fixupshandsectionklassfmtrWrYhrZr[ts r'rrs% zN6 "E u: KK E % EH F\D() kk+r* $W .E{{64(D$w-(Xt,fd7m, 4 "6 " g G$E JJu  s8 NN:c? + eW--;; <[[2.F6{ q&k*/21 HQK  O+ * $UOE $sFF.-F.c tj}|D]o}|jj|}||vrIt |tj r;|j tjg|_d|_ i||_ qy)NT) rrootmanager loggerDictr PlaceHolderr]NOTSETr& propagatedisabled)existing child_loggersdisable_existingrllogloggers r'_handle_existing_loggersrxsn  <rl logger_rootrZr&z logger_%squalnamerq)rAr*r)r+listr:removerrlr]r& removeHandlerrF addHandlerrmrnr=sortgetint getLoggerindexrarqrrrx)r#r&rullistrfrlrvrZrircrersrtqnrqrwiprefixedpflen num_existings r'rrst$ yM& !E KK E u% &E LLG < *DLL++0023H  MMOM[3&' Z NN;N; ""2& >r"Q&ACxHMEx=Ll"A;v&(2!((!5Ql" OOB  g G$E OOE "#A   #$$ # u:KK$E!%(E!!(4.15TX}6FGr;c tjjtjtjddtjdd=yr6)r _handlersclearshutdown _handlerListr;r'rr"s>+  W))!,-Qr;z^[a-z_][a-z0-9_]*$cNtj|}|std|zy)Nz!Not a valid Python identifier: %rT) IDENTIFIERmatch ValueError)sms r' valid_identr,s)A [a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)extcfgcFt||_||j_yr6)rconfigr)rrs r'__init__zBaseConfigurator.__init__s$V, #'  r;cJ |jd}|jd} |j|}|D]}|d|zz } t||}|S#t$r |j|t||}YDwxYw#t $r}t d|d|}||d}~wwxYw)Nr*rzCannot resolve z: )r+r,importerr.r/ ImportErrorr)rrr0r1r2fragr$vs r'resolvezBaseConfigurator.resolves wws|xx{ MM$'Ed "1#E40EL&1MM$'#E40E1 a;D AHHJqM*A$$**40!((*Q-(A**006Ahhjm#1177< !#A+$'H$%aD>D$38$&@AA',$-+$%cF+s*D&&D76D7cJ t|ts$t|trt|}||_|St|ts$t|t rt |}||_|St|t s0t|tr t|dst |}||_|St|tri|jj|}|rL|j}|d}|jj|d}|r|d}t||}||}|S)N_fieldsprefixsuffix)r rrrrr~rrrr CONVERT_PATTERNr groupdictvalue_convertersrGr.)rrrrr converterrs r'rzBaseConfigurator.converts %0Zt5L"5)E!%E $ #E>2z%7N"5)E!%E  E?3E5)'%2K#E*E!%E  s #$$**51AKKM8 1155fdC x[F 'i 8I%f-E r;c8 |jd}t|s|j|}|Dcic]}|dk7s t|s|||}}|di|}|jdd}|r%|j D]\}}t ||||Scc}w)NrXr*r)r,callablerritemssetattr) rrrQkrYrpropsr0rs r'configure_customz!BaseConfigurator.configure_customs? JJt { QA(.P118 A!VAY,PV 3% ${{} ee, - Qs B B Bc> t|tr t|}|Sr6)r r~rrs r'as_tuplezBaseConfigurator.as_tuples> eT "%LE r;N)rrrrecompilerrrrrr staticmethodr-rrrrrrrrrr;r'rrts!bjj!IJO2::o.L"**./KBJJ56MBJJx(M J'H(*# D8 r;rc ttjryddlm}t|rygd}t fd|DS)NTr)Queue) emptyfullrG get_nowaitput put_nowaitjoinqsize task_donec3JK|]}tt|dywr6)rr.).0methodobjs r' z(_is_queue_like_object..s'.,6VT23,s #)r queuermultiprocessing.queuesall)rMPQueuequeue_interfaces` r'_is_queue_like_objectrsJ4#u{{#7#wO .,. ..r;cPeZdZ dZdZdZdZdZdZdZ d dZ d d Z d d Z y ) DictConfiguratorc |j}d|vr td|ddk7rtd|dz|jdd}i}tj |r|j d|}|D]s}|tj vrtd|z tj |}||}|j d d}|r$|jtj|u|j d |} | D]} |j|| |d |j dd} | r$ |j| d n|jdd } t|j d|} | D]} |j| || |<|j d|}|D]} |j||||<|j d|}g}t|D]#} |j!||}||_|||<%|D]#} |j!||}||_|||<%tj*} t-| j.j0j3}|j5g}|j d |} | D]}||vro|j7|dz}|dz}t9|}t9|}||kr*||d||k(r|j)|||dz }||kr*|j;| |j|| |t=||| |j dd} | r |j| tj>y#t$r} td |z| d} ~ wwxYw#t$r} td |z| d} ~ wwxYw#t$r} td| d} ~ wwxYw#t$r} td|z| d} ~ wwxYw#t$r} td|z| d} ~ wwxYw#t$rC} dt%| j&vr|j)|ntd |z| Yd} ~ kd} ~ wwxYw#t$r} td |z| d} ~ wwxYw#t$r} td |z| d} ~ wwxYw#t$r} td| d} ~ wwxYw#tj>wxYw)Nversionz$dictionary doesn't specify a versionr}zUnsupported version: %s incrementalFr&zNo handler found with name %rrZzUnable to configure handler %rrzTzUnable to configure logger %rrlzUnable to configure root loggerr"r%z Unable to configure formatter %rfilterszUnable to configure filter %rz not configured yetr*) rrr,rrrGrr] _checkLevel Exceptionconfigure_loggerconfigure_rootrconfigure_formatterconfigure_filtersortedconfigure_handlerr0r __cause__rarlr~rmrnr=rrrFrrxr)rrr  EMPTY_DICTr&r0handlerhandler_configrZr$rzrlrur%r deferredrsrtrrrrs r' configurezDictConfigurator.configures# F "CD D )  !6 9JJK Kjj6  Q #!::j*=$D7#4#44(*36:*;<<A&-&7&7&=G-5d^N$2$6$6w$EE$ ' 0 01D1DU1K L%!**Y ;#D=--dGDM4H$ zz&$/:++D$7 $*::.H$#O &($ZZ jA &DG+/+C+C?  !#  **Y ;#Dx'$NN4014#'#: #H '*8} ,.'{6E2h> - 4 4Xa[ AFA ,.!-=--dGDMB$<)=)9;zz&$/:++D1  "G )A",.248.9#:?@AA%=(*.04*56;<==%:(*2389::%G(*8:>*?@EFGG%D(*57;*<=BCDD%A0C 4DD$OOD1",.248.9#:?@A2A%=(*.04*56;<==N%=(*.04*56;<==2%:(*2389::  "sX9R2AM))R2N R21N)5R29OR2*O&$R2& PR2 Q.C R28R2 Q5#R2R) N2NNR2 N&N!!N&&R2) O2 N>>OR2 O#OO##R2& P/O>>PR2 Q8Q R2 QR2 Q2Q--Q22R25 R>R  RR2 R/ R**R//R22Sc" d|vr|d} |j|}|S|j dd}|j dd}|j dd}|j dd}|j d d} |st j } n t|} i} | | | d <d |vr| ||||d fi| }|S| |||fi| }|S#t$rC}dt|vr|jd|d<||d<|j|}Yd}~|Sd}~wwxYw) NrXz'format'r?rhrBrCrDrEr!validate)rrr r,rGrrHr4) rrfactoryrterhdfmtrCcnamer!rQrYs r'rz$DictConfigurator.configure_formattersN6 6>TlG 7..v6L 5**Xt,C::i.DJJw,EJJw-Ezz*d3H%%UOF #%-z"V#3eVJ-?J6J 3e6v6 K 7SW, !' 8 4u &t ..v68 K 7sC D 8D  Dc d|vr|j|}|S|jdd}tj|}|S)NrXr0rV)rrGrFilter)rrrr0s r'rz!DictConfigurator.configure_filtersH3 6>**62F ::fb)D^^D)F r;c |D]J} t|stt|ddr|}n|jd|}|j|Ly#t$r}t d|z|d}~wwxYw)Nfilterr zUnable to add filter %r)rr.r addFilterr r)rfiltererr rSfilter_r$s r' add_filterszDictConfigurator.add_filterssy=A GA;(71h+E"FG"kk)4Q7G""7+  G !:Q!>?QF GsAA A/A**A/c .d|vr|jd}ntj}|jdd}|jdtjj }|jdg}||g|d|i}||fi|}||_|S)Nrrespect_handler_levelFlistenerr&)r,rrrr& QueueListenerr)) rrgrYqrhllklassr&r)rs r'_configure_queue_handlerz)DictConfigurator._configure_queue_handlers f  7#A Ajj0%8J(8(8(F(FG::j"-!BhBcB$V$#r;c t|}|jdd}|r |jd|}|jdd}|jdd}d|vr1|jd}t |s|j |}|}n|jd} t | r| } n|j | } t| tjjryd|vrtj|d|d<d |vr, |d } |jd | } t| tjs|j|td | |d <nt| tjj r3d |vr|d } t| t"r5|j | }t |std| z||d <nYt| tr0d| vrtd| z|j%t| |d <nt'| std| zd|vr|d}t|t(r2t|tjj*std|zt|t"rS|j |}t|t(r}t|tjj*sYtd|zt|tr-d|vrtd|z|j%t|}ntd|zt |std|z||d<d |vrg} |d D]^}|jd |}t|tjs|j|td|z|j-|` ||d <nt| tjj.rd|vr|j1|d|d<n?t| tjj2rd|vr|j1|d|d<t| tjj r!t5j6|j8| }n| }|Dcic]}|dk7s t;|s|||}} |di|}|r|j=||$|j?tj||r|jA|||jdd}|r%|jCD]\}}tE||||S#t$r}t d|z|d}~wwxYw#t$r}t d  z|d}~wwxYw#t$r}t dz|d}~wwxYwcc}w#t$r5}dt#|vr|jd|d<|di|}Yd}~&d}~wwxYw)NrUr%zUnable to set formatter %rrZr rXrE flushLevelr[r&ztarget not configured yetzUnable to set target handler %rrzInvalid queue specifier %rr)zInvalid listener specifier %rz)Required handler %r is not configured yetz!Unable to set required handler %rmailhostaddressr*z'stream'streamstrmr)#rr,rr rrrr_rr&r`r r Handlerupdater QueueHandlerr rrrr*ra SMTPHandlerr SysLogHandler functoolspartialr.rr^r]r&rr)rr config_copyrUr$rZr rQrrrgtnthqspecr+lspecr)rchnrirrYrrrr0rs r'rz"DictConfigurator.configure_handlers46l JJ{D1  : KK 5i@  7D)**Y- 6> 4 AA;LLOGJJw'E U+%!1!1!?!?@6)+2+>+>vl?S+TF<(v%X#H-![[4R8)"goo>"MM+6"+,G"HH+-x(E7#3#3#@#@Af$"7OE!%- LL/'{"+,H5,P"QQ*+#w#E40u,"+,H5,P"QQ*.*?*?U *Lw259'(Du(LMM'":.E!%.)%1A1A1O1OP"+,Ke,S"TT%eS1'+||E':H)(D9$.x9I9I9W9W$X&/0ORW0W&X X't4#50&/0ORW0W&X X'+'<'!>?#++D,I,I5Q(.P118 A!VAY,P '&v&F     *   OOG//6 7    VW - 3% ${{} ee, - e : "&(1"2389: :8%X()JR)OPVWWXf%Z()Lr)QRXYYZQ 'R( $ZZ1F6N&v&F 'ssT.AUA&U.< V VVV. U 7UU  U+U&&U+. V 7VV  W*W  Wc |D]$} |j|jd|&y#t$r}td|z|d}~wwxYw)Nr&zUnable to add handler %r)rrr r)rrwr&rir$s r' add_handlerszDictConfigurator.add_handlerssX<A H!!$++j"9!"<= H !;a!?@aG Hs!, A AA c` |jdd}|$|jtj||ss|jddD]}|j ||jdd}|r|j |||jdd}|r|j||yyy)NrZr&r )rGr]rr r&rrCr&)rrwrr rZrir&r s r'common_logger_configz%DictConfigurator.common_logger_configs  7D)   OOG//6 7__Q'$$Q'(zz*d3H!!&(3jjD1G  1r;c tj|}|j|||d|_|j dd}|||_yy)NFrq)rrrErrrGrq)rr0rr rwrqs r'r z!DictConfigurator.configure_loggersQ<""4( !!&&+>JJ{D1  (F  !r;cT tj}|j|||yr6)rrrE)rrr rls r'rzDictConfigurator.configure_roots%8  " !!$ .ConfigStreamHandlerc |j}|jd}t|dk(rtjd|d}|jj|}t||kr/||j|t|z z}t||kr/|j j |j j |}|2|jd} ddl}|j|}t||j j"r%|j j"j%yyy#t$rHtj|} t|n##t$rtj YnwxYwYwxYw#t&$r}|j(t*k7rYd}~yd}~wwxYw)Nz>Lrzutf-8) connectionrecvrFstructunpackserververifydecodejsonloadsrJr rStringIOr( traceback print_excreadysetOSErrorerrno RESET_ERROR)rconnchunkslenrWrfiler$s r'handlez*listen..ConfigStreamHandler.handles~   ! u:?!==u5a8D OO006Ee*t+ % $U2C(D De*t+{{))5 $ 2 25 9( % W 5 6'#zz%0A&qM{{(( ))--/)-# )6$&;;u#5D6 *4 0#,6 ) 3 3 56 6 77k)* sgBF AF% E:FF! E-,F-F  F F  FFFF F=F88F=N)rrrrerr;r'ConfigStreamHandlerrMs  % r;rfc*eZdZ dZdedddfdZdZy)$listen..ConfigSocketReceiverr} localhostNctj|||f|tjd|_tj d|_||_||_y)Nrr}) rrrrabortrtimeoutr\rU)rhostportrr\rUs r'rz-listen..ConfigSocketReceiver.__init__sL  ' 'tTlG D  "DJ  "DLDJ DKr;c<ddl}d}|s|j|jjggg|j\}}}|r|j t j |j}t j|s|jy)Nr) selectsocketfilenorlhandle_requestrrrkr server_close)rrprkrdwrexs r'serve_until_stoppedz8listen..ConfigSocketReceiver.serve_until_stoppeds E#]]DKK,>,>,@+A+-r+/<<9 B'')$$& $$&    r;)rrrallow_reuse_addressDEFAULT_LOGGING_CONFIG_PORTrrxrr;r'ConfigSocketReceiverrhs&   +2M!d ! r;r{c(eZdZfdZdZxZS)listen..Serverct|||_||_||_||_t j|_yr6) superrrcvrhdlrrnrU threadingEventr\)rrrrnrUServer __class__s r'rzlisten..Server.__init__s: &$ ( *DIDIDI DK"*DJr;cl|j|j|j|j|j}|jdk(r|j d|_|jj tj|a tj|jy)N)rnrr\rUrr}) rrnrr\rUserver_addressr]rr _listenerrrx)rrTs r'runzlisten..Server.runsYYDIItyy%)ZZ&*kk3FyyA~"11!4 JJNN   "I  "  & & (r;)rrrrr __classcell__)rrs@r'rr}s  + )r;r)rrrThread)rnrUrfr{rs @r'listenrsJ&,2,\ 1 >)!!). &(;T6 JJr;c tj tr dt_datjy#tjwxYw)Nr})rrrrkrrr;r' stopListeningr+sB  IOIs ?A)NTN)-r_r:rrlogging.handlersr rrrRrrZ socketserverrrrz ECONNRESETr`rr(r4r:rrrxrrrIrrobjectrrrr~rrrrrrrIrJrrrr;r'rs"   A#   )X !:$L/,THn RZZ,bdd 3 fB @T? @#T?#@e_@AvAF.6V='V=p #( ,DxKt r;