ó
&9_[c           @  so   d  Z  d d l m Z d d l Z d d l Z e j d e ƒ d d d „ Z d „  Z d	 „  Z d d
 „ Z	 d S(   sM   
Utilities for warnings.  Shoudn't we just use the built in warnings module.
iÿÿÿÿ(   t   print_functionNsg   The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module insteadi   i   c         C  s‡   t  j d t ƒ | d k rƒ d d d d d g } t | | |  d d d t j ƒ| d	 k rƒ t d
 d t j ƒt j | ƒ qƒ n  d S(   s÷  Deprecated

    Standard warning printer. Gives formatting consistency.

    Output is sent to sys.stderr.

    Options:

    -level(2): allows finer control:
      0 -> Do nothing, dummy function.
      1 -> Print message.
      2 -> Print 'WARNING:' + message. (Default level).
      3 -> Print 'ERROR:' + message.
      4 -> Print 'FATAL ERROR:' + message and trigger a sys.exit(exit_val).

    -exit_val (1): exit value returned by sys.exit() for a level 4
    warning. Ignored for all other levels.sg   The module IPython.utils.warn is deprecated since IPython 4.0, use the standard warnings module insteadi    t    s	   WARNING: s   ERROR: s   FATAL ERROR: t   sept   filei   s	   Exiting.
N(   t   warningst   warnt   DeprecationWarningt   printt   syst   stderrt   exit(   t   msgt   levelt   exit_valt   header(    (    s1   lib/python2.7/site-packages/IPython/utils/warn.pyR      s     c         C  s   t  |  d d ƒd S(   s5   Deprecated 
    
    Equivalent to warn(msg,level=1).R   i   N(   R   (   R   (    (    s1   lib/python2.7/site-packages/IPython/utils/warn.pyt   info,   s    c         C  s   t  |  d d ƒd S(   s5   Deprecated 
    
    Equivalent to warn(msg,level=3).R   i   N(   R   (   R   (    (    s1   lib/python2.7/site-packages/IPython/utils/warn.pyt   error4   s    c         C  s   t  |  d | d d ƒd S(   sG   Deprecated 
    
    Equivalent to warn(msg,exit_val=exit_val,level=4).R   R   i   N(   R   (   R   R   (    (    s1   lib/python2.7/site-packages/IPython/utils/warn.pyt   fatal<   s    (
   t   __doc__t
   __future__R    R   R   R   R   R   R   R   (    (    (    s1   lib/python2.7/site-packages/IPython/utils/warn.pyt   <module>   s   		