ó
čžbc           @   sŘ   d  Z  d d l Z d d l Z d d l m Z d d d g Z d d d     YZ d d d	     YZ d
   Z	 d e
 f d     YZ d e
 f d     YZ d d d     YZ [ d d d     YZ d d d     YZ d S(   s4   Implementation of the DOM Level 3 'LS-Load' feature.i˙˙˙˙N(   t
   NodeFiltert
   DOMBuildert   DOMEntityResolvert   DOMInputSourcet   Optionsc           B   s   e  Z d  Z d Z e Z e Z e Z e Z	 e Z
 e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z e Z d Z d Z RS(   są   Features object that has variables set for each DOMBuilder feature.

    The DOMBuilder class uses an instance of this class to pass settings to
    the ExpatBuilder class.
    i   N(   t   __name__t
   __module__t   __doc__t
   namespacest   Truet   namespace_declarationst   Falset
   validationt   external_parameter_entitiest   external_general_entitiest   external_dtd_subsett   validate_if_schemat   validatet   datatype_normalizationt   create_entity_ref_nodest   entitiest   whitespace_in_element_contentt   cdata_sectionst   commentst   charset_overrides_xml_encodingt   infosett   supported_mediatypes_onlyt   Nonet   errorHandlert   filter(    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR      s(   c           B   să  e  Z d# Z d# Z d# Z d  Z d Z d Z d Z	 e e e e	 f Z
 d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z i d$ g d% 6d& g d' 6d( g d) 6d* g d+ 6d, g d- 6d. g d/ 6d0 g d1 6d2 g d3 6d4 g d5 6d6 g d7 6d8 d9 g d: 6d; g d< 6d= g d> 6d? g d@ 6dA g dB 6dC g dD 6dE g dF 6dG g dH 6dI g dJ 6dK g dL 6g  dM 6dN dO dP dQ dR dS dT dU dV g	 dW 6dX g dY 6dZ g d[ 6d\ g d] 6Z d   Z d   Z d    Z d!   Z d"   Z RS(^   i   i   i   i   c         C   s   t    |  _ d  S(   N(   R   t   _options(   t   self(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   __init__9   s    c         C   s   |  j  S(   N(   t   entityResolver(   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_entityResolver<   s    c         C   s   | |  _  d  S(   N(   R!   (   R   R!   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_entityResolver>   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_errorHandlerA   s    c         C   s   | |  _  d  S(   N(   R   (   R   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_errorHandlerC   s    c         C   s   |  j  S(   N(   R   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_filterF   s    c         C   s   | |  _  d  S(   N(   R   (   R   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_filterH   s    c         C   s¸   |  j  |  r | r d p d } y |  j t |  | f } Wn* t k
 rj t j j d | f   q´ XxF | D] \ } } t |  j | |  qr Wn t j j	 d t
 |    d  S(   Ni   i    s   unsupported feature: %rs   unknown feature: (   t   supportsFeaturet	   _settingst   _name_xformt   KeyErrort   xmlt   domt   NotSupportedErrt   setattrR   t   NotFoundErrt   repr(   R   t   namet   statet   settingst   value(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt
   setFeatureK   s    	c         C   s   t  |  j t |   S(   N(   t   hasattrR   R*   (   R   R2   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR(   Y   s    c         C   s+   t  |  | r d p d f } | |  j k S(   Ni   i    (   R*   R)   (   R   R2   R3   t   key(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   canSetFeature\   s    R
   i    R   R   R   R   R   R   R   R   R   R   R   R   R   R   c         C   sš   t  |  } y t |  j |  SWn t k
 r´ | d k r |  j } | j o | j o | j o | j o | j p | j	 p | j
 p | j p | j St j j d t |    n Xd  S(   NR   s   feature %s not known(   R*   t   getattrR   t   AttributeErrorR   R   R   R   R
   R   R   R   R   R,   R-   R0   R1   (   R   R2   t   xnamet   options(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt
   getFeature˘   s     									c         C   sC   |  j  r! |  j  j d  |  } n t   j d  |  } |  j |  S(   N(   R!   t   resolveEntityR   R   t   parse(   R   t   urit   input(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   parseURI´   s    	c         C   sy   t  j  |  j  } |  j | _ |  j | _ | j } | d  k ri | j ri d d  l } | j | j  } n  |  j	 | |  S(   Ni˙˙˙˙(
   t   copyR   R   R   t
   byteStreamR   t   systemIdt   urllib2t   urlopent   _parse_bytestream(   R   RB   R=   t   fpRG   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR@   ť   s    	c         C   s.   | |  j  k r t d   n  t d   d  S(   Ns   not a legal actions   Haven't written this yet...(   t   _legal_actionst
   ValueErrort   NotImplementedError(   R   RB   t   cnodet   action(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   parseWithContextĹ   s    c         C   s.   d d  l  } | j j j |  } | j |  S(   Ni˙˙˙˙(   t   xml.dom.expatbuilderR-   t   expatbuildert   makeBuildert	   parseFile(   R   t   streamR=   R,   t   builder(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyRI   Ę   s    N(   R
   i    (   R
   i    (   R
   i   (   R
   i   (   R   i    (   R   i    (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R   i    (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R   i    (   R   i   (   R   i   (   R   i    (   R
   i    (   R   i    (   R   i    (   R   i    (   R   i    (   R   i   (   R   i   (   R   i   (   R   i   (   R   i   (   R   i    (   R   i    (   R   i    (   R   i    (   R   i   (   R   i   (   R   R   R   R!   R   R   t   ACTION_REPLACEt   ACTION_APPEND_AS_CHILDRENt   ACTION_INSERT_AFTERt   ACTION_INSERT_BEFORERK   R    R"   R#   R$   R%   R&   R'   R6   R(   R9   R)   R>   RC   R@   RP   RI   (    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR   ,   sv   											






















			
	c         C   s   |  j    j d d  S(   Nt   -t   _(   t   lowert   replace(   R2   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR*   Đ   s    c           B   s2   e  Z d Z d   Z d   Z d   Z d   Z RS(   t   _openerc         C   sđ   | d  k	 s t  t   } | | _ | | _ |  j   j |  | _ |  j |  | _	 d d  l
 } d d  l } | j |  } | \ } } }	 }
 } } |	 rě |	 j d  rě | j |	  d }	 | | |	 |
 | | f } | j |  | _ n  | S(   Ni˙˙˙˙t   /(   R   t   AssertionErrorR   t   publicIdRF   t   _get_openert   openRE   t   _guess_media_encodingt   encodingt	   posixpatht   urlparset   endswitht   dirnamet
   urlunparset   baseURI(   R   Rb   RF   t   sourceRg   Rh   t   partst   schemet   netloct   patht   paramst   queryt   fragment(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR?   ×   s    			c         C   s6   y |  j  SWn$ t k
 r1 |  j   |  _  |  j  SXd  S(   N(   R_   R;   t   _create_opener(   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyRc   í   s
    c         C   s   d d  l  } | j   S(   Ni˙˙˙˙(   RG   t   build_opener(   R   RG   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyRu   ô   s    c         C   sb   | j  j   } d | k r^ x@ | j   D]/ } | j d  r( | j d d  d j   Sq( Wn  d  S(   Ns   Content-Types   charset=t   =i   (   RE   t   infot   getplistt
   startswitht   splitR]   (   R   Rm   Rx   t   param(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyRe   ř   s
    (   R_   (   R   R   t	   __slots__R?   Rc   Ru   Re   (    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR   Ô   s
   			c           B   s   e  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(   RE   t   characterStreamt
   stringDataRf   Rb   RF   Rl   c         C   sC   d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  S(   N(   R   RE   R~   R   Rf   Rb   RF   Rl   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR      s    						c         C   s   |  j  S(   N(   RE   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_byteStream  s    c         C   s   | |  _  d  S(   N(   RE   (   R   RE   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_byteStream  s    c         C   s   |  j  S(   N(   R~   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_characterStream  s    c         C   s   | |  _  d  S(   N(   R~   (   R   R~   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_characterStream  s    c         C   s   |  j  S(   N(   R   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_stringData  s    c         C   s   | |  _  d  S(   N(   R   (   R   t   data(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_stringData  s    c         C   s   |  j  S(   N(   Rf   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_encoding  s    c         C   s   | |  _  d  S(   N(   Rf   (   R   Rf   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_encoding  s    c         C   s   |  j  S(   N(   Rb   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_publicId!  s    c         C   s   | |  _  d  S(   N(   Rb   (   R   Rb   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_publicId#  s    c         C   s   |  j  S(   N(   RF   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_systemId&  s    c         C   s   | |  _  d  S(   N(   RF   (   R   RF   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_systemId(  s    c         C   s   |  j  S(   N(   Rl   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_baseURI+  s    c         C   s   | |  _  d  S(   N(   Rl   (   R   RA   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _set_baseURI-  s    (   RE   R~   R   Rf   Rb   RF   Rl   (   R   R   R}   R    R   R   R   R   R   R   R   R   R   R   R   R   R   R   (    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR      s"    															t   DOMBuilderFilterc           B   sJ   e  Z d  Z d Z d Z d Z d Z e j Z	 d   Z
 d   Z d   Z RS(   sS   Element filter which can be used to tailor construction of
    a DOM instance.
    i   i   i   i   c         C   s   |  j  S(   N(   t
   whatToShow(   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   _get_whatToShowB  s    c         C   s   |  j  S(   N(   t   FILTER_ACCEPT(   R   t   element(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt
   acceptNodeE  s    c         C   s   |  j  S(   N(   R   (   R   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   startContainerH  s    (   R   R   R   R   t   FILTER_REJECTt   FILTER_SKIPt   FILTER_INTERRUPTR    t   SHOW_ALLR   R   R   R   (    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR   1  s   			t
   DocumentLSc           B   sJ   e  Z d  Z e Z d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   s=   Mixin to create documents that conform to the load/save spec.c         C   s   t  S(   N(   R   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt
   _get_asyncS  s    c         C   s   | r t  j j d   n  d  S(   Ns.   asynchronous document loading is not supported(   R,   R-   R.   (   R   t   async(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt
   _set_asyncU  s    	c         C   s   t  d   d  S(   Ns'   haven't figured out what this means yet(   RM   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   abortZ  s    c         C   s   t  d   d  S(   Ns   haven't written this yet(   RM   (   R   RA   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   load`  s    c         C   s   t  d   d  S(   Ns   haven't written this yet(   RM   (   R   Rm   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   loadXMLc  s    c         C   s@   | d  k r |  } n! | j |  k	 r6 t j j    n  | j   S(   N(   R   t   ownerDocumentR,   R-   t   WrongDocumentErrt   toxml(   R   t   snode(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   saveXMLf  s
    	(   R   R   R   R   R   R   R   R   R   R    RĽ   (    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyR   N  s   					t   DOMImplementationLSc           B   s/   e  Z d  Z d Z d   Z d   Z d   Z RS(   i   i   c         C   sk   | d  k	 r! t j j d   n  | |  j k r7 t   S| |  j k r[ t j j d   n  t d   d  S(   Ns   schemaType not yet supporteds'   asynchronous builders are not supporteds   unknown value for mode(   R   R,   R-   R.   t   MODE_SYNCHRONOUSR   t   MODE_ASYNCHRONOUSRL   (   R   t   modet
   schemaType(    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   createDOMBuilderr  s    		c         C   s   t  d   d  S(   Ns-   the writer interface hasn't been written yet!(   RM   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   createDOMWriter}  s    c         C   s   t    S(   N(   R   (   R   (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   createDOMInputSource  s    (   R   R   R§   R¨   RŤ   RŹ   R­   (    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyRŚ   n  s
   		(    (    (    (    (    (   R   RD   t   xml.domR,   t   xml.dom.NodeFilterR    t   __all__R   R   R*   t   objectR   R   R   R   RŚ   (    (    (    s(   /usr/lib/python2.7/xml/dom/xmlbuilder.pyt   <module>   s    ¤	,1 