Remove unused mount point creation logic on linux from USBMS

This commit is contained in:
Kovid Goyal 2012-01-24 09:38:23 +05:30
parent 27749486e2
commit d28ea799f2

View File

@ -591,26 +591,7 @@ 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': def do_mount(node):
label = self.MAIN_MEMORY_VOLUME_LABEL
if type == 'carda':
label = self.STORAGE_CARD_VOLUME_LABEL
if type == 'cardb':
label = self.STORAGE_CARD2_VOLUME_LABEL
if not label:
label = self.STORAGE_CARD_VOLUME_LABEL + ' 2'
if not label:
label = 'E-book Reader (%s)'%type
extra = 0
while True:
q = ' (%d)'%extra if extra else ''
if not os.path.exists('/media/'+label+q):
break
extra += 1
if extra:
label += ' (%d)'%extra
def do_mount(node, label):
try: try:
from calibre.devices.udisks import mount from calibre.devices.udisks import mount
mount(node) mount(node)
@ -621,8 +602,7 @@ class Device(DeviceConfig, DevicePlugin):
traceback.print_exc() traceback.print_exc()
return 1 return 1
ret = do_mount(node)
ret = do_mount(node, label)
if ret != 0: if ret != 0:
return None, ret return None, ret
return self.node_mountpoint(node)+'/', 0 return self.node_mountpoint(node)+'/', 0