| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """This module is used to set up Remote API to use services on App Engine. | 5 """This module is used to set up Remote API to use services on App Engine. |
| 6 | 6 |
| 7 After setup, available services include datastore, task queue, etc. | 7 After setup, available services include datastore, task queue, etc. |
| 8 You may be prompted for credentials during the remote query or the like. | 8 You may be prompted for credentials during the remote query or the like. |
| 9 And you could use Remote API only when you are one of the project members. | 9 And you could use Remote API only when you are one of the project members. |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 def EnableRemoteApi(app_id='findit-for-me'): | 49 def EnableRemoteApi(app_id='findit-for-me'): |
| 50 """Enable appengine services through remote API. | 50 """Enable appengine services through remote API. |
| 51 | 51 |
| 52 Args: | 52 Args: |
| 53 app_id (str): The appengine ID without '.appspot.com', eg. findit-for-me. | 53 app_id (str): The appengine ID without '.appspot.com', eg. findit-for-me. |
| 54 """ | 54 """ |
| 55 if hasattr(EnableRemoteApi, app_id): | 55 if hasattr(EnableRemoteApi, app_id): |
| 56 return | 56 return |
| 57 | 57 |
| 58 SetTimeoutForUrlOperations() | |
| 59 | |
| 60 remote_api_stub.ConfigureRemoteApiForOAuth( | 58 remote_api_stub.ConfigureRemoteApiForOAuth( |
| 61 '%s.appspot.com' % app_id, | 59 '%s.appspot.com' % app_id, |
| 62 '/_ah/remote_api', | 60 '/_ah/remote_api', |
| 63 secure=True, | 61 secure=True, |
| 64 save_cookies=True) | 62 save_cookies=True) |
| 65 setattr(EnableRemoteApi, app_id, True) | 63 setattr(EnableRemoteApi, app_id, True) |
| OLD | NEW |