Ñò
—ã=Pc           @   s¡   d  Z  d d k l Z e e ƒ Z d e f d „  ƒ  YZ d d d „  ƒ  YZ d d d „  ƒ  YZ d	 e f d
 „  ƒ  YZ	 d e f d „  ƒ  YZ
 d d d „  ƒ  YZ d S(   s   
Properties classes.
iÿÿÿÿ(   t	   getLoggert
   AutoLinkerc           B   s   e  Z d  Z d „  Z RS(   s¢   
    Base class, provides interface for I{automatic} link
    management between a L{Properties} object and the L{Properties}
    contained within I{values}.
    c         C   s   d S(   sÞ   
        Notification that a values was updated and the linkage
        between the I{properties} contained with I{prev} need to
        be relinked to the L{Properties} contained within the
        I{next} value.
        N(    (   t   selft
   propertiest   prevt   next(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   updated    s    (   t   __name__t
   __module__t   __doc__R   (    (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR      s   t
   Definitionc           B   sD   e  Z d  Z e ƒ  d „ Z d d „ Z d „  Z d „  Z d „  Z	 RS(   sà   
    Property definition.
    @ivar name: The property name.
    @type name: str
    @ivar classes: The (class) list of permitted values
    @type classes: tuple
    @ivar default: The default value.
    @ivar type: any
    c         C   sK   t  | t t f ƒ p | f } n | |  _ | |  _ | |  _ | |  _ d S(   sé   
        @param name: The property name.
        @type name: str
        @param classes: The (class) list of permitted values
        @type classes: tuple
        @param default: The default value.
        @type default: any
        N(   t
   isinstancet   listt   tuplet   namet   classest   defaultt   linker(   R   R   R   R   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __init__4   s    				c         C   s   | d j o |  i S| Sd S(   så   
        Convert the I{value} into the default when I{None}.
        @param value: The proposed value.
        @type value: any
        @return: The I{default} when I{value} is I{None}, else I{value}.
        @rtype: any
        N(   t   NoneR   (   R   t   value(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   nvlD   s    c         C   sZ   | d j o d St |  i ƒ o4 t | |  i ƒ o  d t |  i f } t | ‚ n d S(   s¿   
        Validate the I{value} is of the correct class.
        @param value: The value to validate.
        @type value: any
        @raise AttributeError: When I{value} is invalid.
        Ns   "%s" must be: %s(   R   t   lenR   R   R   t   AttributeError(   R   R   t   msg(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   validateQ   s    c         C   s   d |  i  t |  ƒ f S(   Ns   %s: %s(   R   t   str(   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __repr__`   s    c         C   sh   g  } t  |  i ƒ o | i d t |  i ƒ ƒ n | i d ƒ | i d t |  i ƒ ƒ d i | ƒ S(   Ns
   classes=%ss	   classes=*s
   default=%ss   , (   R   R   t   appendR   R   t   join(   R   t   s(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __str__c   s    N(
   R   R   R	   R   R   R   R   R   R   R   (    (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR
   *   s   			t
   Propertiesc           B   s¶   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 e
 d „ Z d	 „  Z d
 „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s½  
    Represents basic application properties.
    Provides basic type validation, default values and
    link/synchronization behavior.
    @ivar definitions: A table of property definitions.
    @type definitions: {name: L{Definition}}
    @ivar links: A list of linked property objects used to create
        a network of properties.
    @type links: [L{Property},..]
    @ivar defined: A dict of property values.
    @type defined: dict 
    c         C   sc   h  |  _  x | D] } | |  i  | i <q Wg  |  _ h  |  _ t ƒ  |  _ |  i ƒ  |  i | ƒ d S(   sÒ   
        @param definitions: A table of property definitions.
        @type definitions: {name: L{Definition}}
        @param kwargs: A list of property name/values to set.
        @type kwargs: dict  
        N(   t   definitionsR   t   linkst   definedt   sett   modifiedt   primet   update(   R   R!   t   kwargst   d(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   z   s    	 		
c         C   s3   |  i  i | ƒ } | d j o t | ƒ ‚ n | S(   s  
        Get the definition for the property I{name}.
        @param name: The property I{name} to find the definition for.
        @type name: str
        @return: The property definition
        @rtype: L{Definition}
        @raise AttributeError: On not found.
        N(   R!   t   getR   R   (   R   R   R)   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt
   definitionŠ   s    	c         C   sN   t  | t ƒ o | i } n x* | i ƒ  D] \ } } |  i | | ƒ q* W|  S(   sÙ   
        Update the property values as specified by keyword/value.
        @param other: An object to update from.
        @type other: (dict|L{Properties})
        @return: self
        @rtype: L{Properties}
        (   R   R    R#   t   itemsR$   (   R   t   othert   nt   v(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR'   ˜   s     c         C   s   |  i  | ƒ i | ƒ d S(   sÃ   
        Get whether a property has never been set by I{name}.
        @param name: A property name.
        @type name: str
        @return: True if never been set.
        @rtype: bool
        N(   t   findt   _Properties__notset(   R   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   notset¦   s    c         C   s   |  i  | ƒ i | | ƒ |  S(   sc  
        Set the I{value} of a property by I{name}.
        The value is validated against the definition and set
        to the default when I{value} is None.
        @param name: The property name.
        @type name: str
        @param value: The new property value.
        @type value: any
        @return: self
        @rtype: L{Properties}
        (   R0   t   _Properties__set(   R   R   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR$   °   s    c         C   s   |  i  | ƒ i | d ƒ |  S(   s    
        Unset a property by I{name}.
        @param name: A property name.
        @type name: str
        @return: self
        @rtype: L{Properties}
        N(   R0   R3   R   (   R   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   unset¿   s    c         G   s   |  i  | ƒ i | | Œ S(   s:  
        Get the value of a property by I{name}.
        @param name: The property name.
        @type name: str
        @param df: An optional value to be returned when the value
            is not set
        @type df: [1].
        @return: The stored value, or I{df[0]} if not set.
        @rtype: any 
        (   R0   t   _Properties__get(   R   R   t   df(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR*   Ê   s    c         C   sE   | |  i  j o1 |  i | | ƒ |  i  i | ƒ | i |  ƒ n |  S(   s  
        Link (associate) this object with anI{other} properties object 
        to create a network of properties.  Links are bidirectional.
        @param other: The object to link.
        @type other: L{Properties}
        @return: self
        @rtype: L{Properties}
        (   R"   t   maylinkR   t   link(   R   R-   t   replace(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR8   ×   s
    	c         G   sa   t  | ƒ p |  i } n x? | D]7 } | |  i j o! |  i i | ƒ | i |  ƒ q" q" W|  S(   sö   
        Unlink (disassociate) the specified properties object.
        @param others: The list object to unlink.  Unspecified means unlink all.
        @type others: [L{Properties},..]
        @return: self
        @rtype: L{Properties}
        (   R   R"   t   removet   unlink(   R   t   othersR-   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR;   æ   s     c         C   s   xx | i  i ƒ  D]g } |  i | |  g ƒ } | d j o q n | o$ |  i | ƒ t i d | | ƒ q t d | ‚ q Wd S(   sm  
        Verify that the I{other} object may be linked.
        Primarily ensures that non of the I{other}'s properties are
        already represented in the property network.  Each property
        name must be unique.
        @param other: The object to unlink.
        @type other: L{Properties}
        @raise Exception: On property already has owner.
        s)   owner for property (%s) replaced with:
%ss   property (%s) already has ownerN(   R!   t   keysR0   R   R;   t   logt   debugt	   Exception(   R   R-   t   cleant   kt   owner(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR7   ö   s    
 c         C   s¨   | d j o
 g  } n | i |  ƒ | |  i j o |  SxI |  i D]> } | | j o qC n | i | | ƒ } | d j	 o | SqC W| i |  ƒ t | ƒ o d S|  S(   s  
        Find the owner of the property by I{name}.
        @param name: The property name.
        @type name: str
        @param history: A history of nodes checked to prevent
            circular hunting.
        @type history: [L{Properties},..]
        @return: The owner when found.  Otherwise, None (when nested)
            and I{self} when not nested.
        @rtype: L{Properties}
        N(   R   R   R!   R"   R0   R:   R   (   R   R   t   historyt   xRC   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR0   
  s     

 	c         C   s1   x* |  i  i ƒ  D] } | i |  i | i <q W|  S(   sœ   
        Prime the stored values based on default values
        found in property definitions.
        @return: self
        @rtype: L{Properties}
        (   R!   t   valuesR   R#   R   (   R   R)   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR&   &  s     c         C   s   | |  i  j S(   N(   R%   (   R   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __notset1  s    c         C   so   |  i  | ƒ } | i | ƒ | i | ƒ } |  i | } | |  i | <|  i i | ƒ | i i |  | | ƒ d  S(   N(   R+   R   R   R#   R%   t   addR   R   (   R   R   R   R)   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __set4  s    c         G   sP   |  i  | ƒ } |  i i | ƒ } | | i j o t | ƒ o | d } n | S(   Ni    (   R+   R#   R*   R   R   (   R   R   R6   R)   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __get=  s
    c         C   sñ   g  } | i  d ƒ x. |  i i ƒ  D] } | i  d t | ƒ ƒ q# W| i  d ƒ x. |  i i ƒ  D] } | i  d t | ƒ ƒ qa W|  | j oU | i  |  ƒ | i  d ƒ x' |  i D] } | i  | i | ƒ ƒ q³ W| i |  ƒ n d i	 | ƒ S(   Ns   Definitions:s   	%ss   Content:s   Linked:s   
(
   R   R!   RF   t   reprR#   R,   R   R"   R:   R   (   R   RD   R   R)   RE   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   D  s"      
 c         C   s
   t  |  ƒ S(   N(   R   (   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   T  s    c         C   s   |  i  g  ƒ S(   N(   R   (   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   W  s    N(   R   R   R	   R   R+   R'   R2   R$   R4   R*   t   TrueR8   R;   R7   R   R0   R&   R1   R3   R5   R   R   R   (    (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR    m   s&   				
												t   Skinc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s   
    The meta-programming I{skin} around the L{Properties} object.
    @ivar __pts__: The wrapped object.
    @type __pts__: L{Properties}.
    c         C   s   t  | | ƒ |  _ d  S(   N(   R    t   __pts__(   R   R!   R(   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   a  s    c         C   sO   | i  d ƒ o | i d ƒ } | o | |  i | <d  S|  i i | | ƒ d  S(   Nt   __(   t
   startswitht   endswitht   __dict__RN   R$   (   R   R   R   t   builtin(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __setattr__d  s
    c         C   s   |  i  i | ƒ S(   N(   RN   R*   (   R   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __getattr__k  s    c         C   s
   t  |  ƒ S(   N(   R   (   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   n  s    c         C   s   t  |  i ƒ S(   N(   R   RN   (   R   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   q  s    (   R   R   R	   R   RT   RU   R   R   (    (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyRM   [  s   				t   Unskinc           B   s   e  Z d  „  Z RS(   c         O   s   | d i  S(   Ni    (   RN   (   R   t   argsR(   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   __new__v  s    (   R   R   RX   (    (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyRV   u  s   t	   Inspectorc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s   
    Wrapper inspector.
    c         C   s   | i  |  _ d  S(   N(   RN   R   (   R   t   options(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR   ~  s    c         G   s   |  i  i | | Œ S(   s:  
        Get the value of a property by I{name}.
        @param name: The property name.
        @type name: str
        @param df: An optional value to be returned when the value
            is not set
        @type df: [1].
        @return: The stored value, or I{df[0]} if not set.
        @rtype: any 
        (   R   R*   (   R   R   R6   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR*     s    c         K   s   |  i  i |   S(   sØ   
        Update the property values as specified by keyword/value.
        @param kwargs: A list of property name/values to set.
        @type kwargs: dict
        @return: self
        @rtype: L{Properties}
        (   R   R'   (   R   R(   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR'   Ž  s    c         C   s   | i  } |  i i | ƒ S(   s  
        Link (associate) this object with anI{other} properties object 
        to create a network of properties.  Links are bidirectional.
        @param other: The object to link.
        @type other: L{Properties}
        @return: self
        @rtype: L{Properties}
        (   RN   R   R8   (   R   R-   t   p(    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR8   ˜  s    		c         C   s   | i  } |  i i | ƒ S(   sË   
        Unlink (disassociate) the specified properties object.
        @param other: The object to unlink.
        @type other: L{Properties}
        @return: self
        @rtype: L{Properties}
        (   RN   R   R;   (   R   R-   R[   (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyR;   ¤  s    	(   R   R   R	   R   R*   R'   R8   R;   (    (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyRY   z  s   			
	N(    (    (    (   R	   t   loggingR    R   R>   t   objectR   R
   R    RM   RV   RY   (    (    (    sN   /usr/local/lib/python2.6/dist-packages/suds-0.3.7-py2.6.egg/suds/properties.pyt   <module>   s   Cî