This commit is contained in:
Kovid Goyal 2012-08-21 20:01:56 +05:30
parent d14d86766d
commit cf0c0d3fa9

View File

@ -207,8 +207,9 @@ class MTP_DEVICE(MTPDeviceBase):
ans[i] = s['free_space']
return tuple(ans)
def get_file(self, object_id, callback=None):
stream = SpooledTemporaryFile(5*1024*1024)
def get_file(self, object_id, stream=None, callback=None):
if stream is None:
stream = SpooledTemporaryFile(5*1024*1024, '_wpd_receive_file.dat')
try:
self.dev.get_file(object_id, stream, callback)
except self.wpd.WPDFileBusy: