ó
TR¹Nc           @   sÉ   d  Z  d d l m Z d d l m Z d d l m Z d d l m Z d d l	 m
 Z
 i d d 6d d 6d	 d
 6d d 6d d 6Z d „  Z d „  Z e e j ƒ Z e e d ƒ rÅ e j j e j ƒ n  d S(   s£  
Caching framework.

This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
may be pickled -- identified by string keys.  For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.

Client code should not access a cache backend directly; instead it should
either use the "cache" variable made available here, or it should use the
get_cache() function made available here. get_cache() takes a backend URI
(e.g. "memcached://127.0.0.1:11211/") and returns an instance of a backend
cache class.

See docs/cache.txt for information on the public API.
iÿÿÿÿ(   t	   parse_qsl(   t   settings(   t   signals(   t   InvalidCacheBackendError(   t	   importlibt	   memcachedt   locmemt	   filebasedt   filet   dbt   dummyc         C   sØ   |  j  d ƒ d k r$ t d ƒ ‚ n  |  j d d ƒ \ } } | j d ƒ sZ t d ƒ ‚ n  | d } | j  d ƒ } | d k r© t t | | d ƒ ƒ } | d | !} n i  } | j d ƒ rË | d  } n  | | | f S(	   sÁ   
    Converts the "backend_uri" into a cache scheme ('db', 'memcached', etc), a
    host and any extra params that are required for the backend. Returns a
    (scheme, host, params) tuple.
    t   :iÿÿÿÿs%   Backend URI must start with scheme://i   s   //i   t   ?t   /(   t   findR   t   splitt
   startswitht   dictR    t   endswith(   t   backend_urit   schemet   restt   hostt   qpost   params(    (    sG   /home/panlixing/Python_Projects/gaeseries/django/core/cache/__init__.pyt   parse_backend_uri#   s    
c         C   s]   t  |  ƒ \ } } } | t k r2 d t | } n | } t j | ƒ } t | d ƒ | | ƒ S(   Ns   django.core.cache.backends.%st
   CacheClass(   R   t   BACKENDSR   t   import_modulet   getattr(   R   R   R   R   t   namet   module(    (    sG   /home/panlixing/Python_Projects/gaeseries/django/core/cache/__init__.pyt	   get_cache;   s    t   closeN(   t   __doc__t   cgiR    t   django.confR   t   django.coreR   t   django.core.cache.backends.baseR   t   django.utilsR   R   R   R    t   CACHE_BACKENDt   cachet   hasattrt   request_finishedt   connectR!   (    (    (    sG   /home/panlixing/Python_Projects/gaeseries/django/core/cache/__init__.pyt   <module>   s    
			