def delete(self, fnames=None):
        """Delete files"""
        if fnames is None:
            fnames = self.get_selected_filenames()
        multiple = len(fnames) > 1
        yes_to_all = None
        for fname in fnames:
            spyproject_path = osp.join(fname,'.spyproject')
            if osp.isdir(fname) and osp.exists(spyproject_path):
                QMessageBox.information(self, _('File Explorer'),
                                        _("The current directory contains a "
                                        "project.<br><br>"
                                        "If you want to delete"
                                        " the project, please go to "
                                        "<b>Projects</b> &raquo; <b>Delete "
                                        "Project</b>"))
            else:    
                yes_to_all = self.delete_file(fname, multiple, yes_to_all)
                if yes_to_all is not None and not yes_to_all:
                    # Canceled
                    break
def delete ( self , fnames = None ) : if fnames is None : fnames = self . get_selected_filenames ( ) multiple = len ( fnames ) > 1 yes_to_all = None for fname in fnames : spyproject_path = osp . join ( fname , '.spyproject' ) if osp . isdir ( fname ) and osp . exists ( spyproject_path ) : QMessageBox . information ( self , _ ( 'File Explorer' ) , _ ( "The current directory contains a " "project.<br><br>" "If you want to delete" " the project, please go to " "<b>Projects</b> &raquo; <b>Delete " "Project</b>" ) ) else : yes_to_all = self . delete_file ( fname , multiple , yes_to_all ) if yes_to_all is not None and not yes_to_all : break
Delete files