ó
ú2ec           @   s0   d  e  f d „  ƒ  YZ d e  f d „  ƒ  YZ d S(   t   classinstancemethodc           B   s#   e  Z d  Z d „  Z d d „ Z RS(   s÷   
    Acts like a class method when called from a class, like an
    instance method when called by an instance.  The method should
    take two arguments, 'self' and 'cls'; one of these will be None
    depending on how the method was called.
    c         C   s   | |  _  | j |  _ d  S(   N(   t   funct   __doc__(   t   selfR   (    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyt   __init__   s    	c         C   s   t  |  j d | d | ƒS(   Nt   objt   type(   t   _methodwrapperR   (   R   R   R   (    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyt   __get__   s    N(   t   __name__t
   __module__R   R   t   NoneR   (    (    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyR       s   	R   c           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   s   | |  _  | |  _ | |  _ d  S(   N(   R   R   R   (   R   R   R   R   (    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyR      s    		c         O   sD   d | k r d | k s$ t  d ƒ ‚ |  j |  j |  j f | | Ž  S(   NR   t   clssA   You cannot use 'self' or 'cls' arguments to a classinstancemethod(   t   AssertionErrorR   R   R   (   R   t   argst   kw(    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyt   __call__   s    	c         C   sM   |  j  d  k r) d |  j j |  j j f Sd |  j j |  j j |  j  f Sd  S(   Ns   <bound class method %s.%s>s   <bound method %s.%s of %r>(   R   R   R   R	   R   t	   func_name(   R   (    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyt   __repr__    s
    (   R	   R
   R   R   R   (    (    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyR      s   		N(   t   objectR    R   (    (    (    sB   /usr/local/lib/python2.7/dist-packages/paste/util/classinstance.pyt   <module>   s   