OwlCyberSecurity - MANAGER
Edit File: http.pyc
� �t�ac @ se d Z d d d d d d d d g Z d d l 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 d l m Z m Z m Z d d l m Z d d l m Z d d l m Z e � 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 d � Z d � Z d � Z! d S( s HTTP Utilities t ErrorResponset NeedPrivilegesResponset MultiStatusResponset ResponseQueuet PropertyStatusResponseQueuet statusForFailuret errorForFailuret messageForFailurei����N( t Failure( t InsecurePath( t Logger( t responsecode( t IResponse( t Responset HTTPErrort StatusResponse( t MimeType( t joinURL( t elementc B s/ e Z d Z d Z e Z d d � Z d � Z RS( s� A L{Response} object which contains a status code and a L{element.Error} element. Renders itself as a DAV:error XML document. c C s� t | � t k r? | \ } } t j � } | | _ | | _ n | | _ | j rx t j | t j | j � � j � } n t j | � j � } t j | d | d | �| j j d t d d � � | | _ d S( s @param code: a response code. @param error: an L{WebDAVElement} identifying the error, or a tuple C{(namespace, name)} with which to create an empty element denoting the error. (The latter is useful in the case of preconditions ans postconditions, not all of which have defined XML element classes.) @param description: an optional string that, if present, will get wrapped in a (twisted_dav_namespace, error-description) element. t codet streams content-typet textt xmlN( t typet tupleR t WebDAVUnknownElementt namespacet namet descriptiont Errort ErrorDescriptiont toxmlR t __init__t headerst setHeaderR t error( t selfR R# R t xml_namespacet xml_namet output( ( s"