mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
USBMS: Sleep a little before retyring a copy to device
This commit is contained in:
parent
dc0562d05e
commit
58892090ce
@ -4,8 +4,7 @@ __license__ = 'GPL 3'
|
|||||||
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
import os
|
import os, shutil, time
|
||||||
import shutil
|
|
||||||
|
|
||||||
from calibre.devices.errors import PathError
|
from calibre.devices.errors import PathError
|
||||||
|
|
||||||
@ -55,6 +54,7 @@ class CLI(object):
|
|||||||
shutil.copyfileobj(infile, dest)
|
shutil.copyfileobj(infile, dest)
|
||||||
except IOError:
|
except IOError:
|
||||||
print 'WARNING: First attempt to send file to device failed'
|
print 'WARNING: First attempt to send file to device failed'
|
||||||
|
time.sleep(0.2)
|
||||||
infile.seek(0)
|
infile.seek(0)
|
||||||
dest.seek(0)
|
dest.seek(0)
|
||||||
dest.truncate()
|
dest.truncate()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user