mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Linux device mounting: Mount the drive with the lowest kernel name as main memory
This commit is contained in:
parent
5fb294486b
commit
2bd9f63f29
@ -97,8 +97,8 @@ class XMLCache(object):
|
||||
for source_id, path in paths.items():
|
||||
if source_id == 0:
|
||||
if not os.path.exists(path):
|
||||
raise DeviceError('The SONY XML cache media.xml does not exist. Try'
|
||||
' disconnecting and reconnecting your reader.')
|
||||
raise DeviceError(('The SONY XML cache %r does not exist. Try'
|
||||
' disconnecting and reconnecting your reader.')%repr(path))
|
||||
with open(path, 'rb') as f:
|
||||
raw = f.read()
|
||||
else:
|
||||
@ -112,7 +112,7 @@ class XMLCache(object):
|
||||
verbose=DEBUG)[0],
|
||||
parser=parser)
|
||||
if self.roots[source_id] is None:
|
||||
raise Exception(('The SONY database at %s is corrupted. Try '
|
||||
raise Exception(('The SONY database at %r is corrupted. Try '
|
||||
' disconnecting and reconnecting your reader.')%path)
|
||||
|
||||
self.ext_paths, self.ext_roots = {}, {}
|
||||
|
@ -523,7 +523,8 @@ class Device(DeviceConfig, DevicePlugin):
|
||||
devnodes.append(node)
|
||||
|
||||
devnodes += list(repeat(None, 3))
|
||||
ans = tuple(['/dev/'+x if ok.get(x, False) else None for x in devnodes[:3]])
|
||||
ans = ['/dev/'+x if ok.get(x, False) else None for x in devnodes[:3]]
|
||||
ans.sort(key=lambda x: x[5:] if x else 'zzzzz')
|
||||
return self.linux_swap_drives(ans)
|
||||
|
||||
def linux_swap_drives(self, drives):
|
||||
|
Loading…
x
Reference in New Issue
Block a user