mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 17:34:47 +01:00
...
This commit is contained in:
parent
dc83803252
commit
2539023d2a
1 changed files with 3 additions and 4 deletions
|
|
@ -403,7 +403,6 @@ def mount(node, type):
|
|||
mp = self.node_mountpoint(node)
|
||||
if mp is not None:
|
||||
return mp, 0
|
||||
|
||||
if type == 'main':
|
||||
label = self.MAIN_MEMORY_VOLUME_LABEL
|
||||
if type == 'carda':
|
||||
|
|
@ -413,17 +412,17 @@ def mount(node, type):
|
|||
if label is None:
|
||||
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
|
||||
extra = 0
|
||||
label = label.replace(' ', '_')
|
||||
while True:
|
||||
q = ' (%d)'%extra if extra else ''
|
||||
q = '_(%d)'%extra if extra else ''
|
||||
if not os.path.exists('/media/'+label+q):
|
||||
break
|
||||
extra += 1
|
||||
if extra:
|
||||
label += ' (%d)'%extra
|
||||
label += '_(%d)'%extra
|
||||
|
||||
def do_mount(node, label):
|
||||
cmd = ['pmount', '-w', '-s']
|
||||
label = label.replace(' ', '_')
|
||||
try:
|
||||
p = subprocess.Popen(cmd + [node, label])
|
||||
except OSError:
|
||||
|
|
|
|||
Loading…
Reference in a new issue