³ò
—ã=Pc        
   @   s=  d  Z  d d k l Z d d k Td d k Td d k l Z d d k l Z l Z d d k	 l
 Z
 d d k l Z e e ƒ Z d d d	 „  ƒ  YZ d
 d d „  ƒ  YZ d d 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/   
Provides appender classes for I{marshalling}.
iÿÿÿÿ(   t	   getLogger(   t   *(   t	   footprint(   t   Objectt   Property(   t   Element(   t   deepcopyt   Matcherc           B   s    e  Z d  Z d „  Z d „  Z RS(   sU   
    Appender matcher.
    @ivar cls: A class object.
    @type cls: I{classobj}
    c         C   s   | |  _  d S(   sL   
        @param cls: A class object.
        @type cls: I{classobj}
        N(   t   cls(   t   selfR   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyt   __init__&   s    c         C   s2   |  i  d  j o | d  j Sn t | |  i  ƒ Sd  S(   N(   R   t   Nonet
   isinstance(   R	   t   x(    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyt   __eq__-   s    (   t   __name__t
   __module__t   __doc__R
   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR      s   	t   ContentAppenderc           B   s    e  Z d  Z d „  Z d „  Z RS(   sá   
    Appender used to add content to marshalled objects.
    @ivar default: The default appender.
    @type default: L{Appender}
    @ivar appenders: A I{table} of appenders mapped by class.
    @type appenders: I{table}
    c         C   sš   t  | ƒ |  _ t d ƒ t | ƒ f t t ƒ t | ƒ f t t ƒ t | ƒ f t t	 ƒ t
 | ƒ f t t ƒ t | ƒ f t t ƒ t | ƒ f f |  _ d S(   sa   
        @param marshaller: A marshaller.
        @type marshaller: L{suds.mx.core.Core}
        N(   t   PrimativeAppendert   defaultR   R   t   NoneAppenderR   t   PropertyAppenderR   t   ObjectAppenderR   t   ElementAppendert   listt   ListAppendert   tuplet	   appenders(   R	   t
   marshaller(    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR
   =   s    						c         C   sT   |  i  } x4 |  i D]) } | d | i j o | d } Pq q W| i | | ƒ d S(   sÞ   
        Select an appender and append the content to parent.
        @param parent: A parent node.
        @type parent: L{Element}
        @param content: The content to append.
        @type content: L{Content}
        i    i   N(   R   R   t   valuet   append(   R	   t   parentt   contentt   appendert   a(    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   R   s    	
 
	(   R   R   R   R
   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   4   s   	t   Appenderc           B   sV   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(	   sŽ   
    An appender used by the marshaller to append content.
    @ivar marshaller: A marshaller.
    @type marshaller: L{suds.mx.core.Core}
    c         C   s   | |  _  d S(   sa   
        @param marshaller: A marshaller.
        @type marshaller: L{suds.mx.core.Core}
        N(   R   (   R	   R   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR
   i   s    c         C   s   |  i  i | ƒ S(   sC  
        Create and return an XML node that is qualified
        using the I{type}.  Also, make sure all referenced namespace
        prefixes are declared.
        @param content: The content for which proccessing has ended.
        @type content: L{Object}
        @return: A new node.
        @rtype: L{Element}
        (   R   t   node(   R	   R!   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR%   p   s    
c         C   s   |  i  i | | ƒ d S(   sà   
        Set the value of the I{node} to nill.
        @param node: A I{nil} node.
        @type node: L{Element}
        @param content: The content for which proccessing has ended.
        @type content: L{Object}
        N(   R   t   setnil(   R	   R%   R!   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR&   |   s    c         C   s   |  i  i | | ƒ S(   s	  
        Set the value of the I{node} to a default value.
        @param node: A I{nil} node.
        @type node: L{Element}
        @param content: The content for which proccessing has ended.
        @type content: L{Object}
        @return: The default.
        (   R   t
   setdefault(   R	   R%   R!   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR'   †   s    	c         C   s   |  i  i | ƒ S(   s–   
        Get whether the specified content is optional.
        @param content: The content which to check.
        @type content: L{Content}
        (   R   t   optional(   R	   R!   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR(   ‘   s    c         C   s   |  i  i | ƒ d S(   sÀ   
        Notify I{marshaller} that appending this content has suspended.
        @param content: The content for which proccessing has been suspended.
        @type content: L{Object}
        N(   R   t   suspend(   R	   R!   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR)   ™   s    c         C   s   |  i  i | ƒ d S(   s¼   
        Notify I{marshaller} that appending this content has resumed.
        @param content: The content for which proccessing has been resumed.
        @type content: L{Object}
        N(   R   t   resume(   R	   R!   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR*   ¡   s    c         C   s   |  i  i | | ƒ d S(   s“   
        Append the specified L{content} to the I{parent}.
        @param content: The content to append.
        @type content: L{Object}
        N(   R   R   (   R	   R    R!   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   ©   s    (   R   R   R   R
   R%   R&   R'   R(   R)   R*   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR$   b   s   			
				R   c           B   s   e  Z d  Z d „  Z RS(   s4   
    An appender for python I{primative} types.
    c         C   s—   | i  i d ƒ oN | i  d } t | i ƒ } | d  j	 o! t | ƒ o | i | | ƒ q“ n3 |  i | ƒ } | i t | i ƒ ƒ | i	 | ƒ d  S(   Nt   _i   (
   t   tagt
   startswitht   tostrR   R   t   lent   setR%   t   setTextR   (   R	   R    R!   t   attrR   t   child(    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   ·   s    (   R   R   R   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   ²   s   R   c           B   s   e  Z d  Z d „  Z RS(   s)   
    An appender for I{None} values.
    c         C   sS   |  i  | ƒ } |  i | | ƒ } | d  j o |  i | | ƒ n | i | ƒ d  S(   N(   R%   R'   R   R&   R   (   R	   R    R!   R3   R   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   È   s
    (   R   R   R   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   Ã   s   R   c           B   s   e  Z d  Z d „  Z RS(   s!   
    A L{Property} appender.
    c         C   sƒ   | i  } |  i | ƒ } | i | i ƒ  ƒ | i | ƒ xD | i ƒ  D]6 } t d | d d | d ƒ } t i |  | | ƒ qE Wd  S(   NR,   i    R   i   (   R   R%   R1   t   getR   t   itemst   ContentR$   (   R	   R    R!   t   pR3   t   itemt   cont(    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   Õ   s    	 (   R   R   R   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   Ð   s   R   c           B   s   e  Z d  Z d „  Z RS(   s    
    An L{Object} appender.
    c         C   s•   | i  } |  i | ƒ o t | ƒ d j o d  Sn |  i | ƒ } | i | ƒ x> | D]6 } t d | d d | d ƒ } t i |  | | ƒ qW Wd  S(   Ni    R,   R   i   (   R   R(   R   R%   R   R6   R$   (   R	   R    R!   t   objectR3   R8   R9   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   ä   s    	# (   R   R   R   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   ß   s   R   c           B   s   e  Z d  Z d „  Z RS(   s+   
    An appender for I{Element} types.
    c         C   sI   | i  i d ƒ o t d ƒ ‚ n t | i ƒ } | i | i ƒ  ƒ d  S(   NR+   s$   raw XML not valid as attribute value(   R,   R-   t	   ExceptionR   R   R   t   detach(   R	   R    R!   R3   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   ô   s    (   R   R   R   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   ï   s   R   c           B   s   e  Z d  Z d „  Z RS(   s    
    A list/tuple appender.
    c         C   st   | i  } t | ƒ oZ |  i | ƒ x9 | D]1 } t d | i d | ƒ } t i |  | | ƒ q* W|  i | ƒ n d  S(   NR,   R   (   R   R/   R)   R6   R,   R$   R   R*   (   R	   R    R!   t
   collectionR8   R9   (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR      s    	 (   R   R   R   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pyR   û   s   N(    (    (    (   R   t   loggingR    t   sudst   suds.mxt   suds.sudsobjectR   R   R   t   suds.sax.elementR   t   copyR   R   t   logR   R   R$   R   R   R   R   R   R   (    (    (    s(   suds-0.3.7-py2.6.egg/suds/mx/appender.pys   <module>   s"   

.P