From f21095c2672ba6b3f4e540ff183eca28f8d82cdf Mon Sep 17 00:00:00 2001 From: "ade@google.com" Date: Fri, 10 Dec 2010 20:44:13 +0000 Subject: [PATCH] Force pretty-printing to always be on. This is a temporary measure to 1-aid debugging and 2-find out what impact this has on real-world usage. --- apiclient/discovery.py | 3 ++- functional_tests/test_services.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apiclient/discovery.py b/apiclient/discovery.py index 1660288..e516eeb 100644 --- a/apiclient/discovery.py +++ b/apiclient/discovery.py @@ -96,6 +96,7 @@ class JsonModel(object): def build_query(self, params): params.update({'alt': 'json'}) + params.update({'pp': '1'}) astuples = [] for key, value in params.iteritems(): if getattr(value, 'encode', False) and callable(value.encode): @@ -115,7 +116,7 @@ class JsonModel(object): body = body['data'] return body else: - logging.debug('Content from bad request was: %s' % content) + logging.error('Content from bad request was: %s' % content) if resp.get('content-type', '').startswith('application/json'): raise HttpError(resp, simplejson.loads(content)['error']) else: diff --git a/functional_tests/test_services.py b/functional_tests/test_services.py index 8a20d3f..ecb8713 100644 --- a/functional_tests/test_services.py +++ b/functional_tests/test_services.py @@ -83,7 +83,8 @@ class BuzzFunctionalTest(unittest.TestCase): buzz = build('buzz', 'v1', self.http) max_results = 1 people_cmd = buzz.people() - #https://www.googleapis.com/buzz/v1/activities/111062888259659218284/@self/B:z13nh535yk2syfob004cdjyb3mjeulcwv3c?alt=json# + # The post https://www.googleapis.com/buzz/v1/activities/111062888259659218284/@self/B:z13nh535yk2syfob004cdjyb3mjeulcwv3c?alt=json# + #Perform this call https://www.googleapis.com/buzz/v1/activities/111062888259659218284/@self/B:z13nh535yk2syfob004cdjyb3mjeulcwv3c/@liked?alt=json&max-results=1 people = people_cmd.liked(groupId='@liked', userId='googlebuzz', scope='@self', postId='B:z13nh535yk2syfob004cdjyb3mjeulcwv3c', max_results=max_results).execute()