;ò
óŒü?c           @   sS  d  Z  d k Z d k Z d k Z d d d d d g Z g  Z d Z h  Z e d d	 „ Z	 e e d
 „ Z
 e d „ Z d „  Z d e d d d d „ Z e d d d „ Z d „  Z d e f d „  ƒ  YZ d „  Z d „  Z d „  Z d „  Z e d j o! d k Z e e i d <e ƒ  n: e e i ƒ e d d e d d ƒe d d e d d ƒd S(   s&   Python part of the warnings subsystem.Ns   warns   showwarnings   formatwarnings   filterwarningss   resetwarningss   defaulti   c   
      C   si  t  |  t ƒ o |  i } n | t j o
 t } n t | t ƒ p t ‚ y t	 i
 | ƒ } Wn" t j
 o t	 i } d } n X| i } | i } d | j o | d } n d } | i d ƒ } | o> | i ƒ  } | i d ƒ p | i d ƒ o | d  } q:n1 | d j o t	 i d	 } n | o
 | } n | i d
 h  ƒ }	 t |  | | | | |	 ƒ d S(   s:   Issue a warning, or maybe ignore it or raise an exception.i   s   __name__s   <string>s   __file__s   .pycs   .pyoiÿÿÿÿs   __main__i    s   __warningregistry__N(   s
   isinstances   messages   Warnings	   __class__s   categorys   Nones   UserWarnings
   issubclasss   AssertionErrors   syss	   _getframes
   stacklevels   callers
   ValueErrors   __dict__s   globalss   linenos	   f_globalss   f_linenos   modules   gets   filenames   lowers   fnls   endswiths   argvs
   setdefaults   registrys   warn_explicit(
   s   messages   categorys
   stacklevels   fnls   globalss   callers   modules   filenames   linenos   registry(    (    s%   /mit/python/lib/python2.3/warnings.pys   warn   s6     
			 
c         C   su  | t j o/ | } | d i ƒ  d j o | d  } q< n | t j o
 h  } n t |  t ƒ o t |  ƒ } |  i
 } n |  } | |  ƒ }  | | | f }	 | i |	 ƒ o d  Sn x’ t D]„ } | \ } } } }
 } | t j p | i | ƒ oD t | | ƒ o4 | t j p |
 i | ƒ o | d j p
 | | j o Pq¼ q¼ Wt } | d j o d | |	 <d  Sn | d j o
 |  ‚ n | d j o< d | |	 <| | f } t i | ƒ o d  Sn d t | <n– | d j o n… | d	 j o? d | |	 <| | d f } | i | ƒ o d  Sn d | | <n9 | d
 j o d | |	 <n t d | t | ƒ f ƒ ‚ t |  | | | ƒ d  S(   Niýÿÿÿs   .pyi    s   ignorei   s   errors   onces   alwayss   modules   defaults1   Unrecognized action (%s) in warnings.filters:
 %s(   s   modules   Nones   filenames   lowers   registrys
   isinstances   messages   Warnings   strs   texts	   __class__s   categorys   linenos   keys   gets   filterss   items   actions   msgs   cats   mods   lns   matchs
   issubclasss   defaultactions   oncekeys   onceregistrys   altkeys   RuntimeErrors   showwarning(   s   messages   categorys   filenames   linenos   modules   registrys   texts   lns   msgs   keys   mods   cats   altkeys   items   actions   oncekey(    (    s%   /mit/python/lib/python2.3/warnings.pys   warn_explicit;   sV    
 d	



c         C   sT   | t j o t i } n y  | i t |  | | | ƒ ƒ Wn t
 j
 o n Xd S(   s7   Hook to write a warning to a file; replace if you like.N(   s   files   Nones   syss   stderrs   writes   formatwarnings   messages   categorys   filenames   linenos   IOError(   s   messages   categorys   filenames   linenos   file(    (    s%   /mit/python/lib/python2.3/warnings.pys   showwarningv   s      c         C   sV   d | | | i |  f } t i | | ƒ i ƒ  } | o | d | d } n | Sd S(   s.   Function to format a warning the standard way.s   %s:%s: %s: %s
s     s   
N(
   s   filenames   linenos   categorys   __name__s   messages   ss	   linecaches   getlines   strips   line(   s   messages   categorys   filenames   linenos   ss   line(    (    s%   /mit/python/lib/python2.3/warnings.pys   formatwarning   s     s    i    c         C   s"  d k  } |  d d d d d d f j p t d |  ‚ t | t ƒ p
 t d	 ‚ t | t i ƒ p
 t d
 ‚ t	 | t
 ƒ p
 t d ‚ t | t ƒ p
 t d ‚ t | t ƒ o
 | d j p
 t d ‚ |  | i | | i ƒ | | i | ƒ | f } | o t i | ƒ n t i d | ƒ d S(   s†   Insert an entry into the list of warnings filters (at the front).

    Use assertions to check that all arguments have the right type.Ns   errors   ignores   alwayss   defaults   modules   onces   invalid action: %ss   message must be a strings   category must be a classs#   category must be a Warning subclasss   module must be a stringi    s   lineno must be an int >= 0(   s   res   actions   AssertionErrors
   isinstances   messages
   basestrings   categorys   typess	   ClassTypes
   issubclasss   Warnings   modules   linenos   ints   compiles   Is   items   appends   filterss   insert(   s   actions   messages   categorys   modules   linenos   appends   items   re(    (    s%   /mit/python/lib/python2.3/warnings.pys   filterwarnings‡   s     	.'-c         C   s–   |  d d d d d d f j p t d |  ‚ t | t ƒ o
 | d j p
 t d	 ‚ |  t | t | f } | o t	 i | ƒ n t	 i
 d | ƒ d
 S(   sƒ   Insert a simple entry into the list of warnings filters (at the front).

    A simple filter matches all modules and messages.
    s   errors   ignores   alwayss   defaults   modules   onces   invalid action: %si    s   lineno must be an int >= 0N(   s   actions   AssertionErrors
   isinstances   linenos   ints   Nones   categorys   items   appends   filterss   insert(   s   actions   categorys   linenos   appends   item(    (    s%   /mit/python/lib/python2.3/warnings.pys   simplefilterœ   s     .'c           C   s   g  t  (d S(   sA   Clear the list of warning filters, so that no filters are active.N(   s   filters(    (    (    s%   /mit/python/lib/python2.3/warnings.pys   resetwarnings«   s     s   _OptionErrorc           B   s   t  Z d  Z RS(   s,   Exception used by option processing helpers.(   s   __name__s
   __module__s   __doc__(    (    (    s%   /mit/python/lib/python2.3/warnings.pys   _OptionError¯   s    c         C   sN   xG |  D]? } y t | ƒ Wq t j
 o } t i d I| IJq Xq Wd  S(   Ns   Invalid -W option ignored:(   s   argss   args
   _setoptions   _OptionErrors   msgs   syss   stderr(   s   argss   msgs   arg(    (    s%   /mit/python/lib/python2.3/warnings.pys   _processoptions´   s     c   
      C   sn  d  k  } |  i d ƒ } t | ƒ d j o t d |  ƒ ‚ n x% t | ƒ d j  o | i d ƒ qC Wg  i } | D] } | | i	 ƒ  ƒ qv ~ \ } } } } }	 t | ƒ } | i | ƒ } t | ƒ } | i | ƒ } | o | d } n |	 oX y' t |	 ƒ }	 |	 d j  o
 t ‚ n WqTt t f j
 o t d |	 ƒ ‚ qTXn d }	 t | | | | |	 ƒ d  S(   Ns   :i   s   too many fields (max 5): %ss    s   $i    s   invalid lineno %s(   s   res   args   splits   partss   lens   _OptionErrors   appends   _[1]s   ss   strips   actions   messages   categorys   modules   linenos
   _getactions   escapes   _getcategorys   ints
   ValueErrors   OverflowErrors   filterwarnings(
   s   args   categorys   ss   _[1]s   res   partss   modules   actions   messages   lineno(    (    s%   /mit/python/lib/python2.3/warnings.pys
   _setoption¼   s.    	 <c         C   su   |  o d Sn |  d j o d Sn x8 d d d d d d g D] } | i |  ƒ o | Sq> q> Wt d |  ƒ ‚ d  S(	   Ns   defaults   alls   alwayss   ignores   modules   onces   errors   invalid action: %s(   s   actions   as
   startswiths   _OptionError(   s   actions   a(    (    s%   /mit/python/lib/python2.3/warnings.pys
   _getaction×   s      c         C   sM  d  k  } |  o t Sn | i d |  ƒ o; y t |  ƒ } Wqt j
 o t d |  ƒ ‚ qXn¥ |  i d ƒ } |  |  } |  | d } y t | t t | g ƒ } Wn$ t j
 o t d | ƒ ‚ n Xy t | | ƒ } Wn$ t j
 o t d |  ƒ ‚ n Xt | t i ƒ p t | t ƒ o t d |  ƒ ‚ n | Sd  S(   Ns   ^[a-zA-Z0-9_]+$s   unknown warning category: %ss   .i   s   invalid module name: %ss   invalid warning category: %s(   s   res   categorys   Warnings   matchs   evals   cats	   NameErrors   _OptionErrors   rfinds   is   modules   klasss
   __import__s   Nones   ms   ImportErrors   getattrs   AttributeErrors
   isinstances   typess	   ClassTypes
   issubclass(   s   categorys   is   ms   modules   cats   res   klass(    (    s%   /mit/python/lib/python2.3/warnings.pys   _getcategoryá   s,    	
%s   __main__s   warningss   ignores   categorys   append(   s   __doc__s   syss   typess	   linecaches   __all__s   filterss   defaultactions   onceregistrys   Nones   warns   warn_explicits   showwarnings   formatwarnings   Warnings   filterwarningss   simplefilters   resetwarningss	   Exceptions   _OptionErrors   _processoptionss
   _setoptions
   _getactions   _getcategorys   __name__s   __main__s   moduless   _tests   warnoptionss   OverflowWarnings   PendingDeprecationWarning(   s   filterwarningss   filterss   __main__s
   _setoptions   showwarnings   __all__s   onceregistrys   simplefilters   _getcategorys   defaultactions   warn_explicits   typess   syss   _processoptionss   warns	   linecaches   _OptionErrors   resetwarningss   formatwarnings
   _getaction(    (    s%   /mit/python/lib/python2.3/warnings.pys   ?   s2   	#;						
		