PluginCxFreeze.py

branch
eric7
changeset 142
9ceff8a10455
parent 140
9e20ee9c7ca2
child 144
b70e8a0c5a91
--- a/PluginCxFreeze.py	Tue Oct 25 09:03:43 2022 +0200
+++ b/PluginCxFreeze.py	Wed Dec 21 09:03:33 2022 +0100
@@ -10,20 +10,26 @@
 import os
 import platform
 
-from PyQt6.QtCore import QObject, QTranslator, QCoreApplication, QProcess
+from PyQt6.QtCore import QCoreApplication, QObject, QProcess, QTranslator
 from PyQt6.QtWidgets import QDialog
 
-from eric7 import Utilities
 from eric7.EricGui.EricAction import EricAction
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 
+try:
+    from eric7.SystemUtilities.OSUtilities import getEnvironmentEntry, isWindowsPlatform
+except ImportError:
+    # imports for eric < 23.1
+    from eric7.Globals import isWindowsPlatform
+    from eric7.Utilities import getEnvironmentEntry
+
 # Start-of-Header
 name = "CxFreeze Plugin"
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "10.1.0"
+version = "10.2.0"
 className = "CxFreezePlugin"
 packageName = "CxFreeze"
 shortDescription = "Show the CxFreeze dialogs."
@@ -86,7 +92,7 @@
         return []
 
     executables = set()
-    if Utilities.isWindowsPlatform():
+    if isWindowsPlatform():
         #
         # Windows
         #
@@ -152,7 +158,7 @@
         if not executables and majorVersion >= 3:
             # check the PATH environment variable if nothing was found
             # Python 3 only
-            path = Utilities.getEnvironmentEntry("PATH")
+            path = getEnvironmentEntry("PATH")
             if path:
                 dirs = path.split(os.pathsep)
                 for directory in dirs:
@@ -169,7 +175,7 @@
             scriptSuffixes.append("-python{0}.{1}".format(majorVersion, minorVersion))
         # There could be multiple cxfreeze executables in the path
         # e.g. for different python variants
-        path = Utilities.getEnvironmentEntry("PATH")
+        path = getEnvironmentEntry("PATH")
         # environment variable not defined
         if path is None:
             return []
@@ -218,7 +224,7 @@
 
     exePy3 = _findExecutable(3)
     if exePy3 == []:
-        if Utilities.isWindowsPlatform():
+        if isWindowsPlatform():
             error = QCoreApplication.translate(
                 "CxFreezePlugin",
                 "The cxfreeze.bat executable could not be found."

eric ide

mercurial