asda?‰PNG  IHDR ? f ??C1 sRGB ??é gAMA ±? üa pHYs ? ??o¨d GIDATx^íüL”÷e÷Y?a?("Bh?_ò???¢§?q5k?*:t0A-o??¥]VkJ¢M??f?±8\k2íll£1]q?ù???T usr/lib64/python2.7/logging/config.pyo000064400000062446151027350220013502 0ustar00 {fc@sdZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl Z yddl Z ddlZWnek reZ nXddlmZmZdZejZeaeedZdZdZdZd Zd Zd Zej d ej!Z"d Z#de$fdYZ%de&e%fdYZ'de(e%fdYZ)de*e%fdYZ+de$fdYZ,de,fdYZ-e-Z.dZ/edZ0dZ1dS(s 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! iN(tThreadingTCPServertStreamRequestHandleriF#cCsddl}|j|}t|dr:|j|n |j|t|}tjz7tjjtj 2t ||}t |||Wdtj XdS(sD 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). iNtreadline( t ConfigParserthasattrtreadfptreadt_create_formatterstloggingt _acquireLockt _handlerstcleart _handlerListt_install_handlerst_install_loggerst _releaseLock(tfnametdefaultstdisable_existing_loggersRtcpt formattersthandlers((s&/usr/lib64/python2.7/logging/config.pyt fileConfig<s     cCs|jd}|jd}t|}x\|D]T}|d|}yt||}Wq1tk rt|t||}q1Xq1W|S(s)Resolve a dotted name to a global object.t.i(tsplittpopt __import__tgetattrtAttributeError(tnametusedtfoundtn((s&/usr/lib64/python2.7/logging/config.pyt_resolve[s    cCstd|S(NcSs |jS(N(tstrip(tx((s&/usr/lib64/python2.7/logging/config.pytjt(tmap(talist((s&/usr/lib64/python2.7/logging/config.pyt _strip_spacesiscCs t|tr|S|jdS(Nsutf-8(t isinstancetstrtencode(ts((s&/usr/lib64/python2.7/logging/config.pyt_encodedlsc Cs|jdd}t|s"iS|jd}t|}i}x|D]}d|}|j|}d|kr|j|dd}nd }d|kr|j|dd}nd }tj}d|kr|j|d} | rt| }qn|||} | ||s  R|cBs#eZdZdZddZRS(sA converting list wrapper.cCs"tj||}|j||S(N(R[RR(RRR((s&/usr/lib64/python2.7/logging/config.pyROsicCstj||}|j|S(N(R[RRy(RtidxR((s&/usr/lib64/python2.7/logging/config.pyRSs(RRRRR(((s&/usr/lib64/python2.7/logging/config.pyR|Ms R}cBseZdZdZRS(sA converting tuple wrapper.cCs(tj||}|j||dtS(NR(ttupleRRR(RRR((s&/usr/lib64/python2.7/logging/config.pyRYs(RRRR(((s&/usr/lib64/python2.7/logging/config.pyR}WstBaseConfiguratorcBseZdZejdZejdZejdZejdZejdZ idd6dd 6Z e Z d Z d Zd Zd ZdZdZdZRS(sI The configurator base class which defines some useful defaults. s%^(?P[a-z]+)://(?P.*)$s ^\s*(\w+)\s*s^\.\s*(\w+)\s*s^\[\s*(\w+)\s*\]\s*s^\d+$t ext_converttextt cfg_converttcfgcCs@t||_||j_tttjkr<t|_ndS(N(R{tconfigRxRzRttypest FunctionTypetimporter(RR((s&/usr/lib64/python2.7/logging/config.pyt__init__rs c Cs|jd}|jd}yy|j|}x_|D]W}|d|7}yt||}Wq7tk r|j|t||}q7Xq7W|SWnVtk rtjd\}}td||f}|||_ |_ |nXdS(s` Resolve strings to objects using standard import and attribute syntax. RiisCannot resolve %r: %sN( RRRRRt ImportErrortsystexc_infoRst __cause__t __traceback__( RR,RRRtfragtettbtv((s&/usr/lib64/python2.7/logging/config.pytresolve|s"    cCs |j|S(s*Default converter for the ext:// protocol.(R(RR((s&/usr/lib64/python2.7/logging/config.pyRscCsO|}|jj|}|dkr7td|n||j}|j|jd}x|rJ|jj|}|r||jd}n|jj|}|r|jd}|j j|s||}qyt |}||}Wqt k r||}qXn|r1||j}qatd||fqaW|S(s*Default converter for the cfg:// protocol.sUnable to convert %risUnable to convert %r at %rN( t WORD_PATTERNRrR6RstendRtgroupst DOT_PATTERNt INDEX_PATTERNt DIGIT_PATTERNtintt TypeError(RRtrestRutdRR ((s&/usr/lib64/python2.7/logging/config.pyRs2     cCs/t|t r7t|tr7t|}||_nt|t rnt|trnt|}||_nt|t rt|trt|}||_nt|tr+|j j |}|r+|j }|d}|j j |d}|r(|d}t||}||}q(q+n|S(s 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. tprefixtsuffixN(R)R{RRxR|R[R}Rt basestringtCONVERT_PATTERNRrt groupdicttvalue_convertersR3R6R(RRRuRRt converterR((s&/usr/lib64/python2.7/logging/config.pyRys*         c Cs|jd}t|d rUttdrUt|tjkrU|j|}n|jdd}tg|D]"}t|rq|||f^qq}||}|rx-|j D]\}}t |||qWn|S(s1Configure an object with a user-supplied factory.s()t__call__t ClassTypeRN( RRRRzRRR6RRvtitemstsetattr( RRR>tpropstktkwargsRRR((s&/usr/lib64/python2.7/logging/config.pytconfigure_customs45 cCs"t|trt|}n|S(s0Utility function which converts lists to tuples.(R)R[R(RR((s&/usr/lib64/python2.7/logging/config.pytas_tuples(RRRtretcompileRRRRRRRRRRRRRyRR(((s&/usr/lib64/python2.7/logging/config.pyR^s"    "  tDictConfiguratorcBsheZdZdZdZdZdZdZdZe dZ e dZ e d Z RS( s] Configure logging using a dictionary-like object to describe the configuration. cCs|j}d|kr$tdn|ddkrKtd|dn|jdt}i}tjzz|r|jd|}x|D]}|tjkrtd|qyLtj|}||}|jdd}|r|j tj |nWqt k r.} td || fqXqW|jd |} xU| D]M}y|j || |t WqLt k r} td || fqLXqLW|jd d} | ry|j| t Wqt k r} td | qXqn|jdt } tjjtj2|jd|} xU| D]M}y|j| || |RtcnameRRtthRRRR((s&/usr/lib64/python2.7/logging/config.pyRsb 4     5 cCs]xV|D]N}y|j|jd|Wqtk rT}td||fqXqWdS(s.Add handlers to a logger from a list of names.RsUnable to add handler %r: %sN(R^RRRs(RRlRRTR((s&/usr/lib64/python2.7/logging/config.pyt add_handlerss  cCs|jdd}|dk r7|jtj|n|sx|jD]}|j|qHW|jdd}|r|j||n|jdd}|r|j||qndS(sU Perform configuration which is common to root and non-root loggers. RCRRN( R3R6RHRRRR]RR(RRlRRRCRTRR((s&/usr/lib64/python2.7/logging/config.pytcommon_logger_configs cCsPtj|}|j||||jdd}|dk rL||_ndS(s.Configure a non-root logger from a dictionary.RZN(RRcRR3R6RZ(RRRRRlRZ((s&/usr/lib64/python2.7/logging/config.pyR s  cCs#tj}|j|||dS(s*Configure a root logger from a dictionary.N(RRcR(RRRRW((s&/usr/lib64/python2.7/logging/config.pyRs ( RRRRRRRRRRRRR(((s&/usr/lib64/python2.7/logging/config.pyRs   :   cCst|jdS(s%Configure logging using a dictionary.N(tdictConfigClassR(R((s&/usr/lib64/python2.7/logging/config.pyt dictConfigscsptstdndtfdY}dtfdY}dtjffdY|||S(sW 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(). s listen() needs threading to worktConfigStreamHandlercBseZdZdZRS(s Handler for a logging configuration request. It expects a completely new logging configuration and uses fileConfig to install it. c Ssiddl}y+|j}|jd}t|dkr6tjd|d}|jj|}x3t||kr||j|t|}qdWy)ddl}|j|}t|WnQt j |}yt |Wqt t fk rqtjqXnX|jjr6|jjjq6nWn+tjk rd}|jtkreqenXdS(s 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. iNis>Li(ttempfilet connectiontrecvR4tstructtunpacktjsontloadsRt cStringIOtStringIORtKeyboardInterruptt SystemExitt tracebackt print_exctservertreadytsettsocketterrorterrnot RESET_ERROR( RRtconntchunktslenRRtfileR((s&/usr/lib64/python2.7/logging/config.pythandle1s4  !  (RRRR(((s&/usr/lib64/python2.7/logging/config.pyR*stConfigSocketReceivercBs2eZdZdZdedddZdZRS(sD A simple TCP socket-based logging config receiver. it localhostcSsLtj|||f|tjd|_tjd|_||_dS(Nii(RRRR tabortRttimeoutR(RthosttportRR((s&/usr/lib64/python2.7/logging/config.pyR^s     cSsddl}d}xj|s~|j|jjggg|j\}}}|r^|jntj|j}tjqW|jj dS(Nii( tselectRtfilenoRthandle_requestRR RRtclose(RRRtrdtwrtex((s&/usr/lib64/python2.7/logging/config.pytserve_until_stoppedgs     N(RRRtallow_reuse_addresstDEFAULT_LOGGING_CONFIG_PORTR6RR (((s&/usr/lib64/python2.7/logging/config.pyRWs tServercs eZfdZdZRS(csAt|j||_||_||_tj|_dS(N(tsuperRtrcvrthdlrRt threadingtEventR(RRRR(R(s&/usr/lib64/python2.7/logging/config.pyRws    cSs~|jd|jd|jd|j}|jdkrI|jd|_n|jjtj|atj |j dS(NRRRii( RRRRtserver_addressRRR t _listenerRR (RR((s&/usr/lib64/python2.7/logging/config.pytrun~s    (RRRR((R(s&/usr/lib64/python2.7/logging/config.pyRus(tthreadtNotImplementedErrorRRRtThread(RRR((Rs&/usr/lib64/python2.7/logging/config.pytlistens -cCs8tjztr%dt_danWdtjXdS(sN Stop the listening server which was created with a call to listen(). iN(RR RRR6R(((s&/usr/lib64/python2.7/logging/config.pyt stopListenings    (2RRRtioRtlogging.handlerstosRRRRRRRRRR6t SocketServerRRR t ECONNRESETRRRtRR!R(R-RR RRtIRqRvtobjectRwRR{R[R|RR}RRRRRR(((s&/usr/lib64/python2.7/logging/config.pytsR                     + \ ! .  ousr/lib64/python2.7/distutils/command/config.pyo000064400000030615151027761150015517 0ustar00 {fc@sdZdZddlZddlZddlmZddlmZddlm Z ddl m Z idd 6d d 6Z d efd YZ edZdS(sdistutils.command.config Implements the Distutils 'config' command, a (mostly) empty command class that exists mainly to be sub-classed by specific module distributions and applications. The idea is that while every "config" command is different, at least they're all named the same, and users always see "config" in the list of standard commands. Also, this is a good place to put common configure-like tasks: "try to compile this C code", or "figure out where this header file lives". s$Id$iN(tCommand(tDistutilsExecError(tcustomize_compiler(tlogs.ctcs.cxxsc++tconfigc Bs.eZdZd,d-d.d/d0d1d2d3d4g ZdZdZdZdZdZ dZ dZ dZ d Z d+d+d+d!d"Zd+d+d+d!d#Zd+d+d!d$Zd+d+d+d+d!d%Zd+d+d+d+d!d&Zd+d+d+d+d'd'd(Zd+d+d+gd)Zd+d+d!d*ZRS(5sprepare to builds compiler=sspecify the compiler typescc=sspecify the compiler executables include-dirs=tIs.list of directories to search for header filessdefine=tDsC preprocessor macros to definesundef=tUs!C preprocessor macros to undefines libraries=tls!external C libraries to link withs library-dirs=tLs.directories to search for external C librariestnoisys1show every action (compile, link, run, ...) takens dump-sources=dump generated source files before attempting to compile themcCsLd|_d|_d|_d|_d|_d|_d|_g|_dS(Ni( tNonetcompilertcct include_dirst librariest library_dirsR t dump_sourcet temp_files(tself((s0/usr/lib64/python2.7/distutils/command/config.pytinitialize_options6s       cCs|jdkr'|jjpg|_n-t|jtrT|jjtj|_n|jdkrog|_n$t|jtr|jg|_n|j dkrg|_ n-t|j tr|j jtj|_ ndS(N( RR t distributiont isinstancetstrtsplittostpathsepRR(R((s0/usr/lib64/python2.7/distutils/command/config.pytfinalize_optionsEs  cCsdS(N((R((s0/usr/lib64/python2.7/distutils/command/config.pytrunUscCsddlm}m}t|j|s|d|jd|jdd|_t|j|jrx|jj|jn|j r|jj |j n|j r|jj |j qndS(s^Check that 'self.compiler' really is a CCompiler object; if not, make it one. i(t CCompilert new_compilerR tdry_runtforceiN( tdistutils.ccompilerRRRR R RRtset_include_dirsRt set_librariesRtset_library_dirs(RRR((s0/usr/lib64/python2.7/distutils/command/config.pyt_check_compiler]s    cCsdt|}t|d}|rUx|D]}|jd|q*W|jdn|j||ddkr|jdn|j|S(Nt _configtesttws#include <%s> s i(tLANG_EXTtopentwritetclose(Rtbodytheaderstlangtfilenametfiletheader((s0/usr/lib64/python2.7/distutils/command/config.pyt_gen_temp_sourcefileps   cCsT|j|||}d}|jj||g|jj||d|||fS(Ns _configtest.iR(R3RtextendR t preprocess(RR-R.RR/tsrctout((s0/usr/lib64/python2.7/distutils/command/config.pyt _preprocess}s cCs|j|||}|jr2t|d|n|jj|g\}|jj||g|jj|gd|||fS(Nscompiling '%s':R(R3Rt dump_fileR tobject_filenamesRR4tcompile(RR-R.RR/R6tobj((s0/usr/lib64/python2.7/distutils/command/config.pyt_compiles c Cs|j||||\}}tjjtjj|d} |jj|g| d|d|d||jjdk r| |jj} n|j j | ||| fS(NiRRt target_lang( R=RtpathtsplitexttbasenameR tlink_executablet exe_extensionR Rtappend( RR-R.RRRR/R6R<tprog((s0/usr/lib64/python2.7/distutils/command/config.pyt_links"cGsn|s|j}g|_ntjddj|x3|D]+}ytj|Wq;tk req;Xq;WdS(Ns removing: %st (RRtinfotjoinRtremovetOSError(Rt filenamesR0((s0/usr/lib64/python2.7/distutils/command/config.pyt_cleans    RcCsbddlm}|jd}y|j||||Wn|k rSd}nX|j|S(sQConstruct a source file from 'body' (a string containing lines of C/C++ code) and 'headers' (a list of header files to include) and run it through the preprocessor. Return true if the preprocessor succeeded, false if there were any errors. ('body' probably isn't of much use, but what the heck.) i(t CompileErrorii(R"RNR&R8RM(RR-R.RR/RNtok((s0/usr/lib64/python2.7/distutils/command/config.pyttry_cpps    c Cs|j|j||||\}}t|trItj|}nt|}d} x9|j} | dkrzPn|j| r^d} Pq^q^W|j |j | S(sConstruct a source file (just like 'try_cpp()'), run it through the preprocessor, and return true if any line of the output matches 'pattern'. 'pattern' should either be a compiled regex object or a string containing a regex. If both 'body' and 'headers' are None, preprocesses an empty file -- which can be useful to determine the symbols the preprocessor and compiler set by default. iti( R&R8RRtreR;R*treadlinetsearchR,RM( RtpatternR-R.RR/R6R7R1tmatchtline((s0/usr/lib64/python2.7/distutils/command/config.pyt search_cpps      cCs{ddlm}|jy |j||||d}Wn|k rSd}nXtj|rfdpid|j|S(swTry to compile a source file built from 'body' and 'headers'. Return true on success, false otherwise. i(RNiissuccess!sfailure.(R"RNR&R=RRHRM(RR-R.RR/RNRO((s0/usr/lib64/python2.7/distutils/command/config.pyt try_compiles     c Csddlm}m}|jy&|j||||||d} Wn||fk red} nXtj| rxdp{d|j| S(sTry to compile and link a source file, built from 'body' and 'headers', to executable form. Return true on success, false otherwise. i(RNt LinkErroriissuccess!sfailure.(R"RNRZR&RFRRHRM( RR-R.RRRR/RNRZRO((s0/usr/lib64/python2.7/distutils/command/config.pyttry_links     c Csddlm}m}|jyA|j||||||\} } } |j| gd} Wn ||tfk rd} nXtj| rdpd|j | S(sTry to compile, link to an executable, and run a program built from 'body' and 'headers'. Return true on success, false otherwise. i(RNRZiissuccess!sfailure.( R"RNRZR&RFtspawnRRRHRM( RR-R.RRRR/RNRZR6R<texeRO((s0/usr/lib64/python2.7/distutils/command/config.pyttry_runs    ic Cs|jg}|r*|jd|n|jd|rQ|jd|n|jd||jddj|d}|j|||||S(sDetermine if function 'func' is available by constructing a source file that refers to 'func', and compiles and links it. If everything succeeds, returns true; otherwise returns false. The constructed source file starts out by including the header files listed in 'headers'. If 'decl' is true, it then declares 'func' (as "int func()"); you probably shouldn't supply 'headers' and set 'decl' true in the same call, or you might get errors about a conflicting declarations for 'func'. Finally, the constructed 'main()' function either references 'func' or (if 'call' is true) calls it. 'libraries' and 'library_dirs' are used when linking. s int %s ();s int main () {s %s();s %s;t}s (R&RDRIR[( RtfuncR.RRRtdecltcallR-((s0/usr/lib64/python2.7/distutils/command/config.pyt check_funcs   cCs*|j|jd|||g||S(sDetermine if 'library' is available to be linked against, without actually checking that any particular symbols are provided by it. 'headers' will be used in constructing the source file to be compiled, but the only effect of this is to check if all the header files listed are available. Any libraries listed in 'other_libraries' will be included in the link, in case 'library' has symbols that depend on other libraries. sint main (void) { }(R&R[(RtlibraryRR.Rtother_libraries((s0/usr/lib64/python2.7/distutils/command/config.pyt check_lib?s  cCs|jddd|gd|S(sDetermine if the system header file named by 'header_file' exists and can be found by the preprocessor; return true if so, false otherwise. R-s /* No body */R.R(RP(RR2RRR/((s0/usr/lib64/python2.7/distutils/command/config.pyt check_headerNsN(s compiler=Nsspecify the compiler type(scc=Nsspecify the compiler executable(s include-dirs=Rs.list of directories to search for header files(sdefine=RsC preprocessor macros to define(sundef=Rs!C preprocessor macros to undefine(s libraries=R s!external C libraries to link with(s library-dirs=R s.directories to search for external C libraries(R Ns1show every action (compile, link, run, ...) taken(s dump-sourceNs=dump generated source files before attempting to compile them(t__name__t __module__t descriptionR t user_optionsRRRR&R3R8R=RFRMRPRXRYR[R^RcRfRg(((s0/usr/lib64/python2.7/distutils/command/config.pyRsT            !cCsb|dkr tjd|n tj|t|}ztj|jWd|jXdS(sjDumps a file content into log.info. If head is not None, will be dumped before the file content. s%sN(R RRHR*treadR,(R0theadR1((s0/usr/lib64/python2.7/distutils/command/config.pyR9Xs   (t__doc__t __revision__RRRtdistutils.coreRtdistutils.errorsRtdistutils.sysconfigRt distutilsRR)RR R9(((s0/usr/lib64/python2.7/distutils/command/config.pyt s  A