src/eric7/Plugins/WizardPlugins/QRegularExpressionWizard/QRegularExpressionWizardServer.py

branch
eric7
changeset 10331
c1a2ff7e3575
parent 9653
e67609152c5e
child 10437
2f70ca07f0af
equal deleted inserted replaced
10330:5ea038882dd6 10331:c1a2ff7e3575
5 5
6 """ 6 """
7 Module implementing the PyQt6 server part of the QRegularExpression wizzard. 7 Module implementing the PyQt6 server part of the QRegularExpression wizzard.
8 """ 8 """
9 9
10 import importlib
10 import json 11 import json
11 import sys 12 import sys
12 13
13 from PyQt6.QtCore import QRegularExpression 14 from PyQt6.QtCore import QRegularExpression
14 15
113 if "command" in commandDict: 114 if "command" in commandDict:
114 command = commandDict["command"] 115 command = commandDict["command"]
115 if command == "exit": 116 if command == "exit":
116 break 117 break
117 elif command == "available": 118 elif command == "available":
118 try: 119 responseDict["available"] = bool(importlib.util.find_spec("PyQt6"))
119 import PyQt6 # __IGNORE_WARNING__
120
121 responseDict["available"] = True
122 except ImportError:
123 responseDict["available"] = False
124 elif command == "validate": 120 elif command == "validate":
125 valid, error, errorOffset = rxValidate( 121 valid, error, errorOffset = rxValidate(
126 commandDict["regexp"], commandDict["options"] 122 commandDict["regexp"], commandDict["options"]
127 ) 123 )
128 responseDict["valid"] = valid 124 responseDict["valid"] = valid

eric ide

mercurial