root/software/session2/trunk/epydoc-html/session2.store.MySQLSessionStore.MySQLSessionStore-class.html

Revision 9, 15.9 kB (checked in by t, 12 years ago)

transferred from

svn://cafepy.com:13690/

Line 
1 <?xml version="1.0" encoding="iso-8859-1"?>
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>session2.store.MySQLSessionStore.MySQLSessionStore</title>
7   <link rel="stylesheet" href="epydoc.css" type="text/css"></link>
8 </head>
9 <body bgcolor="white" text="black" link="blue" vlink="#204080"
10       alink="#204080">
11
12 <!-- =========== START OF NAVBAR =========== -->
13 <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
14   <tr valign="center">
15     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="session2-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
16     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
17     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
18     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
19     <th class="navbar" align="right" width="100%">
20       <table border="0" cellpadding="0" cellspacing="0">
21       <tr><th class="navbar" align="center">
22         <p class="nomargin">
23           session2
24       </p></th></tr></table>
25     </th>
26   </tr>
27 </table>
28 <table width="100%" cellpadding="0" cellspacing="0">
29   <tr valign="top">
30     <td width="100%">
31       <font size="-1"><b class="breadcrumbs">
32         <a href="session2-module.html">Package&nbsp;session2</a> ::
33         <a href="session2.store-module.html">Package&nbsp;store</a> ::
34         <a href="session2.store.MySQLSessionStore-module.html">Module&nbsp;MySQLSessionStore</a> ::
35         Class&nbsp;MySQLSessionStore
36       </b></font></br>
37     </td>
38     <td><table cellpadding="0" cellspacing="0">
39       <tr><td align="right"><font size="-2">[<a href="frames.html"target="_top">frames</a>&nbsp;|&nbsp;<a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html" target="_top">no&nbsp;frames</a>]</font></td></tr>
40     </table></td>
41 </tr></table>
42
43 <!-- =========== START OF CLASS DESCRIPTION =========== -->
44 <h2 class="class">Class MySQLSessionStore</h2>
45
46 <pre class="base-tree">
47 <a href="session2.store.SessionStore.SessionStore-class.html"><code>SessionStore</code></a> --+
48                |
49               <b>MySQLSessionStore</b>
50 </pre><br />
51
52 <hr/>
53
54
55 <!-- =========== START OF METHOD SUMMARY =========== -->
56 <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
57 <tr bgcolor="#70b0f0" class="summary">
58   <th colspan="2">Method Summary</th></tr>
59 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
60   <td><code><span class="summary-sig"><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#__init__" class="summary-sig-name"><code>__init__</code></a>(<span class=summary-sig-arg>self</span>,
61           <span class=summary-sig-arg>conn</span>,
62           <span class=summary-sig-arg>table</span>)</span></code>
63 <br />
64 __init__ takes a MySQLdb connection object, together with an
65 optional 'table' argument containing the name of the table to use.</td></tr>
66 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
67   <td><code><span class="summary-sig"><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#delete_old_sessions" class="summary-sig-name"><code>delete_old_sessions</code></a>(<span class=summary-sig-arg>self</span>,
68           <span class=summary-sig-arg>minutes</span>)</span></code>
69 <br />
70 Delete all sessions that have not been modified for N minutes.</td></tr>
71 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
72   <td><code><span class="summary-sig"><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#delete_session" class="summary-sig-name"><code>delete_session</code></a>(<span class=summary-sig-arg>self</span>,
73           <span class=summary-sig-arg>session</span>)</span></code>
74 <br />
75 Delete the session in the store.</td></tr>
76 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
77   <td><code><span class="summary-sig"><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#iter_sessions" class="summary-sig-name"><code>iter_sessions</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
78 <br />
79 Return an iterable of (id, session) for all sessions in the store.</td></tr>
80 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
81   <td><code><span class="summary-sig"><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#load_session" class="summary-sig-name"><code>load_session</code></a>(<span class=summary-sig-arg>self</span>,
82           <span class=summary-sig-arg>id</span>,
83           <span class=summary-sig-arg>default</span>)</span></code>
84 <br />
85 Return the session if it exists, else return 'default'.</td></tr>
86 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
87   <td><code><span class="summary-sig"><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#save_session" class="summary-sig-name"><code>save_session</code></a>(<span class=summary-sig-arg>self</span>,
88           <span class=summary-sig-arg>session</span>)</span></code>
89 <br />
90 Save the session in the store.</td></tr>
91 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
92   <td><code><span class="summary-sig"><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#setup" class="summary-sig-name"><code>setup</code></a>(<span class=summary-sig-arg>self</span>)</span></code>
93 <br />
94 Initialize the session store; e.g., create required database tables.</td></tr>
95 <tr bgcolor="#e8f0f8" class="group">
96   <th colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;Inherited from SessionStore</th></tr>
97 <tr><td align="right" valign="top" width="15%"><font size="-1">&nbsp;</font></td>
98   <td><code><span class="summary-sig"><a href="session2.store.SessionStore.SessionStore-class.html#has_session" class="summary-sig-name"><code>has_session</code></a>(<span class=summary-sig-arg>self</span>,
99           <span class=summary-sig-arg>id</span>)</span></code>
100 <br />
101 Return true if the session exists in the store, else false.</td></tr>
102 </table><br />
103
104
105 <!-- =========== START OF CLASS VARIABLE SUMMARY =========== -->
106 <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
107 <tr bgcolor="#70b0f0" class="summary">
108   <th colspan="2">Class Variable Summary</th></tr>
109 <tr><td align="right" valign="top" width="15%"><font size="-1"><code>bool</code></font></td>
110 <td><b><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#is_multiprocess_safe"><code>is_multiprocess_safe</code></a></b> = <span title="True"><code>True                              </code>
111 </span></td></tr>
112 <tr><td align="right" valign="top" width="15%"><font size="-1"><code>bool</code></font></td>
113 <td><b><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#is_thread_safe"><code>is_thread_safe</code></a></b> = <span title="False"><code>False                                   </code>
114 </span></td></tr>
115 <tr><td align="right" valign="top" width="15%"><font size="-1"><code>int</code></font></td>
116 <td><b><a href="session2.store.MySQLSessionStore.MySQLSessionStore-class.html#pickle_protocol"><code>pickle_protocol</code></a></b> = <span title="2">2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td></tr>
117 </table><br />
118
119
120 <!-- =========== START OF METHOD DETAILS =========== -->
121 <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
122 <tr bgcolor="#70b0f0" class="details">
123   <th colspan="2">Method Details</th></tr>
124 </table>
125
126 <a name="__init__"></a>
127 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
128   <h3><span class="sig"><span class="sig-name">__init__</span>(<span class=sig-arg>self</span>,
129           <span class=sig-arg>conn</span>,
130           <span class=sig-arg>table</span>=<span class=sig-default>None</span>)</span>
131     <br /><i>(Constructor)</i>
132   </h3>
133 <p>__init__ takes a MySQLdb connection object, together with an
134 optional 'table' argument containing the name of the table to use.</p>
135   <dl><dt></dt><dd>
136   </dd></dl>
137 </td></tr></table>
138
139 <a name="delete_old_sessions"></a>
140 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
141   <h3><span class="sig"><span class="sig-name">delete_old_sessions</span>(<span class=sig-arg>self</span>,
142           <span class=sig-arg>minutes</span>)</span>
143   </h3>
144 <p>Delete all sessions that have not been modified for N minutes.  The
145 default implementation does nothing, meaning the store cannot delete
146 old sessions.</p>
147 <p>This method is never called by the session manager.  It's for your
148 application maintenance program; e.g., a daily cron job.</p>
149   <dl><dt></dt><dd>
150     <dl><dt><b>Overrides:</b></dt>
151       <dd><a href="session2.store.SessionStore.SessionStore-class.html#delete_old_sessions"><code>session2.store.SessionStore.SessionStore.delete_old_sessions</code></a> <i>(inherited documentation)</i>
152 </dd>
153     </dl>
154   </dd></dl>
155 </td></tr></table>
156
157 <a name="delete_session"></a>
158 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
159   <h3><span class="sig"><span class="sig-name">delete_session</span>(<span class=sig-arg>self</span>,
160           <span class=sig-arg>session</span>)</span>
161   </h3>
162 <p>Delete the session in the store.</p>
163   <dl><dt></dt><dd>
164     <dl><dt><b>Overrides:</b></dt>
165       <dd><a href="session2.store.SessionStore.SessionStore-class.html#delete_session"><code>session2.store.SessionStore.SessionStore.delete_session</code></a> <i>(inherited documentation)</i>
166 </dd>
167     </dl>
168   </dd></dl>
169 </td></tr></table>
170
171 <a name="iter_sessions"></a>
172 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
173   <h3><span class="sig"><span class="sig-name">iter_sessions</span>(<span class=sig-arg>self</span>)</span>
174   </h3>
175 <p>Return an iterable of (id, session) for all sessions in the store.</p>
176 <p>This method is never called by the session manager; it's for admin
177 applications that want to browse the sessions.</p>
178   <dl><dt></dt><dd>
179     <dl><dt><b>Overrides:</b></dt>
180       <dd><a href="session2.store.SessionStore.SessionStore-class.html#iter_sessions"><code>session2.store.SessionStore.SessionStore.iter_sessions</code></a> <i>(inherited documentation)</i>
181 </dd>
182     </dl>
183   </dd></dl>
184 </td></tr></table>
185
186 <a name="load_session"></a>
187 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
188   <h3><span class="sig"><span class="sig-name">load_session</span>(<span class=sig-arg>self</span>,
189           <span class=sig-arg>id</span>,
190           <span class=sig-arg>default</span>=<span class=sig-default>None</span>)</span>
191   </h3>
192 <p>Return the session if it exists, else return 'default'.</p>
193   <dl><dt></dt><dd>
194     <dl><dt><b>Overrides:</b></dt>
195       <dd><a href="session2.store.SessionStore.SessionStore-class.html#load_session"><code>session2.store.SessionStore.SessionStore.load_session</code></a> <i>(inherited documentation)</i>
196 </dd>
197     </dl>
198   </dd></dl>
199 </td></tr></table>
200
201 <a name="save_session"></a>
202 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
203   <h3><span class="sig"><span class="sig-name">save_session</span>(<span class=sig-arg>self</span>,
204           <span class=sig-arg>session</span>)</span>
205   </h3>
206 <p>Save the session in the store.</p>
207   <dl><dt></dt><dd>
208     <dl><dt><b>Overrides:</b></dt>
209       <dd><a href="session2.store.SessionStore.SessionStore-class.html#save_session"><code>session2.store.SessionStore.SessionStore.save_session</code></a> <i>(inherited documentation)</i>
210 </dd>
211     </dl>
212   </dd></dl>
213 </td></tr></table>
214
215 <a name="setup"></a>
216 <table width="100%" class="func-details" bgcolor="#e0e0e0"><tr><td>
217   <h3><span class="sig"><span class="sig-name">setup</span>(<span class=sig-arg>self</span>)</span>
218   </h3>
219 <p>Initialize the session store; e.g., create required database tables.
220 If a previous store exists, overwrite it or raise an error.  The
221 default implmenetation does nothing, meaning no setup is necessary.</p>
222 <p>This method is never called by the session manager; it's for your
223 application setup program.</p>
224   <dl><dt></dt><dd>
225     <dl><dt><b>Overrides:</b></dt>
226       <dd><a href="session2.store.SessionStore.SessionStore-class.html#setup"><code>session2.store.SessionStore.SessionStore.setup</code></a> <i>(inherited documentation)</i>
227 </dd>
228     </dl>
229   </dd></dl>
230 </td></tr></table>
231 <br />
232
233
234 <!-- =========== START OF CLASS VARIABLE DETAILS =========== -->
235 <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white">
236 <tr bgcolor="#70b0f0" class="details">
237   <th colspan="2">Class Variable Details</th></tr>
238 </table>
239 <table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
240 <a name="is_multiprocess_safe"></a>
241 <h3>is_multiprocess_safe</h3>
242 <dl>
243   <dt></dt>
244   <dd>
245     <dl>
246       <dt><b>Type:</b></dt>
247       <dd>
248           <code>bool</code>
249
250       </dd>
251 <span title="True">      <dt><b>Value:</b></dt>
252       <dd><table><tr><td>
253 <pre class="variable">
254 True                                                                   </pre>
255         </td></tr></table></dd>
256 </span>    </dl>
257   </dd>
258 </dl></td></tr></table>
259 <table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
260 <a name="is_thread_safe"></a>
261 <h3>is_thread_safe</h3>
262 <dl>
263   <dt></dt>
264   <dd>
265     <dl>
266       <dt><b>Type:</b></dt>
267       <dd>
268           <code>bool</code>
269
270       </dd>
271 <span title="False">      <dt><b>Value:</b></dt>
272       <dd><table><tr><td>
273 <pre class="variable">
274 False                                                                  </pre>
275         </td></tr></table></dd>
276 </span>    </dl>
277   </dd>
278 </dl></td></tr></table>
279 <table width="100%" class="var-details" bgcolor="#e0e0e0"><tr><td>
280 <a name="pickle_protocol"></a>
281 <h3>pickle_protocol</h3>
282 <dl>
283   <dt></dt>
284   <dd>
285     <dl>
286       <dt><b>Type:</b></dt>
287       <dd>
288           <code>int</code>
289
290       </dd>
291 <span title="2">      <dt><b>Value:</b></dt>
292       <dd><table><tr><td>
293 <pre class="variable">
294 2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</pre>
295         </td></tr></table></dd>
296 </span>    </dl>
297   </dd>
298 </dl></td></tr></table>
299 <br />
300
301
302 <!-- =========== START OF NAVBAR =========== -->
303 <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0">
304   <tr valign="center">
305     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="session2-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>
306     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="trees.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>
307     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="indices.html">Index</a>&nbsp;&nbsp;&nbsp;</th>
308     <th class="navbar">&nbsp;&nbsp;&nbsp;<a class="navbar" href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>
309     <th class="navbar" align="right" width="100%">
310       <table border="0" cellpadding="0" cellspacing="0">
311       <tr><th class="navbar" align="center">
312         <p class="nomargin">
313           session2
314       </p></th></tr></table>
315     </th>
316   </tr>
317 </table>
318
319 <table border="0" cellpadding="0" cellspacing="0" width="100%">
320   <tr>
321     <td align="left"><font size="-2">Generated by Epydoc 2.1 on Sat Feb  4 16:40:10 2006</font></td>
322     <td align="right"><a href="http://epydoc.sourceforge.net"
323                       ><font size="-2">http://epydoc.sf.net</font></a></td>
324   </tr>
325 </table>
326 </body>
327 </html>
Note: See TracBrowser for help on using the browser.