Re: Sample python client code for Enterprise License Manager API. (issue 6492120)

234 views
Skip to first unread message

smarq...@google.com

unread,
Sep 20, 2012, 1:11:23 AM9/20/12
to jcgre...@google.com, google-api-p...@googlegroups.com, re...@codereview-hr.appspotmail.com
On 2012/09/17 19:03:52, jcgregorio_google wrote:

https://codereview.appspot.com/6492120/diff/3001/samples/licensing/licensing.py
> File samples/licensing/licensing.py (right):


https://codereview.appspot.com/6492120/diff/3001/samples/licensing/licensing.py#newcode139
> samples/licensing/licensing.py:139: customerId=customerId).execute()
> Should also use listForProduct_next to iterate through the extended
list. Same
> for lsitForProductAndSku.

> See:
https://developers.google.com/api-client-library/python/guide/pagination

I went ahead and added pagination and maxResults options to the
listForProduct and listForProductAndSku methods themselves, and now each
will recurse (if maxResults unspecified) until all results are returned
(no pages left). This seemed truer to the actual API methods, which
simply accept pageToken (page identifier) and maxResults as optional
params.
(https://developers.google.com/google-apps/licensing/v1/reference/licenseAssignments/listForProduct)



https://codereview.appspot.com/6492120/diff/3001/samples/licensing/licensing.py#newcode299
> samples/licensing/licensing.py:299: storage =
Storage('coordinate.dat')
> maybe licensing.dat?

Good catch :)

https://codereview.appspot.com/6492120/

jcgre...@google.com

unread,
Sep 20, 2012, 1:00:10 PM9/20/12
to smarq...@google.com, google-api-p...@googlegroups.com, re...@codereview-hr.appspotmail.com

https://codereview.appspot.com/6492120/diff/8001/samples/licensing/licensing.py
File samples/licensing/licensing.py (right):

https://codereview.appspot.com/6492120/diff/8001/samples/licensing/licensing.py#newcode90
samples/licensing/licensing.py:90: gflags.DEFINE_string('maxResults',
None, 'The maximum number of results to '
Shouldn't maxResults be an integer and not a string?

https://codereview.appspot.com/6492120/diff/8001/samples/licensing/licensing.py#newcode373
samples/licensing/licensing.py:373: if FLAGS.maxResults:
Isn't the default for maxResults already set to None?

https://codereview.appspot.com/6492120/
Reply all
Reply to author
Forward
0 new messages