mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix OSXRemovableDevicePlugin so it works properly on OSX
This commit is contained in:
parent
543c58d57a
commit
26aa78c3b9
1 changed files with 4 additions and 2 deletions
|
@ -13,8 +13,8 @@ import os
|
||||||
import plistlib
|
import plistlib
|
||||||
|
|
||||||
## Support for removable devices on Mac OSX
|
## Support for removable devices on Mac OSX
|
||||||
class OSXRemovableDrives(RemovableDrivePlugin.RemovableDrivePlugin):
|
class OSXRemovableDrivePlugin(RemovableDrivePlugin.RemovableDrivePlugin):
|
||||||
def run(self):
|
def checkRemovableDrives(self):
|
||||||
drives = {}
|
drives = {}
|
||||||
p = subprocess.Popen(["system_profiler", "SPUSBDataType", "-xml"], stdout=subprocess.PIPE)
|
p = subprocess.Popen(["system_profiler", "SPUSBDataType", "-xml"], stdout=subprocess.PIPE)
|
||||||
plist = plistlib.loads(p.communicate()[0])
|
plist = plistlib.loads(p.communicate()[0])
|
||||||
|
@ -41,6 +41,8 @@ class OSXRemovableDrives(RemovableDrivePlugin.RemovableDrivePlugin):
|
||||||
volume = vol["mount_point"]
|
volume = vol["mount_point"]
|
||||||
drives[volume] = os.path.basename(volume)
|
drives[volume] = os.path.basename(volume)
|
||||||
|
|
||||||
|
return drives
|
||||||
|
|
||||||
def performEjectDevice(self, device):
|
def performEjectDevice(self, device):
|
||||||
p = subprocess.Popen(["diskutil", "eject", path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.Popen(["diskutil", "eject", path], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
output = p.communicate()
|
output = p.communicate()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue