(self, force=False)
Unounts single volumes for partitions, all volumes for whole disks.
Unounts single volumes for partitions, all volumes for whole disks.
Unounts single volumes for partitions all volumes for whole disks .
def Unmount(self, force=False):
    """Unounts single volumes for partitions, all volumes for whole disks."""
    if not self.Mounted():
      raise MacDiskError("%s is not mounted" % self.deviceid)
    else:
      command = ["diskutil", "unmount", self.deviceid]
      if force:
        command.insert(2, "force")
      if self.wholedisk:  # pylint: disable=no-member
        command[1] = "unmountDisk"
      rc = gmacpyutil.RunProcess(command)[2]
      if rc == 0:
        self.Refresh()
        return True
def Unmount ( self , force = False ) : if not self . Mounted ( ) : raise MacDiskError ( "%s is not mounted" % self . deviceid ) else : command = [ "diskutil" , "unmount" , self . deviceid ] if force : command . insert ( 2 , "force" ) if self . wholedisk : # pylint: disable=no-member command [ 1 ] = "unmountDisk" rc = gmacpyutil . RunProcess ( command ) [ 2 ] if rc == 0 : self . Refresh ( ) return True