http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py File samples/analytics/hello_analytics_api_v3.py (right): http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py#newcode164 samples/analytics/hello_analytics_api_v3.py:164: if results.get('rows'): if 'rows' in results: or combine these ...
12 years, 8 months ago
(2012-03-06 15:01:59 UTC)
#2
fixed them. On Tue, Mar 6, 2012 at 7:01 AM, <jcgregorio@google.com> wrote: > > http://codereview.appspot.com/**5494058/diff/10001/samples/** ...
12 years, 8 months ago
(2012-03-06 19:05:44 UTC)
#3
fixed them.
On Tue, Mar 6, 2012 at 7:01 AM, <jcgregorio@google.com> wrote:
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/hello_analytics_api_**v3.py<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py>
> File samples/analytics/hello_**analytics_api_v3.py (right):
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/hello_analytics_api_**v3.py#newcode164<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py#newcode164>
> samples/analytics/hello_**analytics_api_v3.py:164: if results.get('rows'):
> if 'rows' in results:
>
> or combine these two lines into:
>
> for row in results.get('rows', []):
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/management_v3_**reference.py<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/management_v3_reference.py>
> File samples/analytics/management_**v3_reference.py (right):
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/management_v3_**reference.py#newcode49<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/management_v3_reference.py#newcode49>
> samples/analytics/management_**v3_reference.py:49: $ python analytics.py
> name is wrong
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/management_v3_**reference.py#newcode174<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/management_v3_reference.py#newcode174>
> samples/analytics/management_**v3_reference.py:174: for webproperty in
> webproperties_response.get('**items'):
> .get('items', []):
>
> would be safer because then the loop would just be skipped if 'items' is
> missing, as opposed to raising a TypeError, which is what would happen
> now.
>
> Here and throughout.
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/management_v3_**reference.py#newcode175<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/management_v3_reference.py#newcode175>
> samples/analytics/management_**v3_reference.py:175: print 'Kind
> = %s' % webproperty.get('kind')
> Have you considered string templates instead of the huge raft of prints?
>
>
http://docs.python.org/**library/string.html#template-**strings<http://docs.p...
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/management_v3_**reference.py#newcode309<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/management_v3_reference.py#newcode309>
> samples/analytics/management_**v3_reference.py:309: for goal_step in
> goal_details.get('steps'):
> for goal_step in goal_details.get('steps', []):
>
> and you can drop the if.
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/sample_utils.py<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/sample_utils.py>
> File samples/analytics/sample_**utils.py (right):
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/sample_utils.py#**newcode90<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/sample_utils.py#newcode90>
> samples/analytics/sample_**utils.py:90: """Uses the command-line flags to
> set the logging level."""
> document parameter
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/sample_utils.py#**newcode103<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/sample_utils.py#newcode103>
> samples/analytics/sample_**utils.py:103: def prepare_credentials():
> Seems gratuitous to break out prepare_credentials and retrieve_service
> as separate functions given how little they do and that only
> initialize_service is called from outside this file. Either collapse
> into initialize_service or mark them as private and document their
> parameters.
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/sample_utils.py#**newcode124<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/sample_utils.py#newcode124>
> samples/analytics/sample_**utils.py:124: """Builds instance of service
> from discovery data and does auth."""
> document return value
>
>
http://codereview.appspot.com/**5494058/<http://codereview.appspot.com/5494058/>
>
all done. On Tue, Mar 6, 2012 at 2:33 PM, <jsoneja@google.com> wrote: > > http://codereview.appspot.com/**5494058/diff/10001/samples/** ...
12 years, 8 months ago
(2012-03-07 23:33:02 UTC)
#5
all done.
On Tue, Mar 6, 2012 at 2:33 PM, <jsoneja@google.com> wrote:
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/hello_analytics_api_**v3.py<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py>
> File samples/analytics/hello_**analytics_api_v3.py (right):
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/hello_analytics_api_**v3.py#newcode22<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py#newcode22>
> samples/analytics/hello_**analytics_api_v3.py:22: authorized users first
> profile ID. Then the sample uses this ID to
> users's
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/hello_analytics_api_**v3.py#newcode29<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py#newcode29>
> samples/analytics/hello_**analytics_api_v3.py:29: The register the project
> to use OAuth2.0 for installed applications.
> s/The/Then/
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/hello_analytics_api_**v3.py#newcode32<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py#newcode32>
> samples/analytics/hello_**analytics_api_v3.py:32: into the
> client_secrest.json file that is in the same directory as this sample.
> client_secrets.json
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/hello_analytics_api_**v3.py#newcode41<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/hello_analytics_api_v3.py#newcode41>
> samples/analytics/hello_**analytics_api_v3.py:41: $ python
> hello_analytics_api_v3.py --help
> if we do decide to rename the java sample, we should rename this
> accordingly.
>
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/management_v3_**reference.py<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/management_v3_reference.py>
> File samples/analytics/management_**v3_reference.py (right):
>
> http://codereview.appspot.com/**5494058/diff/10001/samples/**
>
analytics/management_v3_**reference.py#newcode54<http://codereview.appspot.com/5494058/diff/10001/samples/analytics/management_v3_reference.py#newcode54>
> samples/analytics/management_**v3_reference.py:54: $ python analytics.py
> --help
> here too .. update the name
>
>
http://codereview.appspot.com/**5494058/<http://codereview.appspot.com/5494058/>
>
Great updated here: http://code.google.com/p/google-api-python-client/source/detail?r=63c6ac00f393ea3596b275953a5f47dd67c1bdc2 Thanks On 2012/03/09 08:27:28, api.nickm1 wrote: > Thanks. Can you add ...
12 years, 8 months ago
(2012-03-12 16:24:24 UTC)
#9
Issue 5494058: Adding py sample for google analytics core reporting api
(Closed)
Created 12 years, 11 months ago by api.nickm1
Modified 12 years, 7 months ago
Reviewers: jcgregorio_google, nm, jsoneja
Base URL:
Comments: 32