ó
®$¤Oc           @   s„   d  Z  d d l Z d d l m Z d d l m Z m Z m Z d d l m	 Z	 m
 Z
 d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ d S(
   sÚ   Standard input/out/err support.

Future Plans::

    support for stderr, perhaps
    Rewrite to use the reactor instead of an ad-hoc mechanism for connecting
        protocols to transport.

Maintainer: James Y Knight
iÿÿÿÿN(   t
   implements(   t   processt   errort
   interfaces(   t   logt   failuret   PipeAddressc           B   s   e  Z e e j ƒ RS(    (   t   __name__t
   __module__R    R   t   IAddress(    (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR      s   t
   StandardIOc           B   sü   e  Z e e j e j e j e j ƒ d Z	 d Z
 e Z e Z d  d d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  d „  Z! RS(   i    i   c         C   s   | d  k r d d l m } n  | |  _ t j | |  d | ƒ |  _ t j | |  d | ƒ |  _ |  j j	 ƒ  |  j j
 |  ƒ d  S(   Niÿÿÿÿ(   t   reactort   writet   read(   t   Nonet   twisted.internetR   t   protocolR   t   ProcessWritert   _writert   ProcessReadert   _readert   startReadingt   makeConnection(   t   selft   protot   stdint   stdoutR   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt   __init__"   s    	c         C   s#   |  j  d  k	 r |  j  j ƒ  n  d  S(   N(   R   R   t   loseConnection(   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt   loseWriteConnection/   s    c         C   s&   |  j  d  k	 r" |  j  j | ƒ n  d  S(   N(   R   R   R   (   R   t   data(    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR   3   s    c         C   s&   |  j  d  k	 r" |  j  j | ƒ n  d  S(   N(   R   R   t   writeSequence(   R   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR   7   s    c         C   sK   t  |  _ |  j d  k	 r( |  j j ƒ  n  |  j d  k	 rG |  j j ƒ  n  d  S(   N(   t   Truet   disconnectingR   R   R   R   t   stopReading(   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR   ;   s
    	c         C   s   t  ƒ  S(   N(   R   (   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt   getPeerD   s    c         C   s   t  ƒ  S(   N(   R   (   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt   getHostG   s    c         C   s   |  j  j | ƒ d  S(   N(   R   t   dataReceived(   R   t   fdR   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt   childDataReceivedL   s    c         C   s_   |  j  r d  S| j j t j k rN | d k r> |  j | ƒ q[ |  j | ƒ n |  j | ƒ d  S(   NR   (   t   disconnectedt   valuet	   __class__R   t   ConnectionDonet   _readConnectionLostt   _writeConnectionLostt   connectionLost(   R   R&   t   reason(    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt   childConnectionLostO   s    	c         C   s²   t  |  _ |  j } |  j } |  j } d  |  _ |  _ d  |  _ | d  k	 rc | j rc | j | ƒ n  | d  k	 r‰ | j r‰ | j | ƒ n  y | j | ƒ Wn t j ƒ  n Xd  S(   N(	   R    R(   R   R   R   R   R.   R   t   err(   R   R/   R   R   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR.   \   s    					c         C   sz   d  |  _ |  j r# |  j | ƒ d  St j |  j d  ƒ } | rv y | j ƒ  Wqv t j	 ƒ  |  j t
 j ƒ  ƒ qv Xn  d  S(   N(   R   R   R!   R.   R   t   IHalfCloseableProtocolR   t   writeConnectionLostR   R1   R   t   Failure(   R   R/   t   p(    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR-   q   s    		
c         C   sm   d  |  _ t j |  j d  ƒ } | r\ y | j ƒ  Wqi t j ƒ  |  j t	 j
 ƒ  ƒ qi Xn |  j | ƒ d  S(   N(   R   R   R   R2   R   t   readConnectionLostR   R1   R.   R   R4   (   R   R/   R5   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR,      s    	
c         C   s3   |  j  d  k r | j ƒ  n |  j  j | | ƒ d  S(   N(   R   R   t   stopProducingt   registerProducer(   R   t   producert	   streaming(    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR8   Œ   s    c         C   s#   |  j  d  k	 r |  j  j ƒ  n  d  S(   N(   R   R   t   unregisterProducer(   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR;   ’   s    c         C   s   |  j  ƒ  d  S(   N(   R   (   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR7   —   s    c         C   s#   |  j  d  k	 r |  j  j ƒ  n  d  S(   N(   R   R   t   pauseProducing(   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR<   š   s    c         C   s#   |  j  d  k	 r |  j  j ƒ  n  d  S(   N(   R   R   t   resumeProducing(   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR=   ž   s    c         C   s'   t  j d d t d d ƒ|  j ƒ  d S(   s;   Compatibility only, don't use. Same as loseWriteConnection.s=   This function is deprecated, use loseWriteConnection instead.t   categoryt
   stackleveli   N(   t   warningst   warnt   DeprecationWarningR   (   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt
   closeStdin£   s    c         C   s   |  j  ƒ  d S(   s3   Compatibility only, don't use. Call pauseProducing.N(   R<   (   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR"   ©   s    c         C   s   |  j  ƒ  d S(   s4   Compatibility only, don't use. Call resumeProducing.N(   R=   (   R   (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR   ­   s    N("   R   R   R    R   t
   ITransportt	   IProducert	   IConsumert   IHalfCloseableDescriptorR   R   R   t   FalseR(   R!   R   R   R   R   R   R#   R$   R'   R0   R.   R-   R,   R8   R;   R7   R<   R=   RC   R"   R   (    (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyR
      s4   																			(   t   __doc__R@   t   zope.interfaceR    R   R   R   R   t   twisted.pythonR   R   t   objectR   R
   (    (    (    sN   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/internet/_posixstdio.pyt   <module>   s   