• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="ascii"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3          "DTD/xhtml1-transitional.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5<head>
6  <title>googleapiclient.discovery_cache.file_cache.Cache</title>
7  <link rel="stylesheet" href="epydoc.css" type="text/css" />
8  <script type="text/javascript" src="epydoc.js"></script>
9</head>
10
11<body bgcolor="white" text="black" link="blue" vlink="#204080"
12      alink="#204080">
13<!-- ==================== NAVIGATION BAR ==================== -->
14<table class="navbar" border="0" width="100%" cellpadding="0"
15       bgcolor="#a0c0ff" cellspacing="0">
16  <tr valign="middle">
17  <!-- Home link -->
18      <th>&nbsp;&nbsp;&nbsp;<a
19        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
20
21  <!-- Tree link -->
22      <th>&nbsp;&nbsp;&nbsp;<a
23        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
24
25  <!-- Index link -->
26      <th>&nbsp;&nbsp;&nbsp;<a
27        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
28
29  <!-- Help link -->
30      <th>&nbsp;&nbsp;&nbsp;<a
31        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
32
33      <th class="navbar" width="100%"></th>
34  </tr>
35</table>
36<table width="100%" cellpadding="0" cellspacing="0">
37  <tr valign="top">
38    <td width="100%">
39      <span class="breadcrumbs">
40        <a href="googleapiclient-module.html">Package&nbsp;googleapiclient</a> ::
41        <a href="googleapiclient.discovery_cache-module.html">Package&nbsp;discovery_cache</a> ::
42        <a href="googleapiclient.discovery_cache.file_cache-module.html">Module&nbsp;file_cache</a> ::
43        Class&nbsp;Cache
44      </span>
45    </td>
46    <td>
47      <table cellpadding="0" cellspacing="0">
48        <!-- hide/show private -->
49        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
50    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
51        <tr><td align="right"><span class="options"
52            >[<a href="frames.html" target="_top">frames</a
53            >]&nbsp;|&nbsp;<a href="googleapiclient.discovery_cache.file_cache.Cache-class.html"
54            target="_top">no&nbsp;frames</a>]</span></td></tr>
55      </table>
56    </td>
57  </tr>
58</table>
59<!-- ==================== CLASS DESCRIPTION ==================== -->
60<h1 class="epydoc">Class Cache</h1><p class="nomargin-top"><span class="codelink"><a href="googleapiclient.discovery_cache.file_cache-pysrc.html#Cache">source&nbsp;code</a></span></p>
61<center>
62<center>  <map id="uml_class_diagram_for_googleap_9" name="uml_class_diagram_for_googleap_9">
63<area shape="rect" id="node1_4" href="googleapiclient.discovery_cache.file_cache.Cache-class.html#__init__" title="Constructor." alt="" coords="17,115,159,135"/>
64<area shape="rect" id="node1_5" href="googleapiclient.discovery_cache.file_cache.Cache-class.html#get" title="Gets the content from the memcache with a given key." alt="" coords="17,135,159,155"/>
65<area shape="rect" id="node1_6" href="googleapiclient.discovery_cache.file_cache.Cache-class.html#set" title="Sets the given key and content in the cache." alt="" coords="17,155,159,175"/>
66<area shape="rect" id="node1" href="googleapiclient.discovery_cache.file_cache.Cache-class.html" title="A file based cache for the discovery documents." alt="" coords="5,83,171,181"/>
67<area shape="rect" id="node2_7" href="googleapiclient.discovery_cache.base.Cache-class.html#__metaclass__" title="googleapiclient.discovery_cache.base.Cache.__metaclass__" alt="" coords="40,29,135,49"/>
68<area shape="rect" id="node2" href="googleapiclient.discovery_cache.base.Cache-class.html" title="A base abstract cache class." alt="" coords="27,5,146,64"/>
69</map>
70  <img src="uml_class_diagram_for_googleap_9.gif" alt='' usemap="#uml_class_diagram_for_googleap_9" ismap="ismap" class="graph-without-title" />
71</center>
72</center>
73<hr />
74<pre class="literalblock">
75A file based cache for the discovery documents.
76
77</pre>
78
79<!-- ==================== INSTANCE METHODS ==================== -->
80<a name="section-InstanceMethods"></a>
81<table class="summary" border="1" cellpadding="3"
82       cellspacing="0" width="100%" bgcolor="white">
83<tr bgcolor="#70b0f0" class="table-header">
84  <td colspan="2" class="table-header">
85    <table border="0" cellpadding="0" cellspacing="0" width="100%">
86      <tr valign="top">
87        <td align="left"><span class="table-header">Instance Methods</span></td>
88        <td align="right" valign="top"
89         ><span class="options">[<a href="#section-InstanceMethods"
90         class="privatelink" onclick="toggle_private();"
91         >hide private</a>]</span></td>
92      </tr>
93    </table>
94  </td>
95</tr>
96<tr>
97    <td width="15%" align="right" valign="top" class="summary">
98      <span class="summary-type">&nbsp;</span>
99    </td><td class="summary">
100      <table width="100%" cellpadding="0" cellspacing="0" border="0">
101        <tr>
102          <td><span class="summary-sig"><a href="googleapiclient.discovery_cache.file_cache.Cache-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
103        <span class="summary-sig-arg">max_age</span>)</span><br />
104      Constructor.</td>
105          <td align="right" valign="top">
106            <span class="codelink"><a href="googleapiclient.discovery_cache.file_cache-pysrc.html#Cache.__init__">source&nbsp;code</a></span>
107
108          </td>
109        </tr>
110      </table>
111
112    </td>
113  </tr>
114<tr>
115    <td width="15%" align="right" valign="top" class="summary">
116      <span class="summary-type">&nbsp;</span>
117    </td><td class="summary">
118      <table width="100%" cellpadding="0" cellspacing="0" border="0">
119        <tr>
120          <td><span class="summary-sig"><a href="googleapiclient.discovery_cache.file_cache.Cache-class.html#get" class="summary-sig-name">get</a>(<span class="summary-sig-arg">self</span>,
121        <span class="summary-sig-arg">url</span>)</span><br />
122      Gets the content from the memcache with a given key.</td>
123          <td align="right" valign="top">
124            <span class="codelink"><a href="googleapiclient.discovery_cache.file_cache-pysrc.html#Cache.get">source&nbsp;code</a></span>
125
126          </td>
127        </tr>
128      </table>
129
130    </td>
131  </tr>
132<tr>
133    <td width="15%" align="right" valign="top" class="summary">
134      <span class="summary-type">&nbsp;</span>
135    </td><td class="summary">
136      <table width="100%" cellpadding="0" cellspacing="0" border="0">
137        <tr>
138          <td><span class="summary-sig"><a href="googleapiclient.discovery_cache.file_cache.Cache-class.html#set" class="summary-sig-name">set</a>(<span class="summary-sig-arg">self</span>,
139        <span class="summary-sig-arg">url</span>,
140        <span class="summary-sig-arg">content</span>)</span><br />
141      Sets the given key and content in the cache.</td>
142          <td align="right" valign="top">
143            <span class="codelink"><a href="googleapiclient.discovery_cache.file_cache-pysrc.html#Cache.set">source&nbsp;code</a></span>
144
145          </td>
146        </tr>
147      </table>
148
149    </td>
150  </tr>
151  <tr>
152    <td colspan="2" class="summary">
153    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
154      <code>__delattr__</code>,
155      <code>__format__</code>,
156      <code>__getattribute__</code>,
157      <code>__hash__</code>,
158      <code>__new__</code>,
159      <code>__reduce__</code>,
160      <code>__reduce_ex__</code>,
161      <code>__repr__</code>,
162      <code>__setattr__</code>,
163      <code>__sizeof__</code>,
164      <code>__str__</code>,
165      <code>__subclasshook__</code>
166      </p>
167    </td>
168  </tr>
169</table>
170<!-- ==================== CLASS VARIABLES ==================== -->
171<a name="section-ClassVariables"></a>
172<table class="summary" border="1" cellpadding="3"
173       cellspacing="0" width="100%" bgcolor="white">
174<tr bgcolor="#70b0f0" class="table-header">
175  <td colspan="2" class="table-header">
176    <table border="0" cellpadding="0" cellspacing="0" width="100%">
177      <tr valign="top">
178        <td align="left"><span class="table-header">Class Variables</span></td>
179        <td align="right" valign="top"
180         ><span class="options">[<a href="#section-ClassVariables"
181         class="privatelink" onclick="toggle_private();"
182         >hide private</a>]</span></td>
183      </tr>
184    </table>
185  </td>
186</tr>
187  <tr>
188    <td colspan="2" class="summary">
189    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="googleapiclient.discovery_cache.base.Cache-class.html">base.Cache</a></code></b>:
190      <code><a href="googleapiclient.discovery_cache.base.Cache-class.html#__metaclass__">__metaclass__</a></code>
191      </p>
192    </td>
193  </tr>
194</table>
195<!-- ==================== PROPERTIES ==================== -->
196<a name="section-Properties"></a>
197<table class="summary" border="1" cellpadding="3"
198       cellspacing="0" width="100%" bgcolor="white">
199<tr bgcolor="#70b0f0" class="table-header">
200  <td colspan="2" class="table-header">
201    <table border="0" cellpadding="0" cellspacing="0" width="100%">
202      <tr valign="top">
203        <td align="left"><span class="table-header">Properties</span></td>
204        <td align="right" valign="top"
205         ><span class="options">[<a href="#section-Properties"
206         class="privatelink" onclick="toggle_private();"
207         >hide private</a>]</span></td>
208      </tr>
209    </table>
210  </td>
211</tr>
212  <tr>
213    <td colspan="2" class="summary">
214    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
215      <code>__class__</code>
216      </p>
217    </td>
218  </tr>
219</table>
220<!-- ==================== METHOD DETAILS ==================== -->
221<a name="section-MethodDetails"></a>
222<table class="details" border="1" cellpadding="3"
223       cellspacing="0" width="100%" bgcolor="white">
224<tr bgcolor="#70b0f0" class="table-header">
225  <td colspan="2" class="table-header">
226    <table border="0" cellpadding="0" cellspacing="0" width="100%">
227      <tr valign="top">
228        <td align="left"><span class="table-header">Method Details</span></td>
229        <td align="right" valign="top"
230         ><span class="options">[<a href="#section-MethodDetails"
231         class="privatelink" onclick="toggle_private();"
232         >hide private</a>]</span></td>
233      </tr>
234    </table>
235  </td>
236</tr>
237</table>
238<a name="__init__"></a>
239<div>
240<table class="details" border="1" cellpadding="3"
241       cellspacing="0" width="100%" bgcolor="white">
242<tr><td>
243  <table width="100%" cellpadding="0" cellspacing="0" border="0">
244  <tr valign="top"><td>
245  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
246        <span class="sig-arg">max_age</span>)</span>
247    <br /><em class="fname">(Constructor)</em>
248  </h3>
249  </td><td align="right" valign="top"
250    ><span class="codelink"><a href="googleapiclient.discovery_cache.file_cache-pysrc.html#Cache.__init__">source&nbsp;code</a></span>&nbsp;
251    </td>
252  </tr></table>
253
254  <pre class="literalblock">
255Constructor.
256
257Args:
258  max_age: Cache expiration in seconds.
259
260</pre>
261  <dl class="fields">
262    <dt>Overrides:
263        object.__init__
264    </dt>
265  </dl>
266</td></tr></table>
267</div>
268<a name="get"></a>
269<div>
270<table class="details" border="1" cellpadding="3"
271       cellspacing="0" width="100%" bgcolor="white">
272<tr><td>
273  <table width="100%" cellpadding="0" cellspacing="0" border="0">
274  <tr valign="top"><td>
275  <h3 class="epydoc"><span class="sig"><span class="sig-name">get</span>(<span class="sig-arg">self</span>,
276        <span class="sig-arg">url</span>)</span>
277  </h3>
278  </td><td align="right" valign="top"
279    ><span class="codelink"><a href="googleapiclient.discovery_cache.file_cache-pysrc.html#Cache.get">source&nbsp;code</a></span>&nbsp;
280    </td>
281  </tr></table>
282
283  <pre class="literalblock">
284Gets the content from the memcache with a given key.
285
286Args:
287  url: string, the key for the cache.
288
289Returns:
290  object, the value in the cache for the given key, or None if the key is
291  not in the cache.
292
293</pre>
294  <dl class="fields">
295    <dt>Overrides:
296        <a href="googleapiclient.discovery_cache.base.Cache-class.html#get">base.Cache.get</a>
297        <dd><em class="note">(inherited documentation)</em></dd>
298    </dt>
299  </dl>
300</td></tr></table>
301</div>
302<a name="set"></a>
303<div>
304<table class="details" border="1" cellpadding="3"
305       cellspacing="0" width="100%" bgcolor="white">
306<tr><td>
307  <table width="100%" cellpadding="0" cellspacing="0" border="0">
308  <tr valign="top"><td>
309  <h3 class="epydoc"><span class="sig"><span class="sig-name">set</span>(<span class="sig-arg">self</span>,
310        <span class="sig-arg">url</span>,
311        <span class="sig-arg">content</span>)</span>
312  </h3>
313  </td><td align="right" valign="top"
314    ><span class="codelink"><a href="googleapiclient.discovery_cache.file_cache-pysrc.html#Cache.set">source&nbsp;code</a></span>&nbsp;
315    </td>
316  </tr></table>
317
318  <pre class="literalblock">
319Sets the given key and content in the cache.
320
321Args:
322  url: string, the key for the cache.
323  content: string, the discovery document.
324
325</pre>
326  <dl class="fields">
327    <dt>Overrides:
328        <a href="googleapiclient.discovery_cache.base.Cache-class.html#set">base.Cache.set</a>
329        <dd><em class="note">(inherited documentation)</em></dd>
330    </dt>
331  </dl>
332</td></tr></table>
333</div>
334<br />
335<!-- ==================== NAVIGATION BAR ==================== -->
336<table class="navbar" border="0" width="100%" cellpadding="0"
337       bgcolor="#a0c0ff" cellspacing="0">
338  <tr valign="middle">
339  <!-- Home link -->
340      <th>&nbsp;&nbsp;&nbsp;<a
341        href="googleapiclient-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
342
343  <!-- Tree link -->
344      <th>&nbsp;&nbsp;&nbsp;<a
345        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
346
347  <!-- Index link -->
348      <th>&nbsp;&nbsp;&nbsp;<a
349        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>
350
351  <!-- Help link -->
352      <th>&nbsp;&nbsp;&nbsp;<a
353        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
354
355      <th class="navbar" width="100%"></th>
356  </tr>
357</table>
358<table border="0" cellpadding="0" cellspacing="0" width="100%%">
359  <tr>
360    <td align="left" class="footer">
361    Generated by Epydoc 3.0.1 on Fri Jun 14 15:57:27 2019
362    </td>
363    <td align="right" class="footer">
364      <a target="mainFrame" href="http://epydoc.sourceforge.net"
365        >http://epydoc.sourceforge.net</a>
366    </td>
367  </tr>
368</table>
369
370<script type="text/javascript">
371  <!--
372  // Private objects are initially displayed (because if
373  // javascript is turned off then we want them to be
374  // visible); but by default, we want to hide them.  So hide
375  // them unless we have a cookie that says to show them.
376  checkCookie();
377  // -->
378</script>
379</body>
380</html>
381