mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:33:18 +02:00
USBMS: Sleep a little before retyring a copy to device
This commit is contained in:
parent
dc0562d05e
commit
58892090ce
1 changed files with 2 additions and 2 deletions
|
|
@ -4,8 +4,7 @@
|
|||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||
__docformat__ = 'restructuredtext en'
|
||||
|
||||
import os
|
||||
import shutil
|
||||
import os, shutil, time
|
||||
|
||||
from calibre.devices.errors import PathError
|
||||
|
||||
|
|
@ -55,6 +54,7 @@ def put_file(self, infile, path, replace_file=False, end_session=True):
|
|||
shutil.copyfileobj(infile, dest)
|
||||
except IOError:
|
||||
print 'WARNING: First attempt to send file to device failed'
|
||||
time.sleep(0.2)
|
||||
infile.seek(0)
|
||||
dest.seek(0)
|
||||
dest.truncate()
|
||||
|
|
|
|||
Loading…
Reference in a new issue