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 |
|
15 |
14 |
16 from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot |
15 from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot |
17 from PyQt5.QtGui import QCursor |
16 from PyQt5.QtGui import QCursor |
18 from PyQt5.QtWidgets import QDialog, QApplication, QMenu, QDialogButtonBox, \ |
17 from PyQt5.QtWidgets import QDialog, QApplication, QMenu, QDialogButtonBox, \ |
19 QTreeWidgetItem, QComboBox |
18 QTreeWidgetItem, QComboBox |
385 txt = ct |
384 txt = ct |
386 else: |
385 else: |
387 txt = re.escape(ct) |
386 txt = re.escape(ct) |
388 if wo: |
387 if wo: |
389 txt = "\\b{0}\\b".format(txt) |
388 txt = "\\b{0}\\b".format(txt) |
390 if sys.version_info[0] == 2: |
389 flags = re.UNICODE |
391 flags = re.UNICODE | re.LOCALE |
|
392 else: |
|
393 flags = re.UNICODE |
|
394 if not cs: |
390 if not cs: |
395 flags |= re.IGNORECASE |
391 flags |= re.IGNORECASE |
396 try: |
392 try: |
397 search = re.compile(txt, flags) |
393 search = re.compile(txt, flags) |
398 except re.error as why: |
394 except re.error as why: |