def _download_file(self, uri, file_path, **kwargs):
"""Downloads a file to disk from the specified URI.
Note: to download a file in memory, use the GetContent() method.
Args:
uri: str The full URL to download the file from.
file_path: str The full path to save the file to.
kwargs: Other parameters to pass to self.get_content().
Raises:
gdata.client.RequestError: on error response from server.
"""
f = open(file_path, 'wb')
try:
f.write(self._get_content(uri, **kwargs))
except gdata.client.RequestError as e:
f.close()
raise e
f.flush()
f.close()
评论列表
文章目录