mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
33b165bfce
commit
8538c08b03
@ -565,7 +565,7 @@ class DeviceManager(Thread): # {{{
|
|||||||
if DEBUG:
|
if DEBUG:
|
||||||
prints('Setting metadata in:', mi.title, 'at:',
|
prints('Setting metadata in:', mi.title, 'at:',
|
||||||
f, file=sys.__stdout__)
|
f, file=sys.__stdout__)
|
||||||
with open(f, 'r+b') as stream:
|
with lopen(f, 'r+b') as stream:
|
||||||
if cpb:
|
if cpb:
|
||||||
newmi = mi.deepcopy_metadata()
|
newmi = mi.deepcopy_metadata()
|
||||||
newmi.template_to_attribute(mi, cpb)
|
newmi.template_to_attribute(mi, cpb)
|
||||||
@ -622,7 +622,7 @@ class DeviceManager(Thread): # {{{
|
|||||||
name = sanitize_file_name2(os.path.basename(path))
|
name = sanitize_file_name2(os.path.basename(path))
|
||||||
dest = os.path.join(target, name)
|
dest = os.path.join(target, name)
|
||||||
if os.path.abspath(dest) != os.path.abspath(path):
|
if os.path.abspath(dest) != os.path.abspath(path):
|
||||||
with open(dest, 'wb') as f:
|
with lopen(dest, 'wb') as f:
|
||||||
self.device.get_file(path, f)
|
self.device.get_file(path, f)
|
||||||
|
|
||||||
def save_books(self, done, paths, target, add_as_step_to_job=None):
|
def save_books(self, done, paths, target, add_as_step_to_job=None):
|
||||||
@ -631,7 +631,7 @@ class DeviceManager(Thread): # {{{
|
|||||||
to_job=add_as_step_to_job)
|
to_job=add_as_step_to_job)
|
||||||
|
|
||||||
def _view_book(self, path, target):
|
def _view_book(self, path, target):
|
||||||
with open(target, 'wb') as f:
|
with lopen(target, 'wb') as f:
|
||||||
self.device.get_file(path, f)
|
self.device.get_file(path, f)
|
||||||
return target
|
return target
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user