Stage 1 conversion to JSON for storing Credentials.
Reviewed in http://codereview.appspot.com/4972065/
diff --git a/apiclient/discovery.py b/apiclient/discovery.py
index 5f3c267..2a924a2 100644
--- a/apiclient/discovery.py
+++ b/apiclient/discovery.py
@@ -59,11 +59,12 @@
STACK_QUERY_PARAMETERS = ['trace', 'fields', 'pp', 'prettyPrint', 'userIp',
'userip', 'strict']
-RESERVED_WORDS = [ 'and', 'assert', 'break', 'class', 'continue', 'def', 'del',
+RESERVED_WORDS = ['and', 'assert', 'break', 'class', 'continue', 'def', 'del',
'elif', 'else', 'except', 'exec', 'finally', 'for', 'from',
'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or',
'pass', 'print', 'raise', 'return', 'try', 'while' ]
+
def _fix_method_name(name):
if name in RESERVED_WORDS:
return name + '_'
@@ -242,10 +243,10 @@
return str(value)
MULTIPLIERS = {
- "KB": 2**10,
- "MB": 2**20,
- "GB": 2**30,
- "TB": 2**40,
+ "KB": 2 ** 10,
+ "MB": 2 ** 20,
+ "GB": 2 ** 30,
+ "TB": 2 ** 40,
}
def _media_size_to_long(maxSize):
@@ -255,7 +256,7 @@
units = maxSize[-2:].upper()
multiplier = MULTIPLIERS.get(units, 0)
if multiplier:
- return int(maxSize[:-2])*multiplier
+ return int(maxSize[:-2]) * multiplier
else:
return int(maxSize)
diff --git a/apiclient/model.py b/apiclient/model.py
index 7f51d29..b8271f9 100644
--- a/apiclient/model.py
+++ b/apiclient/model.py
@@ -222,7 +222,8 @@
_abstract()
def deserialize(self, content):
- """Perform the actual deserialization from response string to Python object.
+ """Perform the actual deserialization from response string to Python
+ object.
Args:
content: string, the body of the HTTP response
@@ -285,8 +286,8 @@
de-serialized using the given protocol buffer class.
Args:
- protocol_buffer: The protocol buffer class used to de-serialize a response
- from the API.
+ protocol_buffer: The protocol buffer class used to de-serialize a
+ response from the API.
"""
self._protocol_buffer = protocol_buffer
diff --git a/apiclient/oauth.py b/apiclient/oauth.py
index 18877b0..11eb680 100644
--- a/apiclient/oauth.py
+++ b/apiclient/oauth.py
@@ -377,7 +377,6 @@
return http
-
class FlowThreeLegged(Flow):
"""Does the Three Legged Dance for OAuth 1.0a.
"""