Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: module oauth2client.multistore_file</title> |
| 4 | </head><body bgcolor="#f0f0f8"> |
| 5 | |
| 6 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| 7 | <tr bgcolor="#7799ee"> |
| 8 | <td valign=bottom> <br> |
| 9 | <font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="oauth2client.html"><font color="#ffffff">oauth2client</font></a>.multistore_file</strong></big></big></font></td |
| 10 | ><td align=right valign=bottom |
Joe Gregorio | d02bf5e | 2012-03-02 13:21:32 -0800 | [diff] [blame^] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/google-api-python-client/oauth2client/multistore_file.py">/home/jcgregorio/projects/google-api-python-client/oauth2client/multistore_file.py</a></font></td></tr></table> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 12 | <p><tt>Multi-credential file store with lock support.<br> |
| 13 | <br> |
| 14 | This module implements a JSON credential store where multiple<br> |
| 15 | credentials can be stored in one file. That file supports locking<br> |
| 16 | both in a single process and across processes.<br> |
| 17 | <br> |
| 18 | The credential themselves are keyed off of:<br> |
| 19 | * client_id<br> |
| 20 | * user_agent<br> |
| 21 | * scope<br> |
| 22 | <br> |
| 23 | The format of the stored data is like so:<br> |
| 24 | {<br> |
| 25 | 'file_version': 1,<br> |
| 26 | 'data': [<br> |
| 27 | {<br> |
| 28 | 'key': {<br> |
| 29 | 'clientId': '<client id>',<br> |
| 30 | 'userAgent': '<user agent>',<br> |
| 31 | 'scope': '<scope>'<br> |
| 32 | },<br> |
| 33 | 'credential': {<br> |
| 34 | # JSON serialized Credentials.<br> |
| 35 | }<br> |
| 36 | }<br> |
| 37 | ]<br> |
| 38 | }</tt></p> |
| 39 | <p> |
| 40 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 41 | <tr bgcolor="#aa55cc"> |
| 42 | <td colspan=3 valign=bottom> <br> |
| 43 | <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| 44 | |
| 45 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| 46 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="base64.html">base64</a><br> |
Joe Gregorio | 3d55ac5 | 2012-02-21 10:11:19 -0500 | [diff] [blame] | 47 | <a href="errno.html">errno</a><br> |
| 48 | </td><td width="25%" valign=top><a href="fcntl.html">fcntl</a><br> |
| 49 | <a href="logging.html">logging</a><br> |
| 50 | </td><td width="25%" valign=top><a href="os.html">os</a><br> |
| 51 | <a href="json.html">json</a><br> |
| 52 | </td><td width="25%" valign=top><a href="threading.html">threading</a><br> |
| 53 | </td></tr></table></td></tr></table><p> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 54 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 55 | <tr bgcolor="#ee77aa"> |
| 56 | <td colspan=3 valign=bottom> <br> |
| 57 | <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| 58 | |
| 59 | <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| 60 | <td width="100%"><dl> |
| 61 | <dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>) |
| 62 | </font></dt><dd> |
| 63 | <dl> |
| 64 | <dt><font face="helvetica, arial"><a href="oauth2client.multistore_file.html#Error">Error</a> |
| 65 | </font></dt><dd> |
| 66 | <dl> |
| 67 | <dt><font face="helvetica, arial"><a href="oauth2client.multistore_file.html#NewerCredentialStoreError">NewerCredentialStoreError</a> |
| 68 | </font></dt></dl> |
| 69 | </dd> |
| 70 | </dl> |
| 71 | </dd> |
| 72 | </dl> |
| 73 | <p> |
| 74 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 75 | <tr bgcolor="#ffc8d8"> |
| 76 | <td colspan=3 valign=bottom> <br> |
| 77 | <font color="#000000" face="helvetica, arial"><a name="Error">class <strong>Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr> |
| 78 | |
| 79 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 80 | <td colspan=2><tt>Base error for this module.<br> </tt></td></tr> |
| 81 | <tr><td> </td> |
| 82 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 83 | <dd><a href="oauth2client.multistore_file.html#Error">Error</a></dd> |
| 84 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 85 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 86 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 87 | </dl> |
| 88 | <hr> |
| 89 | Data descriptors defined here:<br> |
| 90 | <dl><dt><strong>__weakref__</strong></dt> |
| 91 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 92 | </dl> |
| 93 | <hr> |
| 94 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 95 | <dl><dt><a name="Error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 96 | |
| 97 | <hr> |
| 98 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 99 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#Error-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> |
| 100 | |
| 101 | <hr> |
| 102 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 103 | <dl><dt><a name="Error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 104 | |
| 105 | <dl><dt><a name="Error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 106 | |
| 107 | <dl><dt><a name="Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 108 | |
| 109 | <dl><dt><a name="Error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 110 | <br> |
| 111 | Use of negative indices is not supported.</tt></dd></dl> |
| 112 | |
| 113 | <dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 114 | |
| 115 | <dl><dt><a name="Error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 116 | |
| 117 | <dl><dt><a name="Error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 118 | |
| 119 | <dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 120 | |
| 121 | <dl><dt><a name="Error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 122 | |
| 123 | <dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 124 | |
| 125 | <hr> |
| 126 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 127 | <dl><dt><strong>__dict__</strong></dt> |
| 128 | </dl> |
| 129 | <dl><dt><strong>args</strong></dt> |
| 130 | </dl> |
| 131 | <dl><dt><strong>message</strong></dt> |
| 132 | </dl> |
| 133 | </td></tr></table> <p> |
| 134 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 135 | <tr bgcolor="#ffc8d8"> |
| 136 | <td colspan=3 valign=bottom> <br> |
| 137 | <font color="#000000" face="helvetica, arial"><a name="NewerCredentialStoreError">class <strong>NewerCredentialStoreError</strong></a>(<a href="oauth2client.multistore_file.html#Error">Error</a>)</font></td></tr> |
| 138 | |
| 139 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 140 | <td colspan=2><tt>The credential store is a newer version that supported.<br> </tt></td></tr> |
| 141 | <tr><td> </td> |
| 142 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 143 | <dd><a href="oauth2client.multistore_file.html#NewerCredentialStoreError">NewerCredentialStoreError</a></dd> |
| 144 | <dd><a href="oauth2client.multistore_file.html#Error">Error</a></dd> |
| 145 | <dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd> |
| 146 | <dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd> |
| 147 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 148 | </dl> |
| 149 | <hr> |
| 150 | Data descriptors inherited from <a href="oauth2client.multistore_file.html#Error">Error</a>:<br> |
| 151 | <dl><dt><strong>__weakref__</strong></dt> |
| 152 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 153 | </dl> |
| 154 | <hr> |
| 155 | Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 156 | <dl><dt><a name="NewerCredentialStoreError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 157 | |
| 158 | <hr> |
| 159 | Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br> |
| 160 | <dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#NewerCredentialStoreError-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl> |
| 161 | |
| 162 | <hr> |
| 163 | Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 164 | <dl><dt><a name="NewerCredentialStoreError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl> |
| 165 | |
| 166 | <dl><dt><a name="NewerCredentialStoreError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl> |
| 167 | |
| 168 | <dl><dt><a name="NewerCredentialStoreError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl> |
| 169 | |
| 170 | <dl><dt><a name="NewerCredentialStoreError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br> |
| 171 | <br> |
| 172 | Use of negative indices is not supported.</tt></dd></dl> |
| 173 | |
| 174 | <dl><dt><a name="NewerCredentialStoreError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl> |
| 175 | |
| 176 | <dl><dt><a name="NewerCredentialStoreError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl> |
| 177 | |
| 178 | <dl><dt><a name="NewerCredentialStoreError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl> |
| 179 | |
| 180 | <dl><dt><a name="NewerCredentialStoreError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl> |
| 181 | |
| 182 | <dl><dt><a name="NewerCredentialStoreError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#NewerCredentialStoreError-__str__">__str__</a>() <==> str(x)</tt></dd></dl> |
| 183 | |
| 184 | <dl><dt><a name="NewerCredentialStoreError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl> |
| 185 | |
| 186 | <hr> |
| 187 | Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br> |
| 188 | <dl><dt><strong>__dict__</strong></dt> |
| 189 | </dl> |
| 190 | <dl><dt><strong>args</strong></dt> |
| 191 | </dl> |
| 192 | <dl><dt><strong>message</strong></dt> |
| 193 | </dl> |
| 194 | </td></tr></table></td></tr></table><p> |
| 195 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 196 | <tr bgcolor="#eeaa77"> |
| 197 | <td colspan=3 valign=bottom> <br> |
| 198 | <font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr> |
| 199 | |
| 200 | <tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td> |
| 201 | <td width="100%"><dl><dt><a name="-get_credential_storage"><strong>get_credential_storage</strong></a>(filename, client_id, user_agent, scope, warn_on_readonly<font color="#909090">=True</font>)</dt><dd><tt>Get a Storage instance for a credential.<br> |
| 202 | <br> |
| 203 | Args:<br> |
| 204 | filename: The JSON file storing a set of credentials<br> |
| 205 | client_id: The client_id for the credential<br> |
| 206 | user_agent: The user agent for the credential<br> |
Joe Gregorio | 761c456 | 2011-10-28 14:36:24 -0400 | [diff] [blame] | 207 | scope: string or list of strings, Scope(s) being requested<br> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 208 | warn_on_readonly: if True, log a warning if the store is readonly<br> |
| 209 | <br> |
| 210 | Returns:<br> |
| 211 | An object derived from client.Storage for getting/setting the<br> |
| 212 | credential.</tt></dd></dl> |
| 213 | </td></tr></table><p> |
| 214 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 215 | <tr bgcolor="#55aa55"> |
| 216 | <td colspan=3 valign=bottom> <br> |
| 217 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 218 | |
| 219 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
| 220 | <td width="100%"><strong>__author__</strong> = 'jbeda@google.com (Joe Beda)'<br> |
Joe Gregorio | b417caf | 2011-12-08 12:04:24 -0500 | [diff] [blame] | 221 | <strong>logger</strong> = <logging.Logger instance></td></tr></table><p> |
Joe Gregorio | a845167 | 2011-09-15 09:53:21 -0400 | [diff] [blame] | 222 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 223 | <tr bgcolor="#7799ee"> |
| 224 | <td colspan=3 valign=bottom> <br> |
| 225 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 226 | |
| 227 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 228 | <td width="100%">jbeda@google.com (Joe Beda)</td></tr></table> |
| 229 | </body></html> |