eric6/UI/FindFileDialog.py

changeset 7264
bedbe458d792
parent 7229
53054eb5b15a
child 7360
9190402e4505
--- a/eric6/UI/FindFileDialog.py	Tue Sep 24 18:46:24 2019 +0200
+++ b/eric6/UI/FindFileDialog.py	Tue Sep 24 19:08:10 2019 +0200
@@ -13,8 +13,9 @@
 
 from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot
 from PyQt5.QtGui import QCursor
-from PyQt5.QtWidgets import QDialog, QApplication, QMenu, QDialogButtonBox, \
-    QTreeWidgetItem, QComboBox
+from PyQt5.QtWidgets import (
+    QDialog, QApplication, QMenu, QDialogButtonBox, QTreeWidgetItem, QComboBox
+)
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -66,14 +67,12 @@
         
         self.__replaceMode = replaceMode
         
-        self.stopButton = \
-            self.buttonBox.addButton(self.tr("Stop"),
-                                     QDialogButtonBox.ActionRole)
+        self.stopButton = self.buttonBox.addButton(
+            self.tr("Stop"), QDialogButtonBox.ActionRole)
         self.stopButton.setEnabled(False)
         
-        self.findButton = \
-            self.buttonBox.addButton(self.tr("Find"),
-                                     QDialogButtonBox.ActionRole)
+        self.findButton = self.buttonBox.addButton(
+            self.tr("Find"), QDialogButtonBox.ActionRole)
         self.findButton.setEnabled(False)
         self.findButton.setDefault(True)
         
@@ -265,12 +264,15 @@
         """
         Private slot called to enable the find button.
         """
-        if self.findtextCombo.currentText() == "" or \
-           (self.dirButton.isChecked() and
-            (self.dirPicker.currentText() == "" or
-             not os.path.exists(os.path.abspath(
-                self.dirPicker.currentText())))) or \
-           (self.filterCheckBox.isChecked() and self.filterEdit.text() == ""):
+        if (
+            self.findtextCombo.currentText() == "" or
+            (self.dirButton.isChecked() and
+             (self.dirPicker.currentText() == "" or
+              not os.path.exists(os.path.abspath(
+                self.dirPicker.currentText())))) or
+            (self.filterCheckBox.isChecked() and
+             self.filterEdit.text() == "")
+        ):
             self.findButton.setEnabled(False)
             self.buttonBox.button(QDialogButtonBox.Close).setDefault(True)
         else:
@@ -307,17 +309,20 @@
         """
         Private slot to handle the find button being pressed.
         """
-        if self.__replaceMode and \
-           not e5App().getObject("ViewManager").checkAllDirty():
+        if (
+            self.__replaceMode and
+            not e5App().getObject("ViewManager").checkAllDirty()
+        ):
             return
         
         self.__cancelSearch = False
         
         if self.filterCheckBox.isChecked():
             fileFilter = self.filterEdit.text()
-            fileFilterList = \
-                ["^{0}$".format(filter.replace(".", r"\.").replace("*", ".*"))
-                 for filter in fileFilter.split(";")]
+            fileFilterList = [
+                "^{0}$".format(filter.replace(".", r"\.").replace("*", ".*"))
+                for filter in fileFilter.split(";")
+            ]
             filterRe = re.compile("|".join(fileFilterList))
         
         if self.projectButton.isChecked():
@@ -617,8 +622,9 @@
                 
                 # read the file and split it into textlines
                 try:
-                    text, encoding, hashStr = \
+                    text, encoding, hashStr = (
                         Utilities.readEncodedFileWithHash(fn)
+                    )
                     lines = text.splitlines(True)
                 except (UnicodeError, IOError) as err:
                     E5MessageBox.critical(

eric ide

mercurial