Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 1 | |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 3 | <html><head><title>Python: module oauth2client.appengine</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>.appengine</strong></big></big></font></td |
| 10 | ><td align=right valign=bottom |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 11 | ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiclient/oauth2client/appengine.py">/usr/local/google/home/jcgregorio/projects/apiclient/oauth2client/appengine.py</a></font></td></tr></table> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 12 | <p><tt>Utilities for Google App Engine<br> |
| 13 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 14 | Utilities for making it easier to use OAuth 2.0 on Google App Engine.</tt></p> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 15 | <p> |
| 16 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 17 | <tr bgcolor="#aa55cc"> |
| 18 | <td colspan=3 valign=bottom> <br> |
| 19 | <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| 20 | |
| 21 | <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| 22 | <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="google.appengine.ext.db.html">google.appengine.ext.db</a><br> |
| 23 | </td><td width="25%" valign=top><a href="pickle.html">pickle</a><br> |
| 24 | </td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p> |
| 25 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 26 | <tr bgcolor="#ee77aa"> |
| 27 | <td colspan=3 valign=bottom> <br> |
| 28 | <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| 29 | |
| 30 | <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| 31 | <td width="100%"><dl> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 32 | <dt><font face="helvetica, arial"><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>(<a href="__builtin__.html#object">__builtin__.object</a>) |
| 33 | </font></dt><dd> |
| 34 | <dl> |
| 35 | <dt><font face="helvetica, arial"><a href="oauth2client.appengine.html#CredentialsProperty">CredentialsProperty</a> |
| 36 | </font></dt><dt><font face="helvetica, arial"><a href="oauth2client.appengine.html#FlowProperty">FlowProperty</a> |
| 37 | </font></dt></dl> |
| 38 | </dd> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 39 | <dt><font face="helvetica, arial"><a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a>(<a href="__builtin__.html#object">__builtin__.object</a>) |
| 40 | </font></dt><dd> |
| 41 | <dl> |
| 42 | <dt><font face="helvetica, arial"><a href="oauth2client.appengine.html#StorageByKeyName">StorageByKeyName</a> |
| 43 | </font></dt></dl> |
| 44 | </dd> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 45 | </dl> |
| 46 | <p> |
| 47 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 48 | <tr bgcolor="#ffc8d8"> |
| 49 | <td colspan=3 valign=bottom> <br> |
| 50 | <font color="#000000" face="helvetica, arial"><a name="CredentialsProperty">class <strong>CredentialsProperty</strong></a>(<a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>)</font></td></tr> |
| 51 | |
| 52 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 53 | <td colspan=2><tt>App Engine datastore <a href="google.appengine.ext.db.html#Property">Property</a> for Credentials.<br> |
| 54 | <br> |
| 55 | Utility property that allows easy storage and retrieval of<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 56 | oath2client.Credentials<br> </tt></td></tr> |
| 57 | <tr><td> </td> |
| 58 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 59 | <dd><a href="oauth2client.appengine.html#CredentialsProperty">CredentialsProperty</a></dd> |
| 60 | <dd><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a></dd> |
| 61 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 62 | </dl> |
| 63 | <hr> |
| 64 | Methods defined here:<br> |
| 65 | <dl><dt><a name="CredentialsProperty-empty"><strong>empty</strong></a>(self, value)</dt></dl> |
| 66 | |
| 67 | <dl><dt><a name="CredentialsProperty-get_value_for_datastore"><strong>get_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt># For writing to datastore.</tt></dd></dl> |
| 68 | |
| 69 | <dl><dt><a name="CredentialsProperty-make_value_from_datastore"><strong>make_value_from_datastore</strong></a>(self, value)</dt><dd><tt># For reading from datastore.</tt></dd></dl> |
| 70 | |
| 71 | <dl><dt><a name="CredentialsProperty-validate"><strong>validate</strong></a>(self, value)</dt></dl> |
| 72 | |
| 73 | <hr> |
| 74 | Data and other attributes defined here:<br> |
| 75 | <dl><dt><strong>data_type</strong> = <class 'oauth2client.client.Credentials'><dd><tt>Base class for all Credentials objects.<br> |
| 76 | <br> |
| 77 | Subclasses must define an authorize() method<br> |
| 78 | that applies the credentials to an HTTP transport.</tt></dl> |
| 79 | |
| 80 | <hr> |
| 81 | Methods inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 82 | <dl><dt><a name="CredentialsProperty-__get__"><strong>__get__</strong></a>(self, model_instance, model_class)</dt><dd><tt>Returns the value for this property on the given model instance.<br> |
| 83 | <br> |
| 84 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 85 | the arguments to this class and what they mean.</tt></dd></dl> |
| 86 | |
| 87 | <dl><dt><a name="CredentialsProperty-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, default<font color="#909090">=None</font>, required<font color="#909090">=False</font>, validator<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, indexed<font color="#909090">=True</font>)</dt><dd><tt>Initializes this <a href="google.appengine.ext.db.html#Property">Property</a> with the given options.<br> |
| 88 | <br> |
| 89 | Args:<br> |
| 90 | verbose_name: User friendly name of property.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 91 | name: <a href="oauth2client.client.html#Storage">Storage</a> name for property. By default, uses attribute name<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 92 | as it is assigned in the Model sub-class.<br> |
| 93 | default: Default value for property if none is assigned.<br> |
| 94 | required: Whether property is required.<br> |
| 95 | validator: User provided method used for validation.<br> |
| 96 | choices: User provided set of valid property values.<br> |
| 97 | indexed: Whether property is indexed.</tt></dd></dl> |
| 98 | |
| 99 | <dl><dt><a name="CredentialsProperty-__property_config__"><strong>__property_config__</strong></a>(self, model_class, property_name)</dt><dd><tt>Configure property, connecting it to its model.<br> |
| 100 | <br> |
| 101 | Configure the property so that it knows its property name and what class<br> |
| 102 | it belongs to.<br> |
| 103 | <br> |
| 104 | Args:<br> |
| 105 | model_class: Model class which <a href="google.appengine.ext.db.html#Property">Property</a> will belong to.<br> |
| 106 | property_name: Name of property within Model instance to store property<br> |
| 107 | values in. By default this will be the property name preceded by<br> |
| 108 | an underscore, but may change for different subclasses.</tt></dd></dl> |
| 109 | |
| 110 | <dl><dt><a name="CredentialsProperty-__set__"><strong>__set__</strong></a>(self, model_instance, value)</dt><dd><tt>Sets the value for this property on the given model instance.<br> |
| 111 | <br> |
| 112 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 113 | the arguments to this class and what they mean.</tt></dd></dl> |
| 114 | |
| 115 | <dl><dt><a name="CredentialsProperty-datastore_type"><strong>datastore_type</strong></a>(self)</dt><dd><tt>Deprecated backwards-compatible accessor method for self.<strong>data_type</strong>.</tt></dd></dl> |
| 116 | |
| 117 | <dl><dt><a name="CredentialsProperty-default_value"><strong>default_value</strong></a>(self)</dt><dd><tt>Default value for unassigned values.<br> |
| 118 | <br> |
| 119 | Returns:<br> |
| 120 | Default value as provided by <a href="#CredentialsProperty-__init__">__init__</a>(default).</tt></dd></dl> |
| 121 | |
| 122 | <hr> |
| 123 | Data descriptors inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 124 | <dl><dt><strong>__dict__</strong></dt> |
| 125 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 126 | </dl> |
| 127 | <dl><dt><strong>__weakref__</strong></dt> |
| 128 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 129 | </dl> |
| 130 | <hr> |
| 131 | Data and other attributes inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 132 | <dl><dt><strong>creation_counter</strong> = 0</dl> |
| 133 | |
| 134 | </td></tr></table> <p> |
| 135 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 136 | <tr bgcolor="#ffc8d8"> |
| 137 | <td colspan=3 valign=bottom> <br> |
| 138 | <font color="#000000" face="helvetica, arial"><a name="FlowProperty">class <strong>FlowProperty</strong></a>(<a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>)</font></td></tr> |
| 139 | |
| 140 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 141 | <td colspan=2><tt>App Engine datastore <a href="google.appengine.ext.db.html#Property">Property</a> for Flow.<br> |
| 142 | <br> |
| 143 | Utility property that allows easy storage and retreival of an<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 144 | oauth2client.Flow<br> </tt></td></tr> |
| 145 | <tr><td> </td> |
| 146 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 147 | <dd><a href="oauth2client.appengine.html#FlowProperty">FlowProperty</a></dd> |
| 148 | <dd><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a></dd> |
| 149 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 150 | </dl> |
| 151 | <hr> |
| 152 | Methods defined here:<br> |
| 153 | <dl><dt><a name="FlowProperty-empty"><strong>empty</strong></a>(self, value)</dt></dl> |
| 154 | |
| 155 | <dl><dt><a name="FlowProperty-get_value_for_datastore"><strong>get_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt># For writing to datastore.</tt></dd></dl> |
| 156 | |
| 157 | <dl><dt><a name="FlowProperty-make_value_from_datastore"><strong>make_value_from_datastore</strong></a>(self, value)</dt><dd><tt># For reading from datastore.</tt></dd></dl> |
| 158 | |
| 159 | <dl><dt><a name="FlowProperty-validate"><strong>validate</strong></a>(self, value)</dt></dl> |
| 160 | |
| 161 | <hr> |
| 162 | Data and other attributes defined here:<br> |
| 163 | <dl><dt><strong>data_type</strong> = <class 'oauth2client.client.Flow'><dd><tt>Base class for all Flow objects.</tt></dl> |
| 164 | |
| 165 | <hr> |
| 166 | Methods inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 167 | <dl><dt><a name="FlowProperty-__get__"><strong>__get__</strong></a>(self, model_instance, model_class)</dt><dd><tt>Returns the value for this property on the given model instance.<br> |
| 168 | <br> |
| 169 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 170 | the arguments to this class and what they mean.</tt></dd></dl> |
| 171 | |
| 172 | <dl><dt><a name="FlowProperty-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, default<font color="#909090">=None</font>, required<font color="#909090">=False</font>, validator<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, indexed<font color="#909090">=True</font>)</dt><dd><tt>Initializes this <a href="google.appengine.ext.db.html#Property">Property</a> with the given options.<br> |
| 173 | <br> |
| 174 | Args:<br> |
| 175 | verbose_name: User friendly name of property.<br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 176 | name: <a href="oauth2client.client.html#Storage">Storage</a> name for property. By default, uses attribute name<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 177 | as it is assigned in the Model sub-class.<br> |
| 178 | default: Default value for property if none is assigned.<br> |
| 179 | required: Whether property is required.<br> |
| 180 | validator: User provided method used for validation.<br> |
| 181 | choices: User provided set of valid property values.<br> |
| 182 | indexed: Whether property is indexed.</tt></dd></dl> |
| 183 | |
| 184 | <dl><dt><a name="FlowProperty-__property_config__"><strong>__property_config__</strong></a>(self, model_class, property_name)</dt><dd><tt>Configure property, connecting it to its model.<br> |
| 185 | <br> |
| 186 | Configure the property so that it knows its property name and what class<br> |
| 187 | it belongs to.<br> |
| 188 | <br> |
| 189 | Args:<br> |
| 190 | model_class: Model class which <a href="google.appengine.ext.db.html#Property">Property</a> will belong to.<br> |
| 191 | property_name: Name of property within Model instance to store property<br> |
| 192 | values in. By default this will be the property name preceded by<br> |
| 193 | an underscore, but may change for different subclasses.</tt></dd></dl> |
| 194 | |
| 195 | <dl><dt><a name="FlowProperty-__set__"><strong>__set__</strong></a>(self, model_instance, value)</dt><dd><tt>Sets the value for this property on the given model instance.<br> |
| 196 | <br> |
| 197 | See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br> |
| 198 | the arguments to this class and what they mean.</tt></dd></dl> |
| 199 | |
| 200 | <dl><dt><a name="FlowProperty-datastore_type"><strong>datastore_type</strong></a>(self)</dt><dd><tt>Deprecated backwards-compatible accessor method for self.<strong>data_type</strong>.</tt></dd></dl> |
| 201 | |
| 202 | <dl><dt><a name="FlowProperty-default_value"><strong>default_value</strong></a>(self)</dt><dd><tt>Default value for unassigned values.<br> |
| 203 | <br> |
| 204 | Returns:<br> |
| 205 | Default value as provided by <a href="#FlowProperty-__init__">__init__</a>(default).</tt></dd></dl> |
| 206 | |
| 207 | <hr> |
| 208 | Data descriptors inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 209 | <dl><dt><strong>__dict__</strong></dt> |
| 210 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 211 | </dl> |
| 212 | <dl><dt><strong>__weakref__</strong></dt> |
| 213 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 214 | </dl> |
| 215 | <hr> |
| 216 | Data and other attributes inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br> |
| 217 | <dl><dt><strong>creation_counter</strong> = 0</dl> |
| 218 | |
| 219 | </td></tr></table> <p> |
| 220 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 221 | <tr bgcolor="#ffc8d8"> |
| 222 | <td colspan=3 valign=bottom> <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 223 | <font color="#000000" face="helvetica, arial"><a name="StorageByKeyName">class <strong>StorageByKeyName</strong></a>(<a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a>)</font></td></tr> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 224 | |
| 225 | <tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> |
| 226 | <td colspan=2><tt>Store and retrieve a single credential to and from<br> |
| 227 | the App Engine datastore.<br> |
| 228 | <br> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 229 | This <a href="oauth2client.client.html#Storage">Storage</a> helper presumes the Credentials<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 230 | have been stored as a CredenialsProperty<br> |
| 231 | on a datastore model class, and that entities<br> |
| 232 | are stored by key_name.<br> </tt></td></tr> |
| 233 | <tr><td> </td> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 234 | <td width="100%"><dl><dt>Method resolution order:</dt> |
| 235 | <dd><a href="oauth2client.appengine.html#StorageByKeyName">StorageByKeyName</a></dd> |
| 236 | <dd><a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a></dd> |
| 237 | <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| 238 | </dl> |
| 239 | <hr> |
| 240 | Methods defined here:<br> |
| 241 | <dl><dt><a name="StorageByKeyName-__init__"><strong>__init__</strong></a>(self, model, key_name, property_name)</dt><dd><tt>Constructor for <a href="oauth2client.client.html#Storage">Storage</a>.<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 242 | <br> |
| 243 | Args:<br> |
| 244 | model: db.Model, model class<br> |
| 245 | key_name: string, key name for the entity that has the credentials<br> |
| 246 | property_name: string, name of the property that is an <a href="#CredentialsProperty">CredentialsProperty</a></tt></dd></dl> |
| 247 | |
| 248 | <dl><dt><a name="StorageByKeyName-get"><strong>get</strong></a>(self)</dt><dd><tt>Retrieve Credential from datastore.<br> |
| 249 | <br> |
| 250 | Returns:<br> |
| 251 | oauth2client.Credentials</tt></dd></dl> |
| 252 | |
| 253 | <dl><dt><a name="StorageByKeyName-put"><strong>put</strong></a>(self, credentials)</dt><dd><tt>Write a Credentials to the datastore.<br> |
| 254 | <br> |
| 255 | Args:<br> |
| 256 | credentials: Credentials, the credentials to store.</tt></dd></dl> |
| 257 | |
| 258 | <hr> |
Joe Gregorio | 3b79fa8 | 2011-02-17 11:47:17 -0500 | [diff] [blame^] | 259 | Data descriptors inherited from <a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a>:<br> |
Joe Gregorio | 6e53703 | 2011-02-09 23:04:26 -0500 | [diff] [blame] | 260 | <dl><dt><strong>__dict__</strong></dt> |
| 261 | <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| 262 | </dl> |
| 263 | <dl><dt><strong>__weakref__</strong></dt> |
| 264 | <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| 265 | </dl> |
| 266 | </td></tr></table></td></tr></table><p> |
| 267 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 268 | <tr bgcolor="#55aa55"> |
| 269 | <td colspan=3 valign=bottom> <br> |
| 270 | <font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> |
| 271 | |
| 272 | <tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> |
| 273 | <td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p> |
| 274 | <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| 275 | <tr bgcolor="#7799ee"> |
| 276 | <td colspan=3 valign=bottom> <br> |
| 277 | <font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr> |
| 278 | |
| 279 | <tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td> |
| 280 | <td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table> |
| 281 | </body></html> |