src/eric7/Globals/__init__.py

branch
eric7
changeset 9482
a2bc06a54d9d
parent 9473
3f23dbf37dbe
child 9549
67295777d9fe
child 9624
b47dfa7a137d
equal deleted inserted replaced
9481:0b936ff1bbb9 9482:a2bc06a54d9d
296 Function to determine the path to PyQt6 modules directory. 296 Function to determine the path to PyQt6 modules directory.
297 297
298 @return path to the PyQt6 modules directory 298 @return path to the PyQt6 modules directory
299 @rtype str 299 @rtype str
300 """ 300 """
301 import sysconfig
302
303 pyqtPath = os.path.join(sysconfig.get_path("platlib"), "PyQt6") 301 pyqtPath = os.path.join(sysconfig.get_path("platlib"), "PyQt6")
304 if os.path.exists(pyqtPath): 302 if os.path.exists(pyqtPath):
305 return pyqtPath 303 return pyqtPath
306 304
307 return "" 305 return ""
315 @type int 313 @type int
316 @return path to the PyQt tools 314 @return path to the PyQt tools
317 @rtype str 315 @rtype str
318 """ 316 """
319 from eric7 import Preferences 317 from eric7 import Preferences
318 from eric7.EricWidgets.EricApplication import ericApp
320 319
321 toolsPath = "" 320 toolsPath = ""
322 321
323 # step 1: check, if the user has configured a tools path 322 # step 1: check, if the user has configured a tools path
324 if version == 5: 323 if version == 5:
330 329
331 # step 2: determine from used Python interpreter (pylupdate is test object) 330 # step 2: determine from used Python interpreter (pylupdate is test object)
332 if not toolsPath: 331 if not toolsPath:
333 program = "pylupdate{0}".format(version) 332 program = "pylupdate{0}".format(version)
334 if venvName: 333 if venvName:
335 from eric7.EricWidgets.EricApplication import ericApp
336
337 venvManager = ericApp().getObject("VirtualEnvManager") 334 venvManager = ericApp().getObject("VirtualEnvManager")
338 dirName = venvManager.getVirtualenvDirectory(venvName) 335 dirName = venvManager.getVirtualenvDirectory(venvName)
339 else: 336 else:
340 dirName = os.path.dirname(sys.executable) 337 dirName = os.path.dirname(sys.executable)
341 338
382 379
383 # step 2: try the qt6_applications package 380 # step 2: try the qt6_applications package
384 if not binPath: 381 if not binPath:
385 with contextlib.suppress(ImportError): 382 with contextlib.suppress(ImportError):
386 # if qt6-applications is not installed just go to the next step 383 # if qt6-applications is not installed just go to the next step
387 import qt6_applications 384 import qt6_applications # __IGNORE_WARNING_I10__
388 385
389 if libexec: 386 if libexec:
390 binPath = os.path.join( 387 binPath = os.path.join(
391 os.path.dirname(qt6_applications.__file__), "Qt", "libexec" 388 os.path.dirname(qt6_applications.__file__), "Qt", "libexec"
392 ) 389 )
618 @return string indicating the supported web browser variant ("QtWebEngine", 615 @return string indicating the supported web browser variant ("QtWebEngine",
619 or "None") 616 or "None")
620 @rtype str 617 @rtype str
621 """ 618 """
622 try: 619 try:
623 from eric7.eric7config import getConfig 620 from eric7.eric7config import getConfig # __IGNORE_WARNING_I101__
624 except ImportError: 621 except ImportError:
625 from eric7config import getConfig 622 from eric7config import getConfig # __IGNORE_WARNING_I10__
626 623
627 scriptPath = os.path.join(getConfig("ericDir"), "Tools", "webBrowserSupport.py") 624 scriptPath = os.path.join(getConfig("ericDir"), "Tools", "webBrowserSupport.py")
628 proc = QProcess() 625 proc = QProcess()
629 proc.start(getPythonExecutable(), [scriptPath, qVersion()]) 626 proc.start(getPythonExecutable(), [scriptPath, qVersion()])
630 variant = ( 627 variant = (

eric ide

mercurial