UI/FindFileDialog.py

changeset 5546
971f5ab7429c
parent 5389
9b1c800daff3
child 5558
858abfcbaf28
equal deleted inserted replaced
5545:4aec52243595 5546:971f5ab7429c
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 import os 12 import os
13 import re 13 import re
14 import sys
14 15
15 from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot 16 from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot
16 from PyQt5.QtGui import QCursor 17 from PyQt5.QtGui import QCursor
17 from PyQt5.QtWidgets import QDialog, QApplication, QMenu, QDialogButtonBox, \ 18 from PyQt5.QtWidgets import QDialog, QApplication, QMenu, QDialogButtonBox, \
18 QTreeWidgetItem, QComboBox 19 QTreeWidgetItem, QComboBox
368 txt = ct 369 txt = ct
369 else: 370 else:
370 txt = re.escape(ct) 371 txt = re.escape(ct)
371 if wo: 372 if wo:
372 txt = "\\b{0}\\b".format(txt) 373 txt = "\\b{0}\\b".format(txt)
373 flags = re.UNICODE | re.LOCALE 374 if sys.version_info[0] == 2:
375 flags = re.UNICODE | re.LOCALE
376 else:
377 flags = re.UNICODE
374 if not cs: 378 if not cs:
375 flags |= re.IGNORECASE 379 flags |= re.IGNORECASE
376 try: 380 try:
377 search = re.compile(txt, flags) 381 search = re.compile(txt, flags)
378 except re.error as why: 382 except re.error as why:

eric ide

mercurial