src/eric7/SystemUtilities/FileSystemUtilities.py

branch
eric7
changeset 9920
2d4d551ef829
parent 9903
52132654939b
child 9923
f706be800097
equal deleted inserted replaced
9918:678c19de9469 9920:2d4d551ef829
591 for mountCommand in ["mount", "/sbin/mount", "/usr/sbin/mount"]: 591 for mountCommand in ["mount", "/sbin/mount", "/usr/sbin/mount"]:
592 with contextlib.suppress(FileNotFoundError): 592 with contextlib.suppress(FileNotFoundError):
593 mountOutput = subprocess.run( # secok 593 mountOutput = subprocess.run( # secok
594 mountCommand, check=True, capture_output=True, text=True 594 mountCommand, check=True, capture_output=True, text=True
595 ).stdout.splitlines() 595 ).stdout.splitlines()
596 mountedVolumes = [ 596 if OSUtilities.isMacPlatform():
597 x.split(" type")[0].split(maxsplit=2)[2] for x in mountOutput 597 mountedVolumes = [
598 ] 598 x.split(" (")[0].split(maxsplit=2)[-1] for x in mountOutput
599 ]
600 else:
601 mountedVolumes = [
602 x.split(" type")[0].split(maxsplit=2)[-1] for x in mountOutput
603 ]
599 if findAll: 604 if findAll:
600 for volume in mountedVolumes: 605 for volume in mountedVolumes:
601 if os.path.basename(volume).startswith(volumeName): 606 if os.path.basename(volume).startswith(volumeName):
602 volumeDirectories.append(volume) 607 volumeDirectories.append(volume)
603 if volumeDirectories: 608 if volumeDirectories:

eric ide

mercurial