From a01f3d04b6d281d7246bb6370a864e3f101619bc Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Thu, 16 Jan 2020 19:18:12 -0700 Subject: [PATCH] Updated mount-all-volumes * Added gui argument to open Thunar after mounting --- scripts/mount-all-volumes | 7 +++++++ scripts/wk/os/linux.py | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/mount-all-volumes b/scripts/mount-all-volumes index fb703011..1e8b3353 100755 --- a/scripts/mount-all-volumes +++ b/scripts/mount-all-volumes @@ -2,6 +2,8 @@ """Wizard Kit: Mount all volumes""" # vim: sts=2 sw=2 ts=2 +import sys + import wk @@ -19,6 +21,11 @@ def main(): wk.std.print_info('Results') wk.std.print_report(report, indent=2) + # GUI mode + if 'gui' in sys.argv: + wk.std.pause('Press Enter to exit...') + wk.exe.popen_program(['nohup', 'thunar', '/media']) + if __name__ == '__main__': if wk.std.PLATFORM != 'Linux': diff --git a/scripts/wk/os/linux.py b/scripts/wk/os/linux.py index 253b1dd0..a62013ca 100644 --- a/scripts/wk/os/linux.py +++ b/scripts/wk/os/linux.py @@ -138,9 +138,9 @@ def mount_volumes(device_path=None, read_write=False, scan_corestorage=False): # Attempt to mount volume if not already_mounted: - mount(vol.path, read_write=read_write) - proc = run_program(cmd, check=False) - if proc.returncode: + try: + mount(vol.path, read_write=read_write) + except RuntimeError: result += 'Failed to mount' report.append(std.color_string(result, 'RED')) continue