mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Cards A and B are now correctly indentified on linux by the usbms driver
This commit is contained in:
parent
8c3a899c3c
commit
e52b223b0f
@ -365,8 +365,8 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
ok[node] = False
|
ok[node] = False
|
||||||
except:
|
except:
|
||||||
ok[node] = False
|
ok[node] = False
|
||||||
if ok[node]:
|
devnodes.append(node)
|
||||||
devnodes.append(node)
|
|
||||||
devnodes += list(repeat(None, 3))
|
devnodes += list(repeat(None, 3))
|
||||||
ans = tuple(['/dev/'+x if ok.get(x, False) else None for x in devnodes[:3]])
|
ans = tuple(['/dev/'+x if ok.get(x, False) else None for x in devnodes[:3]])
|
||||||
return self.linux_swap_drives(ans)
|
return self.linux_swap_drives(ans)
|
||||||
@ -423,7 +423,7 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
|
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
|
||||||
extra = 0
|
extra = 0
|
||||||
while True:
|
while True:
|
||||||
q = '_(%d)'%extra if extra else ''
|
q = ' (%d)'%extra if extra else ''
|
||||||
if not os.path.exists('/media/'+label+q):
|
if not os.path.exists('/media/'+label+q):
|
||||||
break
|
break
|
||||||
extra += 1
|
extra += 1
|
||||||
@ -457,16 +457,16 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
_('Unable to mount main memory (Error code: %d)')%ret)
|
_('Unable to mount main memory (Error code: %d)')%ret)
|
||||||
if not mp.endswith('/'): mp += '/'
|
if not mp.endswith('/'): mp += '/'
|
||||||
self._main_prefix = mp
|
self._main_prefix = mp
|
||||||
cards = [x for x in (carda, cardb) if x is not None]
|
cards = [(carda, '_card_a_prefix', 'carda'),
|
||||||
prefix, typ = '_card_a_prefix', 'carda'
|
(cardb, '_card_b_prefix', 'cardb')]
|
||||||
for card in cards:
|
for card, prefix, typ in cards:
|
||||||
|
if card is None: continue
|
||||||
mp, ret = mount(card, typ)
|
mp, ret = mount(card, typ)
|
||||||
if mp is None:
|
if mp is None:
|
||||||
print >>sys.stderr, 'Unable to mount card (Error code: %d)'%ret
|
print >>sys.stderr, 'Unable to mount card (Error code: %d)'%ret
|
||||||
else:
|
else:
|
||||||
if not mp.endswith('/'): mp += '/'
|
if not mp.endswith('/'): mp += '/'
|
||||||
setattr(self, prefix, mp)
|
setattr(self, prefix, mp)
|
||||||
prefix, typ = '_card_b_prefix', 'cardb'
|
|
||||||
|
|
||||||
def open(self):
|
def open(self):
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user