³ò
™›\Kc        	   @   s1  d  Z  d d k Z d d k Z d d k Z d d d d d g Z g  Z d Z h  Z d d	 d
 „ Z	 d d d d „ Z
 d 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 e i ƒ e d d e d d	 ƒe d d e d d	 ƒd S(   s&   Python part of the warnings subsystem.iÿÿÿÿNt   warnt   showwarningt   formatwarningt   filterwarningst   resetwarningst   defaulti   c   
      C   s{  t  |  t ƒ o |  i } n | d 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 ƒ o | d  } qInP | d j o1 y t i d	 } Wq8t j
 o d } q8Xn | p
 | } n | i d
 h  ƒ }	 t |  | | | | |	 | ƒ d S(   s:   Issue a warning, or maybe ignore it or raise an exception.i   t   __name__s   <string>t   __file__s   .pycs   .pyoiÿÿÿÿt   __main__i    t   __warningregistry__N(   s   .pycs   .pyo(   t
   isinstancet   Warningt	   __class__t   Nonet   UserWarningt
   issubclasst   AssertionErrort   syst	   _getframet
   ValueErrort   __dict__t	   f_globalst   f_linenot   gett   lowert   endswitht   argvt   AttributeErrort
   setdefaultt   warn_explicit(
   t   messaget   categoryt
   stacklevelt   callert   globalst   linenot   modulet   filenamet   fnlt   registry(    (    s   /usr/lib/python2.5/warnings.pyR       s<    
			
c      	   C   s…  | d  j o6 | p d } | d i ƒ  d j o | d  } qC n | d  j o
 h  } n t |  t ƒ o t |  ƒ } |  i } n |  } | |  ƒ }  | | | f } | i | ƒ o d  Sn x’ t D]„ }	 |	 \ }
 } } } } | d  j p | i | ƒ oL t	 | | ƒ o< | d  j p | i | ƒ o | d j p | | j o PqÃ qÃ Wt
 }
 |
 d j o d | | <d  Sn t i | | ƒ |
 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 | | <n2 |
 d j o d | | <n t d |
 |	 f ƒ ‚ t |  | | | ƒ d  S(   Ns	   <unknown>iýÿÿÿs   .pyi    t   ignorei   t   errort   oncet   alwaysR$   R   s1   Unrecognized action (%r) in warnings.filters:
 %s(   R   R   R
   R   t   strR   R   t   filterst   matchR   t   defaultactiont	   linecachet   getlinest   onceregistryt   RuntimeErrorR   (   R   R   R%   R#   R$   R'   t   module_globalst   textt   keyt   itemt   actiont   msgt   catt   modt   lnt   oncekeyt   altkey(    (    s   /usr/lib/python2.5/warnings.pyR   @   sb    
 	



c      	   C   sT   | d 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(   R   R   t   stderrt   writeR   t   IOError(   R   R   R%   R#   t   file(    (    s   /usr/lib/python2.5/warnings.pyR   €   s     c         C   sR   d | | | i  |  f } t i | | ƒ i ƒ  } | o | d | d } n | S(   s.   Function to format a warning the standard way.s   %s:%s: %s: %s
s     s   
(   R   R0   t   getlinet   strip(   R   R   R%   R#   t   st   line(    (    s   /usr/lib/python2.5/warnings.pyR   ‰   s
    t    i    c         C   s  d d k  } |  d j p t d	 |  f ‚ t | t ƒ p
 t d
 ‚ t | t t i f ƒ 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.iÿÿÿÿNR)   R(   R+   R   R$   R*   s   invalid action: %rs   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   errors   ignores   alwayss   defaults   modules   once(   t   reR   R
   t
   basestringt   typet   typest	   ClassTypeR   R   t   intt   compilet   IR-   t   appendt   insert(   R8   R   R   R$   R#   RP   RH   R7   (    (    s   /usr/lib/python2.5/warnings.pyR   ‘   s     c         C   s†   |  d j p t  d |  f ‚ t | t ƒ o | d j p
 t  d	 ‚ |  d
 | d
 | 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.
    R)   R(   R+   R   R$   R*   s   invalid action: %ri    s   lineno must be an int >= 0N(   s   errors   ignores   alwayss   defaults   modules   once(   R   R
   RM   R   R-   RP   RQ   (   R8   R   R#   RP   R7   (    (    s   /usr/lib/python2.5/warnings.pyt   simplefilter§   s     c           C   s   g  t  (d S(   sA   Clear the list of warning filters, so that no filters are active.N(   R-   (    (    (    s   /usr/lib/python2.5/warnings.pyR   ¶   s    t   _OptionErrorc           B   s   e  Z d  Z RS(   s,   Exception used by option processing helpers.(   R   t
   __module__t   __doc__(    (    (    s   /usr/lib/python2.5/warnings.pyRS   º   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:(   t
   _setoptionRS   R   R?   (   t   argst   argR9   (    (    s   /usr/lib/python2.5/warnings.pyt   _processoptions¿   s     c   
      C   so  d d  k  } |  i d ƒ } t | ƒ d j o t d |  f ƒ ‚ n x% t | ƒ d j  o | i d ƒ qH Wg  } | D] } | | i ƒ  qx ~ \ } } } } }	 t | ƒ } | i | ƒ } t | ƒ } | i | ƒ } | o | d } n |	 oZ y' t	 |	 ƒ }	 |	 d j  o
 t
 ‚ n WqUt
 t f j
 o t d |	 f ƒ ‚ qUXn d }	 t | | | | |	 ƒ d  S(	   Niÿÿÿÿt   :i   s   too many fields (max 5): %rRG   t   $i    s   invalid lineno %r(   RH   t   splitt   lenRS   RP   RD   t
   _getactiont   escapet   _getcategoryRM   R   t   OverflowErrorR   (
   RX   RH   t   partst   _[1]RE   R8   R   R   R$   R#   (    (    s   /usr/lib/python2.5/warnings.pyRV   Ç   s0     /c         C   sd   |  p d Sn |  d j o d Sn x& d	 D] } | i  |  ƒ o | Sq+ q+ Wt d |  f ƒ ‚ d  S(
   NR   t   allR+   R(   R$   R*   R)   s   invalid action: %r(   s   defaults   alwayss   ignores   modules   onces   error(   t
   startswithRS   (   R8   t   a(    (    s   /usr/lib/python2.5/warnings.pyR^   â   s      c         C   s>  d d  k  } |  p t Sn | i d |  ƒ o= y t |  ƒ } Wqt j
 o t d |  f ƒ ‚ qXn© |  i d ƒ } |  |  } |  | d } y t | d  d  | g ƒ } Wn& t	 j
 o t d | f ƒ ‚ n Xy t
 | | ƒ } Wn& t j
 o t d |  f ƒ ‚ n Xt | t ƒ p t d |  f ƒ ‚ n | S(   Niÿÿÿÿs   ^[a-zA-Z0-9_]+$s   unknown warning category: %rt   .i   s   invalid module name: %rs   invalid warning category: %r(   RH   R   R.   t   evalt	   NameErrorRS   t   rfindt
   __import__R   t   ImportErrort   getattrR   R   (   R   RH   R:   t   iR$   t   klasst   m(    (    s   /usr/lib/python2.5/warnings.pyR`   ì   s,    
R(   R   RP   (   RU   R   RK   R0   t   __all__R-   R/   R2   R   R    R   R   R   R   R   RR   R   t	   ExceptionRS   RY   RV   R^   R`   t   warnoptionst   PendingDeprecationWarningt   ImportWarning(    (    (    s   /usr/lib/python2.5/warnings.pys   <module>   s.   	
)?						
	