ó
–‡Lc           @   s  d  Z  d d l Td d l m Z e e ƒ Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d	 „  ƒ  YZ	 d
 e f d „  ƒ  YZ
 d d d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d d d „  ƒ  YZ d d d „  ƒ  YZ d d d „  ƒ  YZ d S(   sH   
The plugin module provides classes for implementation
of suds plugins.
iÿÿÿÿ(   t   *(   t	   getLoggert   Contextc           B   s   e  Z d  Z RS(   s   
    Plugin context.
    (   t   __name__t
   __module__t   __doc__(    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR      s   t   InitContextc           B   s   e  Z d  Z RS(   sU   
    Init Context.
    @ivar wsdl: The wsdl.
    @type wsdl: L{wsdl.Definitions}
    (   R   R   R   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   #   s   t   DocumentContextc           B   s   e  Z d  Z RS(   sÌ   
    The XML document load context.
    @ivar url: The URL.
    @type url: str
    @ivar document: Either the XML text or the B{parsed} document root.
    @type document: (str|L{sax.element.Element})
    (   R   R   R   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   ,   s   t   MessageContextc           B   s   e  Z d  Z RS(   sè   
    The context for sending the soap envelope.
    @ivar envelope: The soap envelope to be sent.
    @type envelope: (str|L{sax.element.Element})
    @ivar reply: The reply.
    @type reply: (str|L{sax.element.Element}|object)
    (   R   R   R   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   7   s   t   Pluginc           B   s   e  Z d  Z RS(   s   
    Plugin base.
    (   R   R   R   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR	   B   s   t
   InitPluginc           B   s   e  Z d  Z d „  Z RS(   s2   
    The base class for suds I{init} plugins.
    c         C   s   d S(   sú   
        Suds client initialization.
        Called after wsdl the has been loaded.  Provides the plugin
        with the opportunity to inspect/modify the WSDL.
        @param context: The init context.
        @type context: L{InitContext}
        N(    (   t   selft   context(    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   initializedN   s    (   R   R   R   R   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR
   I   s   t   DocumentPluginc           B   s    e  Z d  Z d „  Z d „  Z RS(   s6   
    The base class for suds I{document} plugins.
    c         C   s   d S(   s$  
        Suds has loaded a WSDL/XSD document.  Provides the plugin 
        with an opportunity to inspect/modify the unparsed document. 
        Called after each WSDL/XSD document is loaded. 
        @param context: The document context. 
        @type context: L{DocumentContext} 
        N(    (   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   loaded^   s    c         C   s   d S(   s  
        Suds has parsed a WSDL/XSD document.  Provides the plugin
        with an opportunity to inspect/modify the parsed document.
        Called after each WSDL/XSD document is parsed.
        @param context: The document context.
        @type context: L{DocumentContext}
        N(    (   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   parsedh   s    (   R   R   R   R   R   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   Y   s   	
t   MessagePluginc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s:   
    The base class for suds I{soap message} plugins.
    c         C   s   d S(   s:  
        Suds will send the specified soap envelope.
        Provides the plugin with the opportunity to inspect/modify
        the envelope Document before it is sent.
        @param context: The send context.
            The I{envelope} is the envelope docuemnt.
        @type context: L{MessageContext}
        N(    (   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt
   marshalledx   s    	c         C   s   d S(   s*  
        Suds will send the specified soap envelope.
        Provides the plugin with the opportunity to inspect/modify
        the message text it is sent.
        @param context: The send context.
            The I{envelope} is the envelope text.
        @type context: L{MessageContext}
        N(    (   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   sendingƒ   s    	c         C   s   d S(   s0  
        Suds has received the specified reply.
        Provides the plugin with the opportunity to inspect/modify
        the received XML text before it is SAX parsed.
        @param context: The reply context.
            The I{reply} is the raw text.
        @type context: L{MessageContext}
        N(    (   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   receivedŽ   s    	c         C   s   d S(   s?  
        Suds has sax parsed the received reply.
        Provides the plugin with the opportunity to inspect/modify
        the sax parsed DOM tree for the reply before it is unmarshalled.
        @param context: The reply context.
            The I{reply} is DOM tree.
        @type context: L{MessageContext}
        N(    (   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   ™   s    	c         C   s   d S(   sE  
        Suds has unmarshalled the received reply.
        Provides the plugin with the opportunity to inspect/modify
        the unmarshalled reply object before it is returned.
        @param context: The reply context.
            The I{reply} is unmarshalled suds object.
        @type context: L{MessageContext}
        N(    (   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   unmarshalled¤   s    	(   R   R   R   R   R   R   R   R   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   s   s   				t   PluginContainerc           B   sM   e  Z d  Z i e e f d 6e e f d 6e e f d 6Z	 d „  Z
 d „  Z RS(   sà   
    Plugin container provides easy method invocation.
    @ivar plugins: A list of plugin objects.
    @type plugins: [L{Plugin},]
    @cvar ctxclass: A dict of plugin method / context classes.
    @type ctxclass: dict
    t   initt   documentt   messagec         C   s   | |  _  d S(   s_   
        @param plugins: A list of plugin objects.
        @type plugins: [L{Plugin},]
        N(   t   plugins(   R   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   __init__¿   s    c         C   s{   |  j  j | ƒ } | rj g  } | \ } } x0 |  j D]% } t | | ƒ r4 | j | ƒ q4 q4 Wt | | ƒ St d | ‚ d  S(   Ns   plugin domain (%s), invalid(   t   domainst   getR   t
   isinstancet   appendt   PluginDomaint	   Exception(   R   t   namet   domainR   t   ctxt   pclasst   p(    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   __getattr__Æ   s    (   R   R   R   R   R
   R   R   R   R   R   R   R'   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   °   s   	R    c           B   s    e  Z d  Z d „  Z d „  Z RS(   s˜   
    The plugin domain.
    @ivar ctx: A context.
    @type ctx: L{Context}
    @ivar plugins: A list of plugins (targets).
    @type plugins: list
    c         C   s   | |  _  | |  _ d  S(   N(   R$   R   (   R   R$   R   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   Ü   s    	c         C   s   t  | |  ƒ S(   N(   t   Method(   R   R"   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR'   à   s    (   R   R   R   R   R'   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR    Ó   s   	R(   c           B   s    e  Z d  Z d „  Z d „  Z RS(   s”   
    Plugin method.
    @ivar name: The method name.
    @type name: str
    @ivar domain: The plugin domain.
    @type domain: L{PluginDomain}
    c         C   s   | |  _  | |  _ d S(   s•   
        @param name: The method name.
        @type name: str
        @param domain: A plugin domain.
        @type domain: L{PluginDomain}
        N(   R"   R#   (   R   R"   R#   (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR   í   s    	c         K   s•   |  j  j ƒ  } | j j | ƒ xo |  j  j D]a } y8 t | |  j d  ƒ } | ri t | ƒ ri | | ƒ n  Wq, t	 k
 rŒ } t
 j | ƒ q, Xq, W| S(   N(   R#   R$   t   __dict__t   updateR   t   getattrR"   t   Nonet   callableR!   t   logt	   exception(   R   t   kwargsR$   t   plugint   methodt   pe(    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   __call__÷   s    (   R   R   R   R   R4   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyR(   ä   s   	
N(    (    (    (    (   R   t   sudst   loggingR   R   R.   t   objectR   R   R   R   R	   R
   R   R   R   R    R(   (    (    (    sE   /opt/xtal/ccp4-6.5-linux32/lib/python2.7/site-packages/suds/plugin.pyt   <module>   s   
	=#