ó
ú2ec           @   s#   d  e  f d „  ƒ  YZ d „  Z d S(   t   ClassInitMetac           B   s   e  Z d  „  Z RS(   c         C   s   t  j |  | | | ƒ } | j d ƒ rY t | j t ƒ rY t | d t | j j ƒ ƒ n  t | d ƒ r{ | j | | ƒ n  | S(   Nt   __classinit__(	   t   typet   __new__t   has_keyt
   isinstanceR   t   staticmethodt   setattrt   im_funct   hasattr(   t   metat
   class_namet   basest	   new_attrst   cls(    (    s>   /usr/local/lib/python2.7/dist-packages/paste/util/classinit.pyR      s    	(   t   __name__t
   __module__R   (    (    (    s>   /usr/local/lib/python2.7/dist-packages/paste/util/classinit.pyR       s   c         C   s7  x0| j  ƒ  D]"\ } } | j d ƒ sF | j d ƒ sF | j d ƒ r | d  } t |  | ƒ rÐ t |  | ƒ } t | t ƒ sŸ t d | t | ƒ | f ƒ ‚ n  i | j d 6| j	 d 6| j
 d 6| j d	 6} n i  } | | d
 | d <| j d ƒ r| j r| j | d	 <n  t |   } t |  | | ƒ q q Wd S(   sÁ   
    Given a class and a new set of attributes (as passed in by
    __classinit__), create or modify properties based on functions
    with special names ending in __get, __set, and __del.
    t   __gett   __sett   __deliûÿÿÿsJ   Attribute %s is a %s, not a property; function %s is named like a propertyt   fgett   fsett   fdelt   doct   fiýÿÿÿN(   t   itemst   endswithR	   t   getattrR   t   propertyt
   ValueErrorR   R   R   R   t   __doc__R   (   R   R   t   namet   valuet   baset   old_propt   attrst   new_prop(    (    s>   /usr/local/lib/python2.7/dist-packages/paste/util/classinit.pyt   build_properties   s(    


N(   R   R    R%   (    (    (    s>   /usr/local/lib/python2.7/dist-packages/paste/util/classinit.pyt   <module>   s   