mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
dc83803252
commit
2539023d2a
@ -403,7 +403,6 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
mp = self.node_mountpoint(node)
|
mp = self.node_mountpoint(node)
|
||||||
if mp is not None:
|
if mp is not None:
|
||||||
return mp, 0
|
return mp, 0
|
||||||
|
|
||||||
if type == 'main':
|
if type == 'main':
|
||||||
label = self.MAIN_MEMORY_VOLUME_LABEL
|
label = self.MAIN_MEMORY_VOLUME_LABEL
|
||||||
if type == 'carda':
|
if type == 'carda':
|
||||||
@ -413,17 +412,17 @@ class Device(DeviceConfig, DevicePlugin):
|
|||||||
if label is None:
|
if label is None:
|
||||||
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
|
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
|
||||||
extra = 0
|
extra = 0
|
||||||
|
label = label.replace(' ', '_')
|
||||||
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
|
||||||
if extra:
|
if extra:
|
||||||
label += ' (%d)'%extra
|
label += '_(%d)'%extra
|
||||||
|
|
||||||
def do_mount(node, label):
|
def do_mount(node, label):
|
||||||
cmd = ['pmount', '-w', '-s']
|
cmd = ['pmount', '-w', '-s']
|
||||||
label = label.replace(' ', '_')
|
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen(cmd + [node, label])
|
p = subprocess.Popen(cmd + [node, label])
|
||||||
except OSError:
|
except OSError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user