From 26aa78c3b9e369aa4f24f4dd0e8bf01d78c5d359 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 4 Aug 2015 15:39:58 +0200 Subject: [PATCH] Fix OSXRemovableDevicePlugin so it works properly on OSX --- .../RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py index c50443cb92..e02e0d65b6 100644 --- a/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/OSXRemovableDrivePlugin.py @@ -13,8 +13,8 @@ import os import plistlib ## Support for removable devices on Mac OSX -class OSXRemovableDrives(RemovableDrivePlugin.RemovableDrivePlugin): - def run(self): +class OSXRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin): + def checkRemovableDrives(self): drives = {} p = subprocess.Popen(["system_profiler", "SPUSBDataType", "-xml"], stdout=subprocess.PIPE) plist = plistlib.loads(p.communicate()[0]) @@ -41,6 +41,8 @@ class OSXRemovableDrives(RemovableDrivePlugin.RemovableDrivePlugin): volume = vol["mount_point"] drives[volume] = os.path.basename(volume) + return drives + def performEjectDevice(self, device): p = subprocess.Popen(["diskutil", "eject", path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = p.communicate()