³ò
—ã=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 d d k	 l
 Z
 l Z e e ƒ Z h  d d <d	 d
 <Z d d d „  ƒ  YZ d S(   s9   
Provides base classes for XML->object I{unmarshalling}.
iÿÿÿÿ(   t	   getLogger(   t   *(   t   AttrList(   t   Text(   t   Factoryt   merget   clst   classt   dfnt   deft   Corec           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 RS(   sr   
    The abstract XML I{node} unmarshaller.  This class provides the
    I{core} unmarshalling functionality.
    c         C   s#   |  i  ƒ  |  i | ƒ \ } } | S(   sè   
        Process an object graph representation of the xml I{node}.
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        @return: A suds object.
        @rtype: L{Object}
        (   t   resett   append(   t   selft   contentt   datat   result(    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyt   process'   s    
c         C   sW   |  i  | ƒ |  i | ƒ |  i | ƒ |  i | ƒ |  i | ƒ | i |  i | ƒ f S(   s€  
        Process the specified node and convert the XML document into
        a I{suds} L{object}.
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        @return: A I{append-result} tuple as: (L{Object}, I{value})
        @rtype: I{append-result}
        @note: This is not the proper entry point.
        @see: L{process()}
        (   t   startt   append_attributest   append_childrent   append_textt   endR   t   postprocess(   R   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   3   s    c         C   s[  | i  } t | i ƒ o | i ƒ  o | Sn t | i ƒ } | i ƒ  oM t | i ƒ o< | i ƒ  o/ t i | i	 | i
 ƒ  ƒ } t | i | ƒ Sn t | i ƒ o | i Sn | i ƒ  } | i  i ƒ  o d Sn t | i ƒ o? | i d j o/ |  i | i ƒ o d Sq&t d d | ƒSn t | i t ƒ o t | i d | ƒSn | i Sd S(   sl  
        Perform final processing of the resulting data structure as follows:
          - Mixed values (children and text) will have a result of the I{content.node}.
          - Simi-simple values (attributes, no-children and text) will have a result of a
             property object.
          - Simple values (no-attributes, no-children with text nodes) will have a string 
             result equal to the value of the content.node.getText().
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        @return: The post-processed result.
        @rtype: I{any}
        t    t   langN(   t   nodet   lent   childrent   hasTextR   t
   attributest   rlenR   t   propertyt   namet   getTextR   R   R   t   isnilt   Nonet   textt   nillableR   t
   isinstancet
   basestring(   R   R   R   R   t   pR   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   E   s*    	!c         C   sR   t  | i i ƒ } x9 | i ƒ  D]+ } | i } | i } |  i | | | ƒ q Wd S(   sæ   
        Append attribute nodes into L{Content.data}.
        Attributes in the I{schema} or I{xml} namespaces are skipped.
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        N(   R   R   R   t   realR!   t   valuet   append_attribute(   R   R   R   t   attrR!   R+   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   j   s     		c         C   s3   | } d t  i | | ƒ } t | i | | ƒ d S(   s;  
        Append an attribute name/value into L{Content.data}.
        @param name: The attribute name
        @type name: basestring
        @param value: The attribute's value
        @type value: basestring
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        s   _%sN(   t   reservedt   gett   setattrR   (   R   R!   R+   R   t   key(    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR,   w   s    
c         C   s  x| i  i D]} t | ƒ } |  i | ƒ \ } } t i | i | i ƒ } | | i j oS t | i | ƒ } t	 | t
 ƒ o | i | ƒ q t | i | | | g ƒ q n |  i | ƒ o> | d j o t | i | g  ƒ qt | i | | g ƒ q t | i | | ƒ q Wd S(   s›   
        Append child nodes into L{Content.data}
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        N(   R   R   t   ContentR   R.   R/   R!   R   t   getattrR'   t   listR0   t	   unboundedR$   (   R   R   t   childt   contt   cdatat   cvalR1   t   v(    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   …   s      c         C   s*   | i  i ƒ  o | i  i ƒ  | _ n d S(   sš   
        Append text nodes into L{Content.data}
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        N(   R   R   R"   R%   (   R   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   ž   s    c         C   s   d  S(   N(    (   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   §   s    c         C   s   t  i | i i ƒ | _ d S(   s  
        Processing on I{node} has started.  Build and return
        the proper object.
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        @return: A subclass of Object.
        @rtype: L{Object}
        N(   R   t   objectR   R!   R   (   R   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   ª   s    	c         C   s   d S(   s”   
        Processing on I{node} has ended.
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        N(    (   R   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR   µ   s    c         C   s   |  i  | ƒ S(   sÚ   
        Get whether the object is bounded (not a list).
        @param data: The current object being built.
        @type data: L{Object}
        @return: True if bounded, else False
        @rtype: boolean
        '(   R5   (   R   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyt   bounded½   s    c         C   s   t  S(   sÚ   
        Get whether the object is unbounded (a list).
        @param data: The current object being built.
        @type data: L{Object}
        @return: True if unbounded, else False
        @rtype: boolean
        '(   t   False(   R   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR5   Ç   s    c         C   s   t  S(   sÏ   
        Get whether the object is nillable.
        @param data: The current object being built.
        @type data: L{Object}
        @return: True if nillable, else False
        @rtype: boolean
        '(   R=   (   R   R   (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR&   Ñ   s    (   t   __name__t
   __module__t   __doc__R   R   R   R   R,   R   R   R   R   R   R<   R5   R&   (    (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pyR
   !   s   			%									
	
N(    (   R@   t   loggingR    t   sudst   suds.umxt   suds.umx.attrlistR   t   suds.sax.textR   t   suds.sudsobjectR   R   R>   t   logR.   R
   (    (    (    s%   suds-0.3.7-py2.6.egg/suds/umx/core.pys   <module>   s   

