-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmountDevice.py
27 lines (22 loc) · 1 KB
/
mountDevice.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os
import osinfo
def mountDevice(osInfo: osinfo.OSInfo, dmgImagePath, mountpoint):
if osInfo.getosplatform() == "macosx":
os.system("cd " + os.path.abspath("./DeviceSupport/iPad3_1") + "; " +
"hdiutil attach " + dmgImagePath + " -mountpoint " + mountpoint)
if osInfo.getosplatform() == "linux":
# TODO: Add code for mounting dmg file on linux.
pass
if osInfo.getosplatform() == "windows":
# TODO: Add code for extracting (not mounting) dmg file on Windows.
pass
def unmountDevice(osInfo: osinfo.OSInfo, mountpoint):
if osInfo.getosplatform() == "macosx":
os.system("cd " + os.path.abspath("./DeviceSupport/iPad3_1") + "; " +
"hdiutil detach " + mountpoint)
if osInfo.getosplatform() == "linux":
# TODO: Add code for unmounting dmg file on linux.
pass
if osInfo.getosplatform() == "windows":
# TODO: Add code for deleting (not unmounting) extracted content on Windows.
pass