mò %U²Ic@s%dZdkZdkZdkZdddddgZgZdZhZddd „Z ddd „Z dd „Z d „Z d e d ddd„Ze ddd„Zd„Zdefd„ƒYZd„Zd„Zd„Zd„ZeeiƒeddeddƒeddeddƒdS(s&Python part of the warnings subsystem.Ntwarnt showwarningt formatwarningtfilterwarningst resetwarningstdefaultic Csqt|tƒo |i}n|d jo t}nyti|ƒ}Wn"t j oti }d}nX|i}|i}d|jo|d}nd}|idƒ}|o>|iƒ}|idƒp|idƒo|d }qBnP|djo1ytid }Wq1tj o d}q1Xn|p |}n|id hƒ} t|||||| ƒd S( s:Issue a warning, or maybe ignore it or raise an exception.it__name__st__file__s.pycs.pyoiÿÿÿÿt__main__it__warningregistry__N(t isinstancetmessagetWarningt __class__tcategorytNonet UserWarningtsyst _getframet stackleveltcallert ValueErrort__dict__tglobalstlinenot f_globalstf_linenotmoduletgettfilenametlowertfnltendswithtargvtAttributeErrort setdefaulttregistryt warn_explicit( R RRRRRRRRR$((t%/data/zmath/lib/python2.4/warnings.pyRs<            cCsu|djo6|pd}|diƒdjo|d }qCn|djo h}nt|tƒot|ƒ}|i }n|}||ƒ}|||f} |i| ƒodSnx’tD]„} | \}}} } }|djp|i|ƒoLt|| ƒo<| djp| i|ƒo|djp ||joPqÃqÃWt}|djod|| iýÿÿÿs.pyitignoreiterrortoncetalwaysRRs1Unrecognized action (%r) in warnings.filters: %s(RRRRR$R R R tstrttextR RRtkeyRtfilterstitemtactiontmsgtcattmodtlntmatcht issubclasst defaultactiontoncekeyt onceregistrytaltkeyt RuntimeErrorR(R RRRRR$R,R4R1R-R3R2R:R/R0R8((R&R%?sV       d            cCsT|djo ti}ny |it||||ƒƒWnt j onXdS(s7Hook to write a warning to a file; replace if you like.N( tfileRRtstderrtwriteRR RRRtIOError(R RRRR<((R&Rzs   cCsRd|||i|f}ti||ƒiƒ}|o|d|d}n|S(s.Function to format a warning the standard way.s%s:%s: %s: %s s s N( RRRRR tst linecachetgetlinetstriptline(R RRRR@RD((R&Rƒs ticCsbdk}||i||iƒ||i|ƒ|f}|ot i |ƒnt i d|ƒdS(s†Insert an entry into the list of warnings filters (at the front). Use assertions to check that all arguments have the right type.Ni( treR0tcompileR tIRRRR/tappendR.tinsert(R0R RRRRIR/RF((R&R‹s -cCsA|d|d|f}|oti|ƒntid|ƒdS(sƒInsert a simple entry into the list of warnings filters (at the front). A simple filter matches all modules and messages. iN(R0RRRR/RIR.RJ(R0RRRIR/((R&t simplefilter scCs gt(dS(sAClear the list of warning filters, so that no filters are active.N(R.(((R&R¯st _OptionErrorcBstZdZRS(s,Exception used by option processing helpers.(Rt __module__t__doc__(((R&RL³s cCsNxG|D]?}yt|ƒWqtj o}tidI|IJqXqWdS(NsInvalid -W option ignored:(targstargt _setoptionRLR1RR=(ROR1RP((R&t_processoptions¸s c Csldk}|idƒ}t|ƒdjotd|fƒ‚nx%t|ƒdjo|idƒqEWg}|D]}||i ƒqu~\}}}}} t|ƒ}|i|ƒ}t|ƒ}|i|ƒ}|o|d}n| oZy't| ƒ} | djo t‚nWqRttfj otd| fƒ‚qRXnd} t||||| ƒdS(Nt:istoo many fields (max 5): %rREt$isinvalid lineno %r(RFRPtsplittpartstlenRLRIt_[1]R@RCR0R RRRt _getactiontescapet _getcategorytintRt OverflowErrorR( RPRR@RXRFRVRR0R R((R&RQÀs. 6    cCsv|pdSn|djodSnx8ddddddgD]}|i|ƒo|Sq=q=Wtd|fƒ‚dS( NRtallR*R'RR)R(sinvalid action: %r(R0tat startswithRL(R0R_((R&RYÛs  cCsPdk}|ptSn|id|ƒo=yt|ƒ}Wqtj otd|fƒ‚qXn©|idƒ}|| }||d}yt |dd|gƒ}Wn&tj otd|fƒ‚nXyt||ƒ}Wn&tj otd|fƒ‚nXt|tiƒ pt|tƒ otd|fƒ‚n|S(Ns^[a-zA-Z0-9_]+$sunknown warning category: %rt.isinvalid module name: %rsinvalid warning category: %r(RFRR R5tevalR2t NameErrorRLtrfindtiRtklasst __import__Rtmt ImportErrortgetattrR"R ttypest ClassTypeR6(RReRhRR2RFRf((R&R[ås,  %R'RRI(RNRRkRAt__all__R.R7R9RRR%RRR RRKRt ExceptionRLRRRQRYR[t warnoptionstOverflowWarningtPendingDeprecationWarning(RR.RQRRmR9RKR[R7R%RkRRRRRARLRRRY((R&t?s*  ';