http://codereview.appspot.com/6462085/diff/4001/apiclient/http.py
File apiclient/http.py (right):
http://codereview.appspot.com/6462085/diff/4001/apiclient/http.py#newcode455
apiclient/http.py:455: def has_stream(self):
On 2012/08/20 21:19:50, aiuto wrote:
> After seeing 3 implementations of has_stream, I am thinking it may be
> appropriate to make it a property of MediaUpload which is set in the
constructor
> and defaults to false. Those classes which support streaming would chain to
the
> superclass __init__.
>
> The chunksize test and the exception could be done there too.
Done. Solved the problem with the duplicated code by making MediaFileUpload and
MediaInMemoryUpload to subclasses of MediaIoBaseUpload, which removed a lot of
duplicate code.
http://codereview.appspot.com/6462085/diff/4001/apiclient/http.py#newcode474
apiclient/http.py:474: if self.has_stream():
On 2012/08/20 21:19:50, aiuto wrote:
> Can this every be false?
Done.
http://codereview.appspot.com/6462085/diff/4001/apiclient/http.py#newcode821
apiclient/http.py:821: if self.resumable.has_stream() and sys.version_info[1] >=
6:
Turns out you can just assign new values to sys.version_info. Unit tests added.
On 2012/08/20 21:19:50, aiuto wrote:
> Is there some sort of test harness that can at least try to run this under
> different python versions?
On 2012/08/21 16:30:24, aiuto wrote: > lgtm Committed in http://code.google.com/p/google-api-python-client/source/detail?r=7453bce8f3c83533f8b317d8651816b5834b3e4b
Issue 6462085: Handle passing streams directly to httplib2.
(Closed)
Created 12 years ago by jcgregorio_google
Modified 12 years ago
Reviewers: aiuto, jcgregorio_google
Base URL:
Comments: 6