mò
]OFc           @   s|   d  Z  d k l Z e ƒ  Z d e f d „  ƒ  YZ e ƒ  Z e i Z d e f d „  ƒ  YZ e ƒ  Z	 e	 i Z
 e e
 f Z d S(   s£   
Memoize decorator for methods whose first argument is the request.

Stores values in an annotation of the request.

This is based on ViewMemo from plone.memoize.
(   s   IAnnotationst   PTSMemoc           B   s   t  Z d Z d „  Z RS(   Ns   pts.memoizec            s   ‡ ‡  d †  } | S(   Nc             sÉ   |  d } |  d } t | ƒ } | i ˆ i t ƒ } | t j o t
 ƒ  } | ˆ i <n t | i i ˆ  i |  d t | i ƒ  ƒ f ƒ } | i | t ƒ } | t j o ˆ  |  | Ž  } | | <n | S(   Ni    i   (   t   argst   instancet   requestt   IAnnotationst   annotationst   gett   selft   keyt   _markert   cachet   dictt   hasht	   __class__t   __name__t   funct	   frozensett   kwargst   itemst   value(   R   R   R
   R   R   R   R   R   (   R   R   (    tR   /home2/kennisonb/webapps/zope/Zope/Products/PlacelessTranslationService/memoize.pyt
   memogetter   s    

1(   R   (   R   R   R   (    (   R   R   R   t   memoize   s    (   R   t
   __module__R   R   (    (    (    R   R       s   t   NegotiatorMemoc           B   s   t  Z d Z d „  Z RS(   Ns   pts.memoize_secondc            s   ‡ ‡  d †  } | S(   Nc             s°   |  d } |  d } t | ƒ } | i ˆ i t ƒ } | t j o t
 ƒ  } | ˆ i <n t | i i ˆ  i f ƒ } | i | t ƒ } | t j o ˆ  |  Œ  } | | <n | S(   Ni    i   (   R   R   R   R   R   R   R   R   R	   R
   R   R   R   R   R   R   (   R   R
   R   R   R   R   R   (   R   R   (    R   R   +   s    

(   R   (   R   R   R   (    (   R   R   R   R   *   s    (   R   R   R   R   (    (    (    R   R   &   s   N(   t   __doc__t   zope.annotation.interfacesR   t   objectR	   R    t   _mR   R   t   _nt   memoize_secondt   __all__(	   R	   R   R   R   R   R   R   R   R    (    (    R   t   ?   s   					