ó
2¾·Pc           @`  s…  d  Z  d d l m Z m Z d d d d d d d	 d
 d d d g Z d d l m Z d d l m Z d e	 f d „  ƒ  YZ
 d e
 f d „  ƒ  YZ d e
 f d „  ƒ  YZ d e
 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d	 e	 f d „  ƒ  YZ d
 e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d e	 f d „  ƒ  YZ d S(    s+   
Exception definitions for L{twisted.web}.
i    (   t   divisiont   absolute_importt   Errort   PageRedirectt   InfiniteRedirectiont   RenderErrort   MissingRenderMethodt   MissingTemplateLoadert   UnexposedMethodErrort   UnfilledSlott   UnsupportedTypet   FlattenerErrort   RedirectWithNoLocation(   t   Sequence(   t	   RESPONSESc           B`  s&   e  Z d  Z d d d „ Z d „  Z RS(   sD  
    A basic HTTP error.

    @type status: C{str}
    @ivar status: Refers to an HTTP status code, for example C{http.NOT_FOUND}.

    @type message: C{str}
    @param message: A short error message, for example "NOT FOUND".

    @type response: C{bytes}
    @ivar response: A complete HTML document for an error page.
    c         C`  sk   | s6 y t  j t | ƒ ƒ } Wq6 t k
 r2 q6 Xn  t j |  | | | ƒ | |  _ | |  _ | |  _ d S(   sä  
        Initializes a basic exception.

        @type code: C{str}
        @param code: Refers to an HTTP status code, for example
            C{http.NOT_FOUND}. If no C{message} is given, C{code} is mapped to a
            descriptive bytestring that is used instead.

        @type message: C{str}
        @param message: A short error message, for example "NOT FOUND".

        @type response: C{bytes}
        @param response: A complete HTML document for an error page.
        N(	   R   t   gett   intt
   ValueErrort	   Exceptiont   __init__t   statust   messaget   response(   t   selft   codeR   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   $   s    		c         C`  s   d |  j  |  j f S(   Ns   %s %s(   R   R   (   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyt   __str__B   s    N(   t   __name__t
   __module__t   __doc__t   NoneR   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR      s   c           B`  s    e  Z d  Z d d d d „ Z RS(   s–   
    A request resulted in an HTTP redirect.

    @type location: C{str}
    @ivar location: The location of the redirect which was not followed.
    c         C`  sx   | s6 y t  j t | ƒ ƒ } Wq6 t k
 r2 q6 Xn  | rU | rU d | | f } n  t j |  | | | ƒ | |  _ d S(   sß  
        Initializes a page redirect exception.

        @type code: C{str}
        @param code: Refers to an HTTP status code, for example
            C{http.NOT_FOUND}. If no C{message} is given, C{code} is mapped to a
            descriptive string that is used instead.

        @type message: C{str}
        @param message: A short error message, for example "NOT FOUND".

        @type response: C{str}
        @param response: A complete HTML document for an error page.

        @type location: C{str}
        @param location: The location response-header field value. It is an
            absolute URI used to redirect the receiver to a location other than
            the Request-URI so the request can be completed.
        s   %s to %sN(   R   R   R   R   R   R   t   location(   R   R   R   R   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   N   s    N(   R   R   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   G   s   c           B`  s    e  Z d  Z d d d d „ Z RS(   s®   
    HTTP redirection is occurring endlessly.

    @type location: C{str}
    @ivar location: The first URL in the series of redirections which was
        not followed.
    c         C`  sx   | s6 y t  j t | ƒ ƒ } Wq6 t k
 r2 q6 Xn  | rU | rU d | | f } n  t j |  | | | ƒ | |  _ d S(   sç  
        Initializes an infinite redirection exception.

        @type code: C{str}
        @param code: Refers to an HTTP status code, for example
            C{http.NOT_FOUND}. If no C{message} is given, C{code} is mapped to a
            descriptive string that is used instead.

        @type message: C{str}
        @param message: A short error message, for example "NOT FOUND".

        @type response: C{str}
        @param response: A complete HTML document for an error page.

        @type location: C{str}
        @param location: The location response-header field value. It is an
            absolute URI used to redirect the receiver to a location other than
            the Request-URI so the request can be completed.
        s   %s to %sN(   R   R   R   R   R   R   R   (   R   R   R   R   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   {   s    N(   R   R   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   s   s   c           B`  s   e  Z d  Z d „  Z RS(   s~   
    Exception passed to L{ResponseFailed} if we got a redirect without a
    C{Location} header field.

    @since: 11.1
    c         C`  s0   d | | f } t  j |  | | ƒ | |  _ d S(   sú  
        Initializes a page redirect exception when no location is given.

        @type code: C{str}
        @param code: Refers to an HTTP status code, for example
            C{http.NOT_FOUND}. If no C{message} is given, C{code} is mapped to
            a descriptive string that is used instead.

        @type message: C{str}
        @param message: A short error message.

        @type uri: C{str}
        @param uri: The URI which failed to give a proper location header
            field.
        s   %s to %sN(   R   R   t   uri(   R   R   R   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   ¨   s    (   R   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR       s   t   UnsupportedMethodc           B`  s   e  Z d  Z d Z d „  Z RS(   s_  
    Raised by a resource when faced with a strange request method.

    RFC 2616 (HTTP 1.1) gives us two choices when faced with this situtation:
    If the type of request is known to us, but not allowed for the requested
    resource, respond with NOT_ALLOWED.  Otherwise, if the request is something
    we don't know how to deal with in any case, respond with NOT_IMPLEMENTED.

    When this exception is raised by a Resource's render method, the server
    will make the appropriate response.

    This exception's first argument MUST be a sequence of the methods the
    resource *does* support.
    c         G`  s>   t  j |  | | Œ | |  _ t | t ƒ s: t d ƒ ‚ n  d  S(   Ns`   First argument must be a sequence of supported methods, but my first argument is not a sequence.(   R   R   t   allowedMethodst
   isinstanceR   t	   TypeError(   R   R!   t   args(    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   Ñ   s
    	(    (   R   R   R   R!   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR    ¿   s   t   SchemeNotSupportedc           B`  s   e  Z d  Z RS(   sB   
    The scheme of a URI was not one of the supported values.
    (   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR%   Ü   s   c           B`  s   e  Z d  Z RS(   s\   
    Base exception class for all errors which can occur during template
    rendering.
    (   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   ã   s   c           B`  s    e  Z d  Z d „  Z d „  Z RS(   sË   
    Tried to use a render method which does not exist.

    @ivar element: The element which did not have the render method.
    @ivar renderName: The name of the renderer which could not be found.
    c         C`  s)   t  j |  | | ƒ | |  _ | |  _ d  S(   N(   R   R   t   elementt
   renderName(   R   R&   R'   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   ò   s    	c         C`  s   d |  j  j |  j |  j f S(   Ns$   %r: %r had no render method named %r(   t	   __class__R   R&   R'   (   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyt   __repr__ø   s    (   R   R   R   R   R)   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   ë   s   	c           B`  s    e  Z d  Z d „  Z d „  Z RS(   sÏ   
    L{MissingTemplateLoader} is raised when trying to render an Element without
    a template loader, i.e. a C{loader} attribute.

    @ivar element: The Element which did not have a document factory.
    c         C`  s   t  j |  | ƒ | |  _ d  S(   N(   R   R   R&   (   R   R&   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR     s    c         C`  s   d |  j  j |  j f S(   Ns   %r: %r had no loader(   R(   R   R&   (   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR)   
  s    (   R   R   R   R   R)   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   þ   s   	c           B`  s   e  Z d  Z RS(   sK   
    Raised on any attempt to get a method which has not been exposed.
    (   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR     s   c           B`  s   e  Z d  Z RS(   sL   
    During flattening, a slot with no associated data was encountered.
    (   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR	     s   c           B`  s   e  Z d  Z RS(   s_   
    During flattening, an object of a type which cannot be flattened was
    encountered.
    (   R   R   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR
     s   c           B`  s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s   
    An error occurred while flattening an object.

    @ivar _roots: A list of the objects on the flattener's stack at the time
        the unflattenable object was encountered.  The first element is least
        deeply nested object and the last element is the most deeply nested.
    c         C`  s5   | |  _  | |  _ | |  _ t j |  | | | ƒ d  S(   N(   t
   _exceptiont   _rootst
   _tracebackR   R   (   R   t	   exceptiont   rootst	   traceback(    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   .  s    			c         C`  sè   d d l  m } t | t t f ƒ rŠ t | ƒ d k r} t | t ƒ rO d } n d } t | d  ƒ d  d t | d	 ƒ | St | ƒ SnZ t | | ƒ rÚ | j d k r· d
 | j	 d Sd | j | j
 | j | j	 f Sn
 t | ƒ Sd S(   sÑ  
        Convert an object from C{self._roots} to a string suitable for
        inclusion in a render-traceback (like a normal Python traceback, but
        can include "frame" source locations which are not in Python source
        files).

        @param obj: Any object which can be a render step I{root}.
            Typically, L{Tag}s, strings, and other simple Python types.

        @return: A string representation of C{obj}.
        @rtype: L{str}
        i    (   t   Tagi(   i   i   i   iÿÿÿÿs   <...>iìÿÿÿs   Tag <t   >s&   File "%s", line %d, column %d, in "%s"N(   t   twisted.web.templateR0   R"   t   strt   unicodet   lent   reprt   filenameR   t   tagNamet
   lineNumbert   columnNumber(   R   t   objR0   t   prefix(    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyt   _formatRoot5  s    	(c         C`  sÚ   d d l  m } |  j rR d d j g  |  j D] } |  j | ƒ ^ q, ƒ d } n d } |  j r¦ d j g  | |  j ƒ D] } | j ƒ  D] } | ^ q‡ qw ƒ d } n d } d | | |  j j j	 d t
 |  j ƒ d S(	   s¶   
        Present a string representation which includes a template traceback, so
        we can tell where this error occurred in the template, as well as in
        Python.
        i    (   t   format_lists     s   
  s   
t    s   Exception while flattening:
s   : (   R/   R>   R+   t   joinR=   R,   t
   splitlinesR*   R(   R   R3   (   R   R>   t   rR.   t   entryt   lineR/   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR)   ^  s    		9	)c         C`  s
   t  |  ƒ S(   N(   R6   (   R   (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   {  s    (   R   R   R   R   R=   R)   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyR   &  s
   		)	N(   R   t
   __future__R    R   t   __all__t   collectionsR   t   twisted.web._responsesR   R   R   R   R   R   R    R%   R   R   R   R   R	   R
   R   (    (    (    sC   /var/www/html/hlstest/hls-proxy/Twisted-13.2.0/twisted/web/error.pyt   <module>   s(   			0,-