src/eric7/SystemUtilities/FileSystemUtilities.py

branch
eric7
changeset 9923
f706be800097
parent 9920
2d4d551ef829
child 9944
011ae0edbcff
equal deleted inserted replaced
9922:6a8cc5957928 9923:f706be800097
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 if OSUtilities.isMacPlatform(): 596 mountedVolumes = [
597 mountedVolumes = [ 597 x.split(" type", 1)[0].split(" (", 1)[0].split(maxsplit=2)[-1]
598 x.split(" (")[0].split(maxsplit=2)[-1] for x in mountOutput 598 for x in mountOutput
599 ] 599 ]
600 else:
601 mountedVolumes = [
602 x.split(" type")[0].split(maxsplit=2)[-1] for x in mountOutput
603 ]
604 if findAll: 600 if findAll:
605 for volume in mountedVolumes: 601 for volume in mountedVolumes:
606 if os.path.basename(volume).startswith(volumeName): 602 if os.path.basename(volume).startswith(volumeName):
607 volumeDirectories.append(volume) 603 volumeDirectories.append(volume)
608 if volumeDirectories: 604 if volumeDirectories:

eric ide

mercurial