eric6/UI/FindFileDialog.py

changeset 8235
78e6d29eb773
parent 8220
006ee31b4835
child 8260
2161475d9639
--- a/eric6/UI/FindFileDialog.py	Tue Apr 13 18:02:59 2021 +0200
+++ b/eric6/UI/FindFileDialog.py	Tue Apr 13 19:59:17 2021 +0200
@@ -438,10 +438,7 @@
         wo = self.wordCheckBox.isChecked()
         cs = self.caseCheckBox.isChecked()
         ct = self.findtextCombo.currentText()
-        if reg:
-            txt = ct
-        else:
-            txt = re.escape(ct)
+        txt = ct if reg else re.escape(ct)
         if wo:
             txt = "\\b{0}\\b".format(txt)
         flags = re.UNICODE
@@ -610,10 +607,7 @@
             start = 0
             end = 0
         
-        if self.project:
-            fn = os.path.join(self.project.ppath, file)
-        else:
-            fn = file
+        fn = os.path.join(self.project.ppath, file) if self.project else file
         if fn.endswith('.ui'):
             self.designerFile.emit(fn)
         else:
@@ -777,10 +771,7 @@
         Private method to copy the path of an entry to the clipboard.
         """
         itm = self.findList.selectedItems()[0]
-        if itm.parent():
-            fn = itm.parent().text(0)
-        else:
-            fn = itm.text(0)
+        fn = itm.parent().text(0) if itm.parent() else itm.text(0)
         
         cb = QApplication.clipboard()
         cb.setText(fn)

eric ide

mercurial