ó
‚¾^Yc           @   sƒ   d  Z  d d l Z d d l m Z d d l m Z d d l m Z e j e	 ƒ Z
 d Z d	 e j f d
 „  ƒ  YZ e d e ƒ Z d S(   s;   App Engine memcache based cache for the discovery document.iÿÿÿÿN(   t   memcachei   (   t   basei   (   t   DISCOVERY_DOC_MAX_AGEs   google-api-clientt   Cachec           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s%   A cache with app engine memcache API.c         C   s   | |  _  d S(   sN   Constructor.

      Args:
        max_age: Cache expiration in seconds.
      N(   t   _max_age(   t   selft   max_age(    (    sd   /tmp/pip-build-kpPAdC/google-api-python-client/googleapiclient/discovery_cache/appengine_memcache.pyt   __init__#   s    c         C   sD   y t  j | d t ƒSWn& t k
 r? } t j | d t ƒn Xd  S(   Nt	   namespacet   exc_info(   R    t   gett	   NAMESPACEt	   Exceptiont   LOGGERt   warningt   True(   R   t   urlt   e(    (    sd   /tmp/pip-build-kpPAdC/google-api-python-client/googleapiclient/discovery_cache/appengine_memcache.pyR
   +   s    c         C   sV   y) t  j | | d t |  j ƒ d t ƒWn& t k
 rQ } t j | d t ƒn Xd  S(   Nt   timeR   R	   (	   R    t   sett   intR   R   R   R   R   R   (   R   R   t   contentR   (    (    sd   /tmp/pip-build-kpPAdC/google-api-python-client/googleapiclient/discovery_cache/appengine_memcache.pyR   1   s    )(   t   __name__t
   __module__t   __doc__R   R
   R   (    (    (    sd   /tmp/pip-build-kpPAdC/google-api-python-client/googleapiclient/discovery_cache/appengine_memcache.pyR       s   		R   (   R   t   loggingt   google.appengine.apiR    t    R   t   discovery_cacheR   t	   getLoggerR   R   R   R   t   cache(    (    (    sd   /tmp/pip-build-kpPAdC/google-api-python-client/googleapiclient/discovery_cache/appengine_memcache.pyt   <module>   s   