³ò
—ã=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 d d k l Z e e ƒ Z d e f d	 „  ƒ  YZ d
 S(   s)   
Provides literal I{marshaller} classes.
iÿÿÿÿ(   t	   getLogger(   t   *(   t   Core(   t   Typer(   t   GraphResolvert   Frame(   t   Elementt   Literalc           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 d „  Z RS(   s)  
    A I{literal} marshaller.
    This marshaller is semi-typed as needed to support both
    document/literal and rpc/literal soap styles.
    @ivar schema: An xsd schema.
    @type schema: L{xsd.schema.Schema}
    @ivar resolver: A schema type resolver.
    @type resolver: L{GraphResolver}
    c         C   s8   t  i |  ƒ | |  _ | i |  _ t |  i ƒ |  _ d S(   s[   
        @param schema: A schema object
        @type schema: L{xsd.schema.Schema}
        N(   R   t   __init__t   schemat   optionsR   t   resolver(   t   selfR	   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR   +   s    	c         C   s   |  i  i ƒ  d  S(   N(   R   t   reset(   R   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR   5   s    c         C   s‹  t  i d | ƒ | i d  j om | i } | i d ƒ o d | d } n |  i i | | i ƒ | _ | i d  j o t	 | i ƒ ‚ q$n˜ d  } t
 | i t ƒ oY |  i i | i ƒ } | d  j o  t  i d | i ƒ | i } n |  i | i | ƒ n t | i d | ƒ} |  i i | ƒ |  i i ƒ  i } |  i | i | ƒ | _ |  i | ƒ o% t  i d | ƒ |  i i ƒ  t Sn t Sd  S(   Ns   starting content:
%st   _t   @i   s   object has no type informationt   resolveds   skipping (optional) content:
%s(   t   logt   debugt   typet   Nonet   tagt
   startswithR   t   findt   valuet   TypeNotFoundt
   isinstancet   Objectt   knownt   sortR   t   pusht   topR   t
   translatedt   skipt   popt   Falset   True(   R   t   contentt   nameR   t   frameR   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyt   start8   s0    	c         C   s   t  | _ |  i i ƒ  d  S(   N(   R$   t	   suspendedR   R"   (   R   R%   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyt   suspendT   s    	c         C   s#   t  | i ƒ } |  i i | ƒ d  S(   N(   R   R   R   R   (   R   R%   R'   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyt   resumeX   s    c         C   s]   t  i d | ƒ |  i i ƒ  i } | | i j o |  i i ƒ  n t d | | f ƒ ‚ d  S(   Ns   ending content:
%ss*   content (end) mismatch: top=(%s) cont=(%s)(   R   R   R   R   R   R"   t	   Exception(   R   R%   t   current(    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyt   end\   s    c         C   s€   | i  i ƒ  } | i  i o1 t | i d | ƒ} | i | d | d ƒ n t | i ƒ } |  i | | ƒ t i d | ƒ | S(   Nt   nsi    i   s   created - node:
%s(	   R   t	   namespacet   form_qualifiedR   R   t	   addPrefixt   encodeR   R   (   R   R%   R/   t   node(    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR4   f   s    c         C   s   | i  i o | i ƒ  n d  S(   N(   R   t   nillablet   setnil(   R   R4   R%   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR6   q   s    c         C   s.   | i  i } | d  j o n | i | ƒ | S(   N(   R   t   defaultR   t   setText(   R   R4   R%   R7   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyt
   setdefaultu   s
    c         C   sZ   | i  i ƒ  o t Sn |  i } | i ƒ  i } x# | D] } | i ƒ  o t Sq7 q7 Wt S(   N(   R   t   optionalR$   R   R   t   ancestryR#   (   R   R%   R   R;   t   a(    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR:   }   s    	 c         C   s¥   | i  i ƒ  o d  Sn |  i i ƒ  i } | d  j o | i  i ƒ  } n | i ƒ  p d  Sn d  } | i } |  i	 i
 o | i d ƒ } n t i | | | ƒ d  S(   Nt   ns1(   R   t   anyR   R   R   R   t   resolvet	   extensionR&   R
   t   xstqR0   R   t   manual(   R   R4   R%   R   R/   R&   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR3   ‡   s    	c         C   sg   |  i  | ƒ oS | i } | d j o t Sn t | t t f ƒ o t | ƒ d j o t Sqc n t S(   s    skip this content i    N(	   R:   R   R   R$   R   t   listt   tuplet   lenR#   (   R   R%   t   v(    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR!   ™   s    	)c         C   sT   | i  i ƒ  o t Sn |  i i ƒ  i } x# | D] } | i ƒ  o t Sq1 q1 Wt S(   N(   R   R:   R$   R   R   R;   R#   (   R   R%   R;   R<   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR:   £   s     c         C   s)   | d j	 o | i | t ƒ Sn d Sd S(   s!    translate using the schema type N(   R   t	   translateR#   (   R   R   R   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR    ¬   s    c         C   s   | i  } |  i | ƒ | _ d S(   s'    sort attributes using the schema type N(   t   __metadata__t   ordering(   R   t   sobjectR   t   md(    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR   ³   s    	c         C   sr   g  } xe | i  ƒ  D]W \ } } | i } | i d j o q n | i ƒ  o d | i } n | i | ƒ q W| S(   s    get the ordering s   _%sN(   R?   R&   R   t   isattrt   append(   R   R   t   resultt   childR;   R&   (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyRI   ¸   s     	(   t   __name__t
   __module__t   __doc__R   R   R(   R*   R+   R.   R4   R6   R9   R:   R3   R!   R    R   RI   (    (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pyR       s"   		
					
				
		
				N(   RR   t   loggingR    t   sudst   suds.mxt   suds.mx.coreR   t   suds.mx.typerR   t   suds.resolverR   R   t   suds.sax.elementR   RP   R   R   (    (    (    s'   suds-0.3.7-py2.6.egg/suds/mx/literal.pys   <module>   s   

