1   
 2   
 3   
 4   
 5   
 6   
 7   
 8   
 9   
10   
11   
12   
13   
14   
15  """An abstract class for caching the discovery document.""" 
16   
17  import abc 
18   
19   
20 -class Cache(object): 
 21    """A base abstract cache class.""" 
22    __metaclass__ = abc.ABCMeta 
23   
24    @abc.abstractmethod 
26      """Gets the content from the memcache with a given key. 
27   
28      Args: 
29        url: string, the key for the cache. 
30   
31      Returns: 
32        object, the value in the cache for the given key, or None if the key is 
33        not in the cache. 
34      """ 
35      raise NotImplementedError() 
 36   
37    @abc.abstractmethod 
38 -  def set(self, url, content): 
 39      """Sets the given key and content in the cache. 
40   
41      Args: 
42        url: string, the key for the cache. 
43        content: string, the discovery document. 
44      """ 
45      raise NotImplementedError() 
  46