Ñò
—ã=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 e e ƒ Z d e f d „  ƒ  YZ d	 S(
   s&   
Provides typed unmarshaller classes.
iÿÿÿÿ(   t	   getLogger(   t   *(   t   Core(   t   NodeResolvert   Frame(   t   Factoryt   Typedc           B   sh   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z d
 „  Z RS(   su   
    A I{typed} XML unmarshaller
    @ivar resolver: A schema type resolver.
    @type resolver: L{NodeResolver}
    c         C   s   t  | ƒ |  _ d S(   s\   
        @param schema: A schema object.
        @type schema: L{xsd.schema.Schema}
        N(   R   t   resolver(   t   selft   schema(    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyt   __init__&   s    c         C   s%   t  | ƒ } | | _ t i |  | ƒ S(   s4  
        Process an object graph representation of the xml L{node}.
        @param node: An XML tree.
        @type node: L{sax.element.Element}
        @param type: The I{optional} schema type.
        @type type: L{xsd.sxbase.SchemaObject}
        @return: A suds object.
        @rtype: L{Object}
        (   t   Contentt   typeR   t   process(   R   t   nodeR   t   content(    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR   -   s    
	c         C   s   t  i d ƒ |  i i ƒ  d  S(   Nt   reset(   t   logt   debugR   R   (   R   (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR   ;   s    c         C   s  | i  d  j o[ |  i i | i ƒ } | d  j o, t i |  i i ƒ t | i i	 ƒ  ƒ ‚ n | | _  n; |  i i
 | i ƒ } t | i  d | ƒ} |  i i | ƒ |  i i ƒ  i } | i } | d  j o | i i } n t i | ƒ | _ | i i } | i  | _ d  S(   Nt   resolved(   R   t   NoneR   t   findR   R   t   errorR	   t   TypeNotFoundt   qnamet   knownR   t   pusht   topR   t   nameR   t   objectt   datat   __metadata__t   sxtype(   R   R   t   foundR   t   frameR   t   cls_namet   md(    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyt   start?   s     	c         C   s   |  i  i ƒ  d  S(   N(   R   t   pop(   R   R   (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyt   endU   s    c         C   sU   y1 t  | t ƒ o | i } | i } | i ƒ  SWn t i d | d t ƒn Xt S(   Ns   metadata error:
%st   exc_info(	   t
   isinstancet   ObjectR   R    t	   unboundedR   R   t   Truet   False(   R   R   R$   R   (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR+   X   s    		c         C   su   yQ t  | t ƒ o= | i } | i } | i ƒ  } | i p | i ƒ  o | i SWn t i d | d t	 ƒn Xt
 S(   Ns   metadata error:
%sR(   (   R)   R*   R   R    t   resolvet   nillablet   builtinR   R   R,   R-   (   R   R   R$   R   R   (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR/   b   s    		#c         C   s_   |  i  i | ƒ } | d j o t i d | ƒ n |  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   attribute (%s) type, not-foundN(   R   t   findattrR   R   t   warnt
   translatedR   t   append_attribute(   R   R   t   valueR   R   (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR4   m   s
    
c         C   s>   t  i |  | ƒ | i i ƒ  } |  i | i | i ƒ | _ d S(   sš   
        Append text nodes into L{Content.data}
        @param content: The current content being unmarshalled.
        @type content: L{Content}
        N(   R   t   append_textR   R.   R3   t   text(   R   R   R   (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR6   ~   s    c         C   s/   | d j	 o | i ƒ  } | i | ƒ S| Sd S(   s!    translate using the schema type N(   R   R.   t	   translate(   R   R5   R   R   (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR3   ˆ   s    (   t   __name__t
   __module__t   __doc__R
   R   R   R%   R'   R+   R/   R4   R6   R3   (    (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyR      s   						
			
N(   R;   t   loggingR    t   sudst   suds.umxt   suds.umx.coreR   t   suds.resolverR   R   t   suds.sudsobjectR   R9   R   R   (    (    (    sM   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/umx/typed.pyt   <module>   s   

