Fix send_to_disc from devices

This commit is contained in:
Charles Haley 2010-06-07 15:51:55 +01:00
parent 359946bd08
commit 984bea5033

View File

@ -317,8 +317,10 @@ class DeviceManager(Thread):
def _save_books(self, paths, target):
'''Copy books from device to disk'''
for path in paths:
name = path.rpartition(getattr(self.device, 'path_sep', '/'))[2]
# name = path.rpartition(getattr(self.device, 'path_sep', '/'))[2]
name = path.rpartition(os.sep)[2]
dest = os.path.join(target, name)
print path, dest
if os.path.abspath(dest) != os.path.abspath(path):
f = open(dest, 'wb')
self.device.get_file(path, f)