def delete(self):
        """
        Deletes the selected items.
        """
        urls = self.selected_urls()
        rep = QtWidgets.QMessageBox.question(
            self.tree_view, _('Confirm delete'),
            _('Are you sure about deleting the selected files?'),
            QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
            QtWidgets.QMessageBox.Yes)
        if rep == QtWidgets.QMessageBox.Yes:
            deleted_files = []
            for fn in urls:
                try:
                    if os.path.isfile(fn):
                        os.remove(fn)
                        deleted_files.append(fn)
                    else:
                        files = self._get_files(fn)
                        shutil.rmtree(fn)
                        deleted_files += files
                except __HOLE__ as e:
                    QtWidgets.QMessageBox.warning(
                        self.tree_view, _('Failed to remove %s') % fn, str(e))
                    _logger().exception('failed to remove %s', fn)
            self.tree_view.files_deleted.emit(deleted_files)
            for d in deleted_files:
                debug('%s removed', d)
                self.tree_view.file_deleted.emit(os.path.normpath(d))
dataset/ETHPy150Open OpenCobolIDE/OpenCobolIDE/open_cobol_ide/extlibs/pyqode/core/widgets/filesystem_treeview.py/FileSystemHelper.delete