;ò
ÎÑAHc           @   sh   d  Z  d k Z d k Z d k Z d k Z d k Z e i i ƒ  Z	 d „  Z
 d „  Z d „  Z e ƒ  d S(   s&   Advanced signal (e.g. ctrl+C) handling for IPython

So far, this only ignores ctrl + C in IPython file a subprocess
is executing, to get closer to how a "proper" shell behaves.

Other signal processing may be implemented later on.

If _ip.options.verbose is true, show exit status if nonzero

Nc         C   s€   t  i |  d t ƒ} t i t i t i ƒ } t	 i
 | i d ƒ \ } } t i t i | ƒ | o
 t i i o d | GHn d S(   sà    ctrl+c ignoring replacement for system() command in iplib.
    
    Ignore ctrl + c in IPython process during the command execution. 
    The subprocess will still get the ctrl + c signal.
    
    posix implementation
    s   shelli    s   [exit status: %d]N(   s
   subprocesss   Popens   cmds   Trues   ps   signals   SIGINTs   SIG_IGNs   old_handlers   oss   waitpids   pids   statuss   ips   optionss   verbose(   s   cmds   statuss   old_handlers   pids   p(    (    sO   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_signals.pys   new_ipsystem_posix   s     c         C   s_   t  i  t  i t  i ƒ } t i |  ƒ } t  i  t  i | ƒ | o
 t i	 i
 o d | GHn d S(   sà    ctrl+c ignoring replacement for system() command in iplib.
    
    Ignore ctrl + c in IPython process during the command execution. 
    The subprocess will still get the ctrl + c signal.
    
    win32 implementation
    s   [exit status: %d]N(   s   signals   SIGINTs   SIG_IGNs   old_handlers   oss   systems   cmds   statuss   ips   optionss   verbose(   s   cmds   statuss   old_handler(    (    sO   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_signals.pys   new_ipsystem_win32#   s     c          C   sg   t  i }  y |  i Wn) t j
 o |  i t ƒ d |  _ n Xt i d j o t	 p t
 t  i _ d  S(   Ni    s   win32(   s   ips   optionss   os   verboses   AttributeErrors   allow_new_attrs   Trues   syss   platforms   new_ipsystem_win32s   new_ipsystem_posixs   IPs   system(   s   o(    (    sO   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_signals.pys   init2   s    	(   s   __doc__s   signals   oss   syss   IPython.ipapis   IPythons
   subprocesss   ipapis   gets   ips   new_ipsystem_posixs   new_ipsystem_win32s   init(	   s   ips   signals   new_ipsystem_win32s
   subprocesss   syss   inits   IPythons   oss   new_ipsystem_posix(    (    sO   /u/d/b/dbachman/=/lib/python2.3/site-packages/IPython/Extensions/ipy_signals.pys   ?
   s   					