Cleaned up OAuth 2.0 support fully using Storage() and updating samples.
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index fa796ed..22cb4e0 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -84,9 +84,11 @@
parameters {api} and {apiVersion} that when filled in
produce an absolute URI to the discovery document for
that service.
- developerKey: string, key obtained from https://code.google.com/apis/console
+ developerKey: string, key obtained
+ from https://code.google.com/apis/console
model: apiclient.Model, converts to and from the wire format
- requestBuilder: apiclient.http.HttpRequest, encapsulator for an HTTP request
+ requestBuilder: apiclient.http.HttpRequest, encapsulator for
+ an HTTP request
Returns:
A Resource object with methods for interacting with
diff --git a/apiclient/http.py b/apiclient/http.py
index e9fd7e0..8f64baf 100644
--- a/apiclient/http.py
+++ b/apiclient/http.py
@@ -22,7 +22,10 @@
"""Encapsulates a single HTTP request.
"""
- def __init__(self, http, postproc, uri, method="GET", body=None, headers=None,
+ def __init__(self, http, postproc, uri,
+ method="GET",
+ body=None,
+ headers=None,
methodId=None):
"""Constructor for an HttpRequest.
@@ -150,6 +153,7 @@
model = JsonModel()
return HttpRequestMock(None, '{}', model.response)
+
class HttpMock(object):
"""Mock of httplib2.Http"""
@@ -164,5 +168,10 @@
f.close()
self.headers = headers
- def request(self, uri, method="GET", body=None, headers=None, redirections=1, connection_type=None):
+ def request(self, uri,
+ method="GET",
+ body=None,
+ headers=None,
+ redirections=1,
+ connection_type=None):
return httplib2.Response(self.headers), self.data
diff --git a/apiclient/model.py b/apiclient/model.py
index 1f2e1c1..68da13e 100644
--- a/apiclient/model.py
+++ b/apiclient/model.py
@@ -18,6 +18,7 @@
from anyjson import simplejson
from errors import HttpError
+
def _abstract():
raise NotImplementedError('You need to override this function')