void (@NotNull AnActionEvent e) { final PsiElement[] elements = e.getData(LangDataKeys.PSI_ELEMENT_ARRAY); if (elements == null) return; final List<File> pycFiles = new ArrayList<>(); ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> { for (PsiElement element : elements) { PsiDirectory dir = (PsiDirectory) element; collectPycFiles(new File(dir.getVirtualFile().getPath()), pycFiles); } FileUtil.asyncDelete(pycFiles); }, PyBundle.message("action.CleanPyc.progress.title.cleaning.up.pyc.files"), false, e.getProject()); final StatusBar statusBar = WindowManager.getInstance().getIdeFrame(e.getProject()).getStatusBar(); statusBar.setInfo(PyBundle.message("action.CleanPyc.status.bar.text.deleted.bytecode.files", pycFiles.size())); }