ó
[³XMc           @   sv   d  Z  d d l m Z d d l m Z d d l m Z d d l m Z d d l	 m
 Z
 d Z d e
 f d	 „  ƒ  YZ d
 S(   sd   
Cross-platform process-related functionality used by different
L{IReactorProcess} implementations.
iÿÿÿÿ(   t   qual(   t   getWarningMethod(   t   Failure(   t   err(   t	   EphemeralsU   Since Twisted 8.2, IProcessProtocol.processExited is required.  %s must implement it.t   BaseProcessc           B   sD   e  Z d Z d Z d  Z d Z d „  Z d „  Z d „  Z	 d „  Z
 RS(   i    c         C   s   | |  _  d  S(   N(   t   proto(   t   selft   protocol(    (    sA   /usr/lib/python2.7/dist-packages/twisted/internet/_baseprocess.pyt   __init__   s    c         C   sj   t  ƒ  } t |  j d | ƒ } | | k rV t ƒ  t t |  j j ƒ f t d d ƒn | t | ƒ ƒ d  S(   Nt   processExitedt
   stackleveli    (	   t   objectt   getattrR   R   t   _missingProcessExitedR    t	   __class__t   DeprecationWarningR   (   R   t   reasont   defaultR
   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/internet/_baseprocess.pyt   _callProcessExited   s    	c         C   sE   | |  _  |  j d 7_ d |  _ |  j |  j | ƒ ƒ |  j ƒ  d S(   s;   
        This is called when the child terminates.
        i   N(   t   statust   lostProcesst   Nonet   pidR   t
   _getReasont   maybeCallProcessEnded(   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/internet/_baseprocess.pyt   processEnded(   s
    		c         C   sh   |  j  d k	 rd |  j |  j ƒ } |  j  } d |  _  y | j t | ƒ ƒ Wqd t d d ƒ qd Xn  d S(   sD   
        Call processEnded on protocol after final cleanup.
        s    unexpected error in processEndedN(   R   R   R   R   R   R   R   (   R   R   R   (    (    sA   /usr/lib/python2.7/dist-packages/twisted/internet/_baseprocess.pyR   3   s    		N(   t   __name__t
   __module__R   R   R   R   R   R	   R   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/internet/_baseprocess.pyR      s   			N(   t   __doc__t   twisted.python.reflectR    t   twisted.python.deprecateR   t   twisted.python.failureR   t   twisted.python.logR   t   twisted.persisted.stylesR   R   R   (    (    (    sA   /usr/lib/python2.7/dist-packages/twisted/internet/_baseprocess.pyt   <module>   s   