def _mount_device(self):
     """ Mount the device so we can search it for ISOs. """
     mounts = get_mount_paths(self._device.path)
     # We have to check both ISO_DIR and the DRACUT_ISODIR because we
     # still reference both, even though /mnt/install is a symlink to
     # /run/install.  Finding mount points doesn't handle the symlink
     if ISO_DIR not in mounts and DRACUT_ISODIR not in mounts:
         # We're not mounted to either location, so do the mount
         self._device.format.mount(mountpoint=ISO_DIR)
 def _mount_device(self):
     """ Mount the device so we can search it for ISOs. """
     mounts = get_mount_paths(self._device.path)
     # We have to check both ISO_DIR and the DRACUT_ISODIR because we
     # still reference both, even though /mnt/install is a symlink to
     # /run/install.  Finding mount points doesn't handle the symlink
     if ISO_DIR not in mounts and DRACUT_ISODIR not in mounts:
         # We're not mounted to either location, so do the mount
         self._device.format.mount(mountpoint=ISO_DIR)
    def on_verify_iso_clicked(self, button):
        p = self._get_selected_partition()
        f = self._currentIsoFile

        if not p or not f:
            return

        dialog = MediaCheckDialog(self.data)
        with enlightbox(self.window, dialog.window):
            unmount = not p.format.status
            mounts = get_mount_paths(p.path)
            # We have to check both ISO_DIR and the DRACUT_ISODIR because we
            # still reference both, even though /mnt/install is a symlink to
            # /run/install.  Finding mount points doesn't handle the symlink
            if constants.ISO_DIR not in mounts and constants.DRACUT_ISODIR not in mounts:
                # We're not mounted to either location, so do the mount
                p.format.mount(mountpoint=constants.ISO_DIR)
            dialog.run(constants.ISO_DIR + "/" + f)
            if unmount:
                p.format.unmount()
    def on_verify_iso_clicked(self, button):
        p = self._get_selected_partition()
        f = self._currentIsoFile

        if not p or not f:
            return

        dialog = MediaCheckDialog(self.data)
        with enlightbox(self.window, dialog.window):
            unmount = not p.format.status
            mounts = get_mount_paths(p.path)
            # We have to check both ISO_DIR and the DRACUT_ISODIR because we
            # still reference both, even though /mnt/install is a symlink to
            # /run/install.  Finding mount points doesn't handle the symlink
            if constants.ISO_DIR not in mounts and constants.DRACUT_ISODIR not in mounts:
                # We're not mounted to either location, so do the mount
                p.format.mount(mountpoint=constants.ISO_DIR)
            dialog.run(constants.ISO_DIR + "/" + f)
            if unmount:
                p.format.unmount()
    def run(self, dev):
        retval = None

        unmount = not dev.format.status
        mounts = get_mount_paths(dev.path)
        # We have to check both ISO_DIR and the DRACUT_ISODIR because we
        # still reference both, even though /mnt/install is a symlink to
        # /run/install.  Finding mount points doesn't handle the symlink
        if constants.ISO_DIR not in mounts and constants.DRACUT_ISODIR not in mounts:
            # We're not mounted to either location, so do the mount
            dev.format.mount(mountpoint=constants.ISO_DIR)

        # If any directory was chosen, return that.  Otherwise, return None.
        rc = self.window.run()
        if rc:
            f = self._chooser.get_filename()
            if f:
                retval = f.replace(constants.ISO_DIR, "")

        if unmount:
            dev.format.unmount()

        self.window.destroy()
        return retval
    def run(self, dev):
        retval = None

        unmount = not dev.format.status
        mounts = get_mount_paths(dev.path)
        # We have to check both ISO_DIR and the DRACUT_ISODIR because we
        # still reference both, even though /mnt/install is a symlink to
        # /run/install.  Finding mount points doesn't handle the symlink
        if constants.ISO_DIR not in mounts and constants.DRACUT_ISODIR not in mounts:
            # We're not mounted to either location, so do the mount
            dev.format.mount(mountpoint=constants.ISO_DIR)

        # If any directory was chosen, return that.  Otherwise, return None.
        rc = self.window.run()
        if rc:
            f = self._chooser.get_filename()
            if f:
                retval = f.replace(constants.ISO_DIR, "")

        if unmount:
            dev.format.unmount()

        self.window.destroy()
        return retval