Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly. eric7

Sun, 30 Jun 2024 17:58:31 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 30 Jun 2024 17:58:31 +0200
branch
eric7
changeset 10806
2f6df822e3b9
parent 10805
c114e9476034
child 10807
4bcd4e08418f

Moved some functions to the EricUtilities package for consistency and adapted the code base accordingly.

src/eric7/CondaInterface/CondaExecDialog.py file | annotate | diff | comparison | revisions
src/eric7/Debugger/BreakPointViewer.py file | annotate | diff | comparison | revisions
src/eric7/Debugger/CallTraceViewer.py file | annotate | diff | comparison | revisions
src/eric7/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
src/eric7/EricNetwork/EricSslCertificatesDialog.py file | annotate | diff | comparison | revisions
src/eric7/EricNetwork/EricSslErrorHandler.py file | annotate | diff | comparison | revisions
src/eric7/EricUtilities/__init__.py file | annotate | diff | comparison | revisions
src/eric7/EricWidgets/EricErrorMessage.py file | annotate | diff | comparison | revisions
src/eric7/Globals/__init__.py file | annotate | diff | comparison | revisions
src/eric7/Graphics/ApplicationDiagramBuilder.py file | annotate | diff | comparison | revisions
src/eric7/Graphics/AssociationItem.py file | annotate | diff | comparison | revisions
src/eric7/Graphics/ClassItem.py file | annotate | diff | comparison | revisions
src/eric7/Graphics/ImportsDiagramBuilder.py file | annotate | diff | comparison | revisions
src/eric7/Graphics/PackageDiagramBuilder.py file | annotate | diff | comparison | revisions
src/eric7/Graphics/PackageItem.py file | annotate | diff | comparison | revisions
src/eric7/Graphics/UMLClassDiagramBuilder.py file | annotate | diff | comparison | revisions
src/eric7/HexEdit/HexEditGotoWidget.py file | annotate | diff | comparison | revisions
src/eric7/HexEdit/HexEditMainWindow.py file | annotate | diff | comparison | revisions
src/eric7/HexEdit/HexEditWidget.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/CircuitPythonDevices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/EspDevices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/GenericMicroPythonDevices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/MicrobitDevices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/PyBoardDevices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/RP2040Devices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/STLinkDevices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/Devices/TeensyDevices.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/MicroPythonFileManagerWidget.py file | annotate | diff | comparison | revisions
src/eric7/MicroPython/WifiDialogs/WifiController.py file | annotate | diff | comparison | revisions
src/eric7/Network/IRC/IrcNetworkManager.py file | annotate | diff | comparison | revisions
src/eric7/PdfViewer/PdfViewerWindow.py file | annotate | diff | comparison | revisions
src/eric7/PipInterface/PipPackagesWidget.py file | annotate | diff | comparison | revisions
src/eric7/PluginManager/PluginManager.py file | annotate | diff | comparison | revisions
src/eric7/PluginManager/PluginRepositoryDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/PluginTranslator.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/PluginVcsGit.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/PluginVcsMercurial.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/PluginVcsPySvn.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/PluginVcsSubversion.py file | annotate | diff | comparison | revisions
src/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditCommitEditor.py file | annotate | diff | comparison | revisions
src/eric7/Preferences/__init__.py file | annotate | diff | comparison | revisions
src/eric7/Project/Project.py file | annotate | diff | comparison | revisions
src/eric7/QScintilla/Editor.py file | annotate | diff | comparison | revisions
src/eric7/QScintilla/Lexers/SubstyledLexer.py file | annotate | diff | comparison | revisions
src/eric7/QScintilla/MiniEditor.py file | annotate | diff | comparison | revisions
src/eric7/Testing/TestingWidget.py file | annotate | diff | comparison | revisions
src/eric7/UI/FindFileWidget.py file | annotate | diff | comparison | revisions
src/eric7/UI/UserInterface.py file | annotate | diff | comparison | revisions
src/eric7/ViewManager/ViewManager.py file | annotate | diff | comparison | revisions
src/eric7/VirtualEnv/VirtualenvUpgradeConfigurationDialog.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/CookieJar/CookieJar.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/FeaturePermissions/FeaturePermissionManager.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/Network/NetworkManager.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/SearchWidget.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/WebBrowserLanguagesDialog.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/WebBrowserPage.py file | annotate | diff | comparison | revisions
src/eric7/WebBrowser/WebBrowserView.py file | annotate | diff | comparison | revisions
--- a/src/eric7/CondaInterface/CondaExecDialog.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/CondaInterface/CondaExecDialog.py	Sun Jun 30 17:58:31 2024 +0200
@@ -12,7 +12,7 @@
 from PyQt6.QtCore import QProcess, QTimer, pyqtSlot
 from PyQt6.QtWidgets import QAbstractButton, QDialog, QDialogButtonBox
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricMessageBox
 
 from .Ui_CondaExecDialog import Ui_CondaExecDialog
@@ -201,7 +201,7 @@
                 self.progressBar.setMaximum(jsonDict["maxval"])
                 self.progressBar.setValue(jsonDict["progress"])
                 filename = jsonDict["fetch"].strip()
-                filesize = Globals.dataString(int(jsonDict["maxval"]))
+                filesize = EricUtilities.dataString(int(jsonDict["maxval"]))
 
             self.progressLabel.setText(
                 self.tr("{0} (Size: {1})").format(filename, filesize)
--- a/src/eric7/Debugger/BreakPointViewer.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Debugger/BreakPointViewer.py	Sun Jun 30 17:58:31 2024 +0200
@@ -12,7 +12,7 @@
 from PyQt6.QtCore import QItemSelectionModel, QSortFilterProxyModel, Qt, pyqtSignal
 from PyQt6.QtWidgets import QAbstractItemView, QDialog, QHeaderView, QMenu, QTreeView
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.Globals import recentNameBreakpointConditions, recentNameBreakpointFiles
 
@@ -519,14 +519,14 @@
         fnHistory.append("")
         rs = Preferences.Prefs.rsettings.value(recentNameBreakpointFiles)
         if rs is not None:
-            recent = [f for f in Preferences.toList(rs) if pathlib.Path(f).exists()]
+            recent = [f for f in EricUtilities.toList(rs) if pathlib.Path(f).exists()]
             fnHistory.extend(recent[: Preferences.getDebugger("RecentNumber")])
 
         # load recently entered condition expressions
         condHistory = []
         rs = Preferences.Prefs.rsettings.value(recentNameBreakpointConditions)
         if rs is not None:
-            condHistory = Preferences.toList(rs)[
+            condHistory = EricUtilities.toList(rs)[
                 : Preferences.getDebugger("RecentNumber")
             ]
 
--- a/src/eric7/Debugger/CallTraceViewer.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Debugger/CallTraceViewer.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 from PyQt6.QtCore import Qt, pyqtSignal, pyqtSlot
 from PyQt6.QtWidgets import QTreeWidgetItem, QWidget
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
@@ -67,13 +67,13 @@
         self.__project = None
         self.__tracedDebuggerId = ""
 
-        stopOnExit = Preferences.toBool(
+        stopOnExit = EricUtilities.toBool(
             Preferences.getSettings().value("CallTrace/StopOnExit", True)
         )
         self.stopCheckBox.setChecked(stopOnExit)
 
         self.__callTraceEnabled = (
-            Preferences.toBool(
+            EricUtilities.toBool(
                 Preferences.getSettings().value("CallTrace/Enabled", False)
             )
             and not stopOnExit
--- a/src/eric7/Debugger/DebugUI.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Debugger/DebugUI.py	Sun Jun 30 17:58:31 2024 +0200
@@ -16,7 +16,7 @@
 from PyQt6.QtGui import QKeySequence
 from PyQt6.QtWidgets import QApplication, QDialog, QMenu, QToolBar
 
-from eric7 import Preferences, Utilities
+from eric7 import EricUtilities, Preferences, Utilities
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricAction import EricAction, createActionGroup
 from eric7.EricWidgets import EricMessageBox
@@ -87,47 +87,47 @@
         self.lastUsedVenvName = Preferences.getSettings().value(
             "DebugInfo/VirtualEnvironment", ""
         )
-        self.scriptsHistory = Preferences.toList(
+        self.scriptsHistory = EricUtilities.toList(
             Preferences.getSettings().value("DebugInfo/ScriptsHistory")
         )
-        self.argvHistory = Preferences.toList(
+        self.argvHistory = EricUtilities.toList(
             Preferences.getSettings().value("DebugInfo/ArgumentsHistory")
         )
-        self.wdHistory = Preferences.toList(
+        self.wdHistory = EricUtilities.toList(
             Preferences.getSettings().value("DebugInfo/WorkingDirectoryHistory")
         )
-        self.envHistory = Preferences.toList(
+        self.envHistory = EricUtilities.toList(
             Preferences.getSettings().value("DebugInfo/EnvironmentHistory")
         )
-        self.excList = Preferences.toList(
+        self.excList = EricUtilities.toList(
             Preferences.getSettings().value("DebugInfo/Exceptions")
         )
-        self.excIgnoreList = Preferences.toList(
+        self.excIgnoreList = EricUtilities.toList(
             Preferences.getSettings().value("DebugInfo/IgnoredExceptions")
         )
-        self.autoClearShell = Preferences.toBool(
+        self.autoClearShell = EricUtilities.toBool(
             Preferences.getSettings().value("DebugInfo/AutoClearShell", True)
         )
-        self.tracePython = Preferences.toBool(
+        self.tracePython = EricUtilities.toBool(
             Preferences.getSettings().value("DebugInfo/TracePython", False)
         )
-        self.autoContinue = Preferences.toBool(
+        self.autoContinue = EricUtilities.toBool(
             Preferences.getSettings().value("DebugInfo/AutoContinue", True)
         )
-        self.reportAllExceptions = Preferences.toBool(
+        self.reportAllExceptions = EricUtilities.toBool(
             Preferences.getSettings().value("DebugInfo/ReportAllExceptions", False)
         )
-        self.enableMultiprocess = Preferences.toBool(
+        self.enableMultiprocess = EricUtilities.toBool(
             Preferences.getSettings().value("DebugInfo/EnableMultiprocess", False)
         )
-        self.multiprocessNoDebugHistory = Preferences.toList(
+        self.multiprocessNoDebugHistory = EricUtilities.toList(
             Preferences.getSettings().value("DebugInfo/MultiprocessNoDebugHistory")
         )
         self.overrideGlobalConfig = {
-            "enable": Preferences.toBool(
+            "enable": EricUtilities.toBool(
                 Preferences.getSettings().value("DebugInfo/OverrideGlobal", False)
             ),
-            "redirect": Preferences.toBool(
+            "redirect": EricUtilities.toBool(
                 Preferences.getSettings().value("DebugInfo/RedirectStdinStdout", True)
             ),
         }
@@ -1714,7 +1714,7 @@
         # get recently used breakpoint conditions
         rs = Preferences.Prefs.rsettings.value(recentNameBreakpointConditions)
         condHistory = (
-            Preferences.toList(rs)[: Preferences.getDebugger("RecentNumber")]
+            EricUtilities.toList(rs)[: Preferences.getDebugger("RecentNumber")]
             if rs is not None
             else []
         )
--- a/src/eric7/EricNetwork/EricSslCertificatesDialog.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/EricNetwork/EricSslCertificatesDialog.py	Sun Jun 30 17:58:31 2024 +0200
@@ -16,7 +16,7 @@
 with contextlib.suppress(ImportError):
     from PyQt6.QtNetwork import QSslCertificate, QSslConfiguration, QSsl
 
-from eric7 import Globals, Preferences, Utilities
+from eric7 import EricUtilities, Preferences, Utilities
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 
@@ -57,7 +57,7 @@
         """
         Private slot to populate the server certificates tree.
         """
-        certificateDict = Globals.toDict(
+        certificateDict = EricUtilities.toDict(
             Preferences.getSettings().value("Ssl/CaCertificatesDict")
         )
         for server in certificateDict:
@@ -168,7 +168,7 @@
                 )
 
             # delete the certificate from the user certificate store
-            certificateDict = Globals.toDict(
+            certificateDict = EricUtilities.toDict(
                 Preferences.getSettings().value("Ssl/CaCertificatesDict")
             )
             if server in certificateDict:
@@ -199,7 +199,7 @@
         certs = self.__importCertificate()
         if certs:
             server = "*"
-            certificateDict = Globals.toDict(
+            certificateDict = EricUtilities.toDict(
                 Preferences.getSettings().value("Ssl/CaCertificatesDict")
             )
             if server in certificateDict:
@@ -254,7 +254,7 @@
         Private method to update the default SSL configuration.
         """
         caList = self.__getSystemCaCertificates()
-        certificateDict = Globals.toDict(
+        certificateDict = EricUtilities.toDict(
             Preferences.getSettings().value("Ssl/CaCertificatesDict")
         )
         for server in certificateDict:
@@ -273,7 +273,7 @@
         @rtype list of QSslCertificate
         """
         caList = QSslCertificate.fromData(
-            Globals.toByteArray(
+            EricUtilities.toByteArray(
                 Preferences.getSettings().value("Help/SystemCertificates")
             )
         )
--- a/src/eric7/EricNetwork/EricSslErrorHandler.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/EricNetwork/EricSslErrorHandler.py	Sun Jun 30 17:58:31 2024 +0200
@@ -14,7 +14,7 @@
 from PyQt6.QtCore import QByteArray, QObject
 from PyQt6.QtNetwork import QSsl, QSslCertificate, QSslConfiguration, QSslError
 
-from eric7 import Globals, Preferences, Utilities
+from eric7 import EricUtilities, Preferences, Utilities
 from eric7.EricWidgets import EricMessageBox
 from eric7.SystemUtilities import OSUtilities
 
@@ -49,7 +49,7 @@
         caList = self.__getSystemCaCertificates()
         if Preferences.getSettings().contains("Help/CaCertificatesDict"):
             # port old entries stored under 'Help'
-            certificateDict = Globals.toDict(
+            certificateDict = EricUtilities.toDict(
                 Preferences.getSettings().value("Help/CaCertificatesDict")
             )
             Preferences.getSettings().setValue(
@@ -57,7 +57,7 @@
             )
             Preferences.getSettings().remove("Help/CaCertificatesDict")
         else:
-            certificateDict = Globals.toDict(
+            certificateDict = EricUtilities.toDict(
                 Preferences.getSettings().value("Ssl/CaCertificatesDict")
             )
         for server in certificateDict:
@@ -126,7 +126,7 @@
         @rtype tuple of (EricSslErrorState, bool)
         """
         caMerge = {}
-        certificateDict = Globals.toDict(
+        certificateDict = EricUtilities.toDict(
             Preferences.getSettings().value("Ssl/CaCertificatesDict")
         )
         for caServer in certificateDict:
@@ -266,7 +266,7 @@
         @rtype list of QSslCertificate
         """
         caList = QSslCertificate.fromData(
-            Globals.toByteArray(
+            EricUtilities.toByteArray(
                 Preferences.getSettings().value("Ssl/SystemCertificates")
             )
         )
--- a/src/eric7/EricUtilities/__init__.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/EricUtilities/__init__.py	Sun Jun 30 17:58:31 2024 +0200
@@ -4,5 +4,238 @@
 #
 
 """
-Package containing utility modules.
+Package containing utility modules and functions.
 """
+
+import semver
+
+from PyQt6.QtCore import QByteArray, QCoreApplication
+
+###############################################################################
+## Functions for converting QSetting return types to valid types.
+###############################################################################
+
+
+def toBool(value):
+    """
+    Function to convert a value to bool.
+
+    @param value value to be converted
+    @type str
+    @return converted data
+    @rtype bool
+    """
+    if (isinstance(value, str) and value.lower() in ["true", "1", "yes"]) or (
+        isinstance(value, bytes) and value.lower() in [b"true", b"1", b"yes"]
+    ):
+        return True
+    elif (isinstance(value, str) and value.lower() in ["false", "0", "no"]) or (
+        isinstance(value, bytes) and value.lower() in [b"false", b"0", b"no"]
+    ):
+        return False
+    else:
+        return bool(value)
+
+
+def toList(value):
+    """
+    Function to convert a value to a list.
+
+    @param value value to be converted
+    @type None, list or Any
+    @return converted data
+    @rtype list
+    """
+    if value is None:
+        return []
+    elif not isinstance(value, list):
+        return [value]
+    else:
+        return value
+
+
+def toByteArray(value):
+    """
+    Function to convert a value to a byte array.
+
+    @param value value to be converted
+    @type QByteArray or None
+    @return converted data
+    @rtype QByteArray
+    """
+    if value is None:
+        return QByteArray()
+    else:
+        return value
+
+
+def toDict(value):
+    """
+    Function to convert a value to a dictionary.
+
+    @param value value to be converted
+    @type dict or None
+    @return converted data
+    @rtype dict
+    """
+    if value is None:
+        return {}
+    else:
+        return value
+
+
+###############################################################################
+## Functions for version handling.
+###############################################################################
+
+
+def versionIsValid(version):
+    """
+    Function to check, if the given version string is valid.
+
+    @param version version string
+    @type str
+    @return flag indicating validity
+    @rtype bool
+    """
+    try:
+        return semver.VersionInfo.is_valid(version)
+    except AttributeError:
+        return semver.VersionInfo.isvalid(version)
+
+
+def versionToTuple(version):
+    """
+    Function to convert a version string into a tuple.
+
+    Note: A version string consists of non-negative decimals separated by "."
+    optionally followed by a suffix. Suffix is everything after the last
+    decimal.
+
+    @param version version string
+    @type str
+    @return version named tuple containing the version parts
+    @rtype semver.VersionInfo
+    """
+    while version and not version[0].isdecimal():
+        # sanitize version string (get rid of leading non-decimal characters)
+        version = version[1:]
+
+    while len(version.split(".")) < 3:
+        # ensure the version string contains at least three parts
+        version += ".0"
+
+    if versionIsValid(version):
+        return semver.VersionInfo.parse(version)
+    else:
+        return semver.VersionInfo(0, 0, 0)
+
+
+###############################################################################
+## Functions for extended string handling.
+###############################################################################
+
+
+def strGroup(txt, sep, groupLen=4):
+    """
+    Function to group a string into sub-strings separated by a
+    separator.
+
+    @param txt text to be grouped
+    @type str
+    @param sep separator string
+    @type str
+    @param groupLen length of each group
+    @type int
+    @return result string
+    @rtype str
+    """
+    groups = []
+
+    while len(txt) // groupLen != 0:
+        groups.insert(0, txt[-groupLen:])
+        txt = txt[:-groupLen]
+    if len(txt) > 0:
+        groups.insert(0, txt)
+    return sep.join(groups)
+
+
+def strToQByteArray(txt):
+    """
+    Function to convert a Python string into a QByteArray.
+
+    @param txt Python string to be converted
+    @type str, bytes, bytearray
+    @return converted QByteArray
+    @rtype QByteArray
+    """
+    if isinstance(txt, str):
+        txt = txt.encode("utf-8")
+
+    return QByteArray(txt)
+
+
+def dataString(size, loc=None):
+    """
+    Function to generate a formatted size string.
+
+    @param size size to be formatted
+    @type int
+    @param loc locale to be used for localized size strings (defaults to None)
+    @type QLocale (optional)
+    @return formatted data string
+    @rtype str
+    """
+    if loc is None:
+        if size < 1024:
+            return QCoreApplication.translate("EricUtilities", "{0:4d} Bytes").format(
+                size
+            )
+        elif size < 1024 * 1024:
+            size /= 1024
+            return QCoreApplication.translate("EricUtilities", "{0:4.2f} KiB").format(
+                size
+            )
+        elif size < 1024 * 1024 * 1024:
+            size /= 1024 * 1024
+            return QCoreApplication.translate("EricUtilities", "{0:4.2f} MiB").format(
+                size
+            )
+        elif size < 1024 * 1024 * 1024 * 1024:
+            size /= 1024 * 1024 * 1024
+            return QCoreApplication.translate("EricUtilities", "{0:4.2f} GiB").format(
+                size
+            )
+        else:
+            size /= 1024 * 1024 * 1024 * 1024
+            return QCoreApplication.translate("EricUtilities", "{0:4.2f} TiB").format(
+                size
+            )
+    else:
+        if not isinstance(size, float):
+            size = float(size)
+
+        if size < 1024:
+            return QCoreApplication.translate("EricUtilities", "{0} Bytes").format(
+                loc.toString(size)
+            )
+        elif size < 1024 * 1024:
+            size /= 1024
+            return QCoreApplication.translate("EricUtilities", "{0} KiB").format(
+                loc.toString(size, "f", 2)
+            )
+        elif size < 1024 * 1024 * 1024:
+            size /= 1024 * 1024
+            return QCoreApplication.translate("EricUtilities", "{0} MiB").format(
+                loc.toString(size, "f", 2)
+            )
+        elif size < 1024 * 1024 * 1024 * 1024:
+            size /= 1024 * 1024 * 1024
+            return QCoreApplication.translate("EricUtilities", "{0} GiB").format(
+                loc.toString(size, "f", 2)
+            )
+        else:
+            size /= 1024 * 1024 * 1024 * 1024
+            return QCoreApplication.translate("EricUtilities", "{0} TiB").format(
+                loc.toString(size, "f", 2)
+            )
--- a/src/eric7/EricWidgets/EricErrorMessage.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/EricWidgets/EricErrorMessage.py	Sun Jun 30 17:58:31 2024 +0200
@@ -20,7 +20,7 @@
 )
 from PyQt6.QtWidgets import QDialog, QErrorMessage
 
-from eric7 import Globals, Preferences, Utilities
+from eric7 import EricUtilities, Globals, Preferences, Utilities
 from eric7.EricWidgets.EricApplication import ericApp
 
 _msgHandlerDialog = None
@@ -59,7 +59,9 @@
     """
     return any(
         filterStr in message
-        for filterStr in Globals.toList(_filterSettings.value("MessageFilters", []))
+        for filterStr in EricUtilities.toList(
+            _filterSettings.value("MessageFilters", [])
+        )
         + _defaultFilters
     )
 
@@ -100,7 +102,7 @@
         from .EricErrorMessageFilterDialog import EricErrorMessageFilterDialog
 
         dlg = EricErrorMessageFilterDialog(
-            Globals.toList(_filterSettings.value("MessageFilters", []))
+            EricUtilities.toList(_filterSettings.value("MessageFilters", []))
         )
         if dlg.exec() == QDialog.DialogCode.Accepted:
             filters = dlg.getFilters()
--- a/src/eric7/Globals/__init__.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Globals/__init__.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,10 +13,19 @@
 
 import os
 
-import semver
+from PyQt6.QtCore import QProcess, qVersion
 
-from PyQt6.QtCore import QByteArray, QCoreApplication, QProcess, qVersion
-
+from eric7.EricUtilities import (  # noqa
+    dataString,
+    strGroup,
+    strToQByteArray,
+    toBool,
+    toByteArray,
+    toDict,
+    toList,
+    versionIsValid,
+    versionToTuple,
+)
 from eric7.SystemUtilities import PythonUtilities
 
 try:
@@ -94,222 +103,6 @@
 
 
 ###############################################################################
-## functions for version handling
-###############################################################################
-
-
-def versionIsValid(version):
-    """
-    Function to check, if the given version string is valid.
-
-    @param version version string
-    @type str
-    @return flag indicating validity
-    @rtype bool
-    """
-    try:
-        return semver.VersionInfo.is_valid(version)
-    except AttributeError:
-        return semver.VersionInfo.isvalid(version)
-
-
-def versionToTuple(version):
-    """
-    Module function to convert a version string into a tuple.
-
-    Note: A version string consists of non-negative decimals separated by "."
-    optionally followed by a suffix. Suffix is everything after the last
-    decimal.
-
-    @param version version string
-    @type str
-    @return version named tuple containing the version parts
-    @rtype semver.VersionInfo
-    """
-    while version and not version[0].isdecimal():
-        # sanitize version string (get rid of leading non-decimal characters)
-        version = version[1:]
-
-    while len(version.split(".")) < 3:
-        # ensure the version string contains at least three parts
-        version += ".0"
-
-    if versionIsValid(version):
-        return semver.VersionInfo.parse(version)
-    else:
-        return semver.VersionInfo(0, 0, 0)
-
-
-###############################################################################
-## functions for extended string handling
-###############################################################################
-
-
-def strGroup(txt, sep, groupLen=4):
-    """
-    Module function to group a string into sub-strings separated by a
-    separator.
-
-    @param txt text to be grouped
-    @type str
-    @param sep separator string
-    @type str
-    @param groupLen length of each group
-    @type int
-    @return result string
-    @rtype str
-    """
-    groups = []
-
-    while len(txt) // groupLen != 0:
-        groups.insert(0, txt[-groupLen:])
-        txt = txt[:-groupLen]
-    if len(txt) > 0:
-        groups.insert(0, txt)
-    return sep.join(groups)
-
-
-def strToQByteArray(txt):
-    """
-    Module function to convert a Python string into a QByteArray.
-
-    @param txt Python string to be converted
-    @type str, bytes, bytearray
-    @return converted QByteArray
-    @rtype QByteArray
-    """
-    if isinstance(txt, str):
-        txt = txt.encode("utf-8")
-
-    return QByteArray(txt)
-
-
-def dataString(size, loc=None):
-    """
-    Module function to generate a formatted size string.
-
-    @param size size to be formatted
-    @type int
-    @param loc locale to be used for localized size strings (defaults to None)
-    @type QLocale (optional)
-    @return formatted data string
-    @rtype str
-    """
-    if loc is None:
-        if size < 1024:
-            return QCoreApplication.translate("Globals", "{0:4d} Bytes").format(size)
-        elif size < 1024 * 1024:
-            size /= 1024
-            return QCoreApplication.translate("Globals", "{0:4.2f} KiB").format(size)
-        elif size < 1024 * 1024 * 1024:
-            size /= 1024 * 1024
-            return QCoreApplication.translate("Globals", "{0:4.2f} MiB").format(size)
-        elif size < 1024 * 1024 * 1024 * 1024:
-            size /= 1024 * 1024 * 1024
-            return QCoreApplication.translate("Globals", "{0:4.2f} GiB").format(size)
-        else:
-            size /= 1024 * 1024 * 1024 * 1024
-            return QCoreApplication.translate("Globals", "{0:4.2f} TiB").format(size)
-    else:
-        if not isinstance(size, float):
-            size = float(size)
-
-        if size < 1024:
-            return QCoreApplication.translate("Globals", "{0} Bytes").format(
-                loc.toString(size)
-            )
-        elif size < 1024 * 1024:
-            size /= 1024
-            return QCoreApplication.translate("Globals", "{0} KiB").format(
-                loc.toString(size, "f", 2)
-            )
-        elif size < 1024 * 1024 * 1024:
-            size /= 1024 * 1024
-            return QCoreApplication.translate("Globals", "{0} MiB").format(
-                loc.toString(size, "f", 2)
-            )
-        elif size < 1024 * 1024 * 1024 * 1024:
-            size /= 1024 * 1024 * 1024
-            return QCoreApplication.translate("Globals", "{0} GiB").format(
-                loc.toString(size, "f", 2)
-            )
-        else:
-            size /= 1024 * 1024 * 1024 * 1024
-            return QCoreApplication.translate("Globals", "{0} TiB").format(
-                loc.toString(size, "f", 2)
-            )
-
-
-###############################################################################
-## functions for converting QSetting return types to valid types
-###############################################################################
-
-
-def toBool(value):
-    """
-    Module function to convert a value to bool.
-
-    @param value value to be converted
-    @type str
-    @return converted data
-    @rtype bool
-    """
-    if value in ["True", "true", "1", "Yes", "yes"]:
-        return True
-    elif value in ["False", "false", "0", "No", "no"]:
-        return False
-    else:
-        return bool(value)
-
-
-def toList(value):
-    """
-    Module function to convert a value to a list.
-
-    @param value value to be converted
-    @type None, list or Any
-    @return converted data
-    @rtype list
-    """
-    if value is None:
-        return []
-    elif not isinstance(value, list):
-        return [value]
-    else:
-        return value
-
-
-def toByteArray(value):
-    """
-    Module function to convert a value to a byte array.
-
-    @param value value to be converted
-    @type QByteArray or None
-    @return converted data
-    @rtype QByteArray
-    """
-    if value is None:
-        return QByteArray()
-    else:
-        return value
-
-
-def toDict(value):
-    """
-    Module function to convert a value to a dictionary.
-
-    @param value value to be converted
-    @type dict or None
-    @return converted data
-    @rtype dict
-    """
-    if value is None:
-        return {}
-    else:
-        return value
-
-
-###############################################################################
 ## functions for web browser variant detection
 ###############################################################################
 
--- a/src/eric7/Graphics/ApplicationDiagramBuilder.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Graphics/ApplicationDiagramBuilder.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 
 from PyQt6.QtWidgets import QApplication, QInputDialog
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricProgressDialog import EricProgressDialog
@@ -494,7 +494,7 @@
             if res:
                 self.project.openProject(projectFile)
 
-        self.noModules = Globals.toBool(parts[1].split("=", 1)[1].strip())
+        self.noModules = EricUtilities.toBool(parts[1].split("=", 1)[1].strip())
 
         self.initialize()
 
--- a/src/eric7/Graphics/AssociationItem.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Graphics/AssociationItem.py	Sun Jun 30 17:58:31 2024 +0200
@@ -12,7 +12,7 @@
 from PyQt6.QtCore import QLineF, QPointF, QRectF
 from PyQt6.QtWidgets import QGraphicsItem
 
-from eric7 import Globals
+from eric7 import EricUtilities
 from eric7.EricGraphics.EricArrowItem import EricArrowItem, EricArrowType
 
 
@@ -596,7 +596,7 @@
                 elif key == "type":
                     assocType = AssociationType(int(value))
                 elif key == "topToBottom":
-                    topToBottom = Globals.toBool(value)
+                    topToBottom = EricUtilities.toBool(value)
 
         return src, dst, assocType, topToBottom
 
--- a/src/eric7/Graphics/ClassItem.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Graphics/ClassItem.py	Sun Jun 30 17:58:31 2024 +0200
@@ -11,7 +11,7 @@
 from PyQt6.QtGui import QFont
 from PyQt6.QtWidgets import QGraphicsSimpleTextItem, QStyle
 
-from eric7 import Globals
+from eric7 import EricUtilities
 
 from .UMLItem import UMLItem, UMLModel
 
@@ -338,9 +338,9 @@
         for part in parts:
             key, value = part.split("=", 1)
             if key == "is_external":
-                self.external = Globals.toBool(value.strip())
+                self.external = EricUtilities.toBool(value.strip())
             elif key == "no_attributes":
-                self.noAttrs = Globals.toBool(value.strip())
+                self.noAttrs = EricUtilities.toBool(value.strip())
             elif key == "name":
                 name = value.strip()
             elif key == "attributes":
--- a/src/eric7/Graphics/ImportsDiagramBuilder.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Graphics/ImportsDiagramBuilder.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 
 from PyQt6.QtWidgets import QApplication, QGraphicsTextItem
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricProgressDialog import EricProgressDialog
 from eric7.SystemUtilities import FileSystemUtilities
@@ -394,7 +394,9 @@
             return False
 
         self.packagePath = parts[0].split("=", 1)[1].strip()
-        self.showExternalImports = Globals.toBool(parts[1].split("=", 1)[1].strip())
+        self.showExternalImports = EricUtilities.toBool(
+            parts[1].split("=", 1)[1].strip()
+        )
 
         self.initialize()
 
--- a/src/eric7/Graphics/PackageDiagramBuilder.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Graphics/PackageDiagramBuilder.py	Sun Jun 30 17:58:31 2024 +0200
@@ -15,7 +15,7 @@
 
 from PyQt6.QtWidgets import QApplication, QGraphicsTextItem
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricProgressDialog import EricProgressDialog
 from eric7.SystemUtilities import FileSystemUtilities
@@ -586,7 +586,7 @@
             return False
 
         self.package = parts[0].split("=", 1)[1].strip()
-        self.noAttrs = Globals.toBool(parts[1].split("=", 1)[1].strip())
+        self.noAttrs = EricUtilities.toBool(parts[1].split("=", 1)[1].strip())
 
         self.initialize()
 
--- a/src/eric7/Graphics/PackageItem.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Graphics/PackageItem.py	Sun Jun 30 17:58:31 2024 +0200
@@ -10,7 +10,7 @@
 from PyQt6.QtGui import QFont
 from PyQt6.QtWidgets import QGraphicsSimpleTextItem, QStyle
 
-from eric7 import Globals
+from eric7 import EricUtilities
 
 from .UMLItem import UMLItem, UMLModel
 
@@ -232,7 +232,7 @@
         for part in parts:
             key, value = part.split("=", 1)
             if key == "no_modules":
-                self.external = Globals.toBool(value.strip())
+                self.external = EricUtilities.toBool(value.strip())
             elif key == "name":
                 name = value.strip()
             elif key == "modules":
--- a/src/eric7/Graphics/UMLClassDiagramBuilder.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Graphics/UMLClassDiagramBuilder.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 
 from PyQt6.QtWidgets import QGraphicsTextItem
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.SystemUtilities import FileSystemUtilities
 
 from .UMLDiagramBuilder import UMLDiagramBuilder
@@ -356,7 +356,7 @@
             return False
 
         self.file = parts[0].split("=", 1)[1].strip()
-        self.noAttrs = Globals.toBool(parts[1].split("=", 1)[1].strip())
+        self.noAttrs = EricUtilities.toBool(parts[1].split("=", 1)[1].strip())
 
         self.initialize()
 
--- a/src/eric7/HexEdit/HexEditGotoWidget.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/HexEdit/HexEditGotoWidget.py	Sun Jun 30 17:58:31 2024 +0200
@@ -11,7 +11,7 @@
 from PyQt6.QtGui import QRegularExpressionValidator
 from PyQt6.QtWidgets import QWidget
 
-from eric7 import Globals
+from eric7 import EricUtilities
 from eric7.EricGui import EricPixmapCache
 
 from .Ui_HexEditGotoWidget import Ui_HexEditGotoWidget
@@ -173,7 +173,7 @@
             # step 2: convert the integer to text using the new format
             if newFormat == "hex":
                 txt = "{0:x}".format(index)
-                txt = Globals.strGroup(txt, ":", 4)
+                txt = EricUtilities.strGroup(txt, ":", 4)
             else:
                 txt = "{0:d}".format(index)
 
--- a/src/eric7/HexEdit/HexEditMainWindow.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/HexEdit/HexEditMainWindow.py	Sun Jun 30 17:58:31 2024 +0200
@@ -23,7 +23,7 @@
     QWidget,
 )
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricAction import EricAction
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
@@ -1657,7 +1657,7 @@
         Preferences.Prefs.rsettings.sync()
         rs = Preferences.Prefs.rsettings.value(recentNameHexFiles)
         if rs is not None:
-            for f in Preferences.toList(rs):
+            for f in EricUtilities.toList(rs):
                 if FileSystemUtilities.isRemoteFileName(f) or pathlib.Path(f).exists():
                     self.__recent.append(f)
 
--- a/src/eric7/HexEdit/HexEditWidget.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/HexEdit/HexEditWidget.py	Sun Jun 30 17:58:31 2024 +0200
@@ -22,7 +22,7 @@
 from PyQt6.QtGui import QFont, QKeySequence, QPainter, QPalette
 from PyQt6.QtWidgets import QAbstractScrollArea, QApplication
 
-from eric7 import Globals
+from eric7 import EricUtilities
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.SystemUtilities import OSUtilities
 
@@ -1339,7 +1339,7 @@
                     address = "{0:0{1}x}".format(
                         self.__bPosFirst + row * self.BYTES_PER_LINE, self.__addrDigits
                     )
-                    address = Globals.strGroup(address, ":", 4)
+                    address = EricUtilities.strGroup(address, ":", 4)
                     painter.drawText(self.__pxPosAdrX - pxOfsX, pxPosY, address)
                     # increment loop variables
                     row += 1
--- a/src/eric7/MicroPython/Devices/CircuitPythonDevices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/CircuitPythonDevices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -17,7 +17,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QInputDialog, QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor, EricOverridenCursor
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
@@ -591,7 +591,7 @@
         """
         latestUrl = reply.url().toString()
         tag = latestUrl.rsplit("/", 1)[-1]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         cpyVersionStr = self.tr("unknown")
         cpyVersion = (0, 0, 0)
@@ -601,7 +601,7 @@
                 with open(bootFile, "r") as f:
                     line = f.readline()
                 cpyVersionStr = line.split(";")[0].split()[2]
-                cpyVersion = Globals.versionToTuple(cpyVersionStr)
+                cpyVersion = EricUtilities.versionToTuple(cpyVersionStr)
         if (
             cpyVersion == (0, 0, 0)
             and self._deviceData
@@ -610,7 +610,7 @@
             # drive is not mounted or 'boot_out.txt' is missing but the device
             # is connected via the serial console
             cpyVersionStr = self._deviceData["mpy_version"]
-            cpyVersion = Globals.versionToTuple(cpyVersionStr)
+            cpyVersion = EricUtilities.versionToTuple(cpyVersionStr)
 
         msg = self.tr(
             "<h4>CircuitPython Version Information</h4>"
@@ -1015,7 +1015,7 @@
 
         workspace = self.getWorkspace()
 
-        if Globals.versionToTuple(self._deviceData["release"]) >= (8, 0, 0):
+        if EricUtilities.versionToTuple(self._deviceData["release"]) >= (8, 0, 0):
             # CircuitPython >= 8.0.0: generate 'settings.toml' file
             contents = (
                 'CIRCUITPY_WIFI_SSID = "{0}"\nCIRCUITPY_WIFI_PASSWORD = "{1}"\n'
@@ -1585,7 +1585,7 @@
 
         workspace = self.getWorkspace()
 
-        if Globals.versionToTuple(self._deviceData["release"]) >= (8, 0, 0):
+        if EricUtilities.versionToTuple(self._deviceData["release"]) >= (8, 0, 0):
             # CircuitPython >= 8.0.0: generate 'settings.toml' file
             newConfig = (
                 {
@@ -1664,7 +1664,7 @@
 
         workspace = self.getWorkspace()
 
-        if Globals.versionToTuple(self._deviceData["release"]) >= (8, 0, 0):
+        if EricUtilities.versionToTuple(self._deviceData["release"]) >= (8, 0, 0):
             # CircuitPython >= 8.0.0: generate 'settings.toml' file
             newConfig = {
                 "WIZNET_IFCONFIG_0": "",
--- a/src/eric7/MicroPython/Devices/EspDevices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/EspDevices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -17,7 +17,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QDialog, QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
@@ -413,14 +413,14 @@
         while tag and not tag[0].isdecimal():
             # get rid of leading non-decimal characters
             tag = tag[1:]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         if self._deviceData["mpy_version"] == "unknown":
             currentVersionStr = self.tr("unknown")
             currentVersion = (0, 0, 0)
         else:
             currentVersionStr = self._deviceData["mpy_version"]
-            currentVersion = Globals.versionToTuple(currentVersionStr)
+            currentVersion = EricUtilities.versionToTuple(currentVersionStr)
 
         if self._deviceData["mpy_name"] == "circuitpython":
             kind = "CircuitPython"
--- a/src/eric7/MicroPython/Devices/GenericMicroPythonDevices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/GenericMicroPythonDevices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -14,7 +14,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.SystemUtilities import FileSystemUtilities
@@ -291,7 +291,7 @@
         while tag and not tag[0].isdecimal():
             # get rid of leading non-decimal characters
             tag = tag[1:]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         if self._deviceData["mpy_version"] == "unknown":
             currentVersionStr = self.tr("unknown")
@@ -302,7 +302,7 @@
                 if bool(self._deviceData["mpy_variant_version"])
                 else self._deviceData["mpy_version"]
             )
-            currentVersion = Globals.versionToTuple(currentVersionStr)
+            currentVersion = EricUtilities.versionToTuple(currentVersionStr)
 
         msg = self.tr(
             "<h4>MicroPython Version Information</h4>"
--- a/src/eric7/MicroPython/Devices/MicrobitDevices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/MicrobitDevices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -17,7 +17,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.SystemUtilities import FileSystemUtilities
@@ -446,14 +446,14 @@
         while tag and not tag[0].isdecimal():
             # get rid of leading non-decimal characters
             tag = tag[1:]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         if self._deviceData["release"] == "unknown":
             currentVersionStr = self.tr("unknown")
             currentVersion = (0, 0, 0)
         else:
             currentVersionStr = self._deviceData["release"]
-            currentVersion = Globals.versionToTuple(currentVersionStr)
+            currentVersion = EricUtilities.versionToTuple(currentVersionStr)
 
         if self._deviceData["mpy_name"] == "circuitpython":
             kind = "CircuitPython"
--- a/src/eric7/MicroPython/Devices/PyBoardDevices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/PyBoardDevices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricProcessDialog import EricProcessDialog
@@ -469,14 +469,14 @@
         while tag and not tag[0].isdecimal():
             # get rid of leading non-decimal characters
             tag = tag[1:]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         if self._deviceData["mpy_version"] == "unknown":
             currentVersionStr = self.tr("unknown")
             currentVersion = (0, 0, 0)
         else:
             currentVersionStr = self._deviceData["mpy_version"]
-            currentVersion = Globals.versionToTuple(currentVersionStr)
+            currentVersion = EricUtilities.versionToTuple(currentVersionStr)
 
         msg = self.tr(
             "<h4>MicroPython Version Information</h4>"
--- a/src/eric7/MicroPython/Devices/RP2040Devices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/RP2040Devices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -17,7 +17,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QDialog, QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
@@ -290,7 +290,7 @@
         while tag and not tag[0].isdecimal():
             # get rid of leading non-decimal characters
             tag = tag[1:]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         if self._deviceData["mpy_version"] == "unknown":
             currentVersionStr = self.tr("unknown")
@@ -301,7 +301,7 @@
                 if bool(self._deviceData["mpy_variant_version"])
                 else self._deviceData["mpy_version"]
             )
-            currentVersion = Globals.versionToTuple(currentVersionStr)
+            currentVersion = EricUtilities.versionToTuple(currentVersionStr)
 
         msg = self.tr(
             "<h4>MicroPython Version Information</h4>"
--- a/src/eric7/MicroPython/Devices/STLinkDevices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/STLinkDevices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricProcessDialog import EricProcessDialog
@@ -438,14 +438,14 @@
         while tag and not tag[0].isdecimal():
             # get rid of leading non-decimal characters
             tag = tag[1:]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         if self._deviceData["mpy_version"] == "unknown":
             currentVersionStr = self.tr("unknown")
             currentVersion = (0, 0, 0)
         else:
             currentVersionStr = self._deviceData["mpy_version"]
-            currentVersion = Globals.versionToTuple(currentVersionStr)
+            currentVersion = EricUtilities.versionToTuple(currentVersionStr)
 
         msg = self.tr(
             "<h4>MicroPython Version Information</h4>"
--- a/src/eric7/MicroPython/Devices/TeensyDevices.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/Devices/TeensyDevices.py	Sun Jun 30 17:58:31 2024 +0200
@@ -11,7 +11,7 @@
 from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest
 from PyQt6.QtWidgets import QMenu
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
 
@@ -213,14 +213,14 @@
         while tag and not tag[0].isdecimal():
             # get rid of leading non-decimal characters
             tag = tag[1:]
-        latestVersion = Globals.versionToTuple(tag)
+        latestVersion = EricUtilities.versionToTuple(tag)
 
         if self._deviceData["mpy_version"] == "unknown":
             currentVersionStr = self.tr("unknown")
             currentVersion = (0, 0, 0)
         else:
             currentVersionStr = self._deviceData["mpy_version"]
-            currentVersion = Globals.versionToTuple(currentVersionStr)
+            currentVersion = EricUtilities.versionToTuple(currentVersionStr)
 
         msg = self.tr(
             "<h4>MicroPython Version Information</h4>"
--- a/src/eric7/MicroPython/MicroPythonFileManagerWidget.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/MicroPythonFileManagerWidget.py	Sun Jun 30 17:58:31 2024 +0200
@@ -22,7 +22,7 @@
     QWidget,
 )
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets import EricMessageBox, EricPathPickerDialog
 from eric7.EricWidgets.EricApplication import ericApp
@@ -1557,9 +1557,9 @@
                     "</table>"
                 ).format(
                     name,
-                    Globals.dataString(totalSize),
-                    Globals.dataString(usedSize),
-                    Globals.dataString(freeSize),
+                    EricUtilities.dataString(totalSize),
+                    EricUtilities.dataString(usedSize),
+                    EricUtilities.dataString(freeSize),
                 )
         else:
             msg += self.tr(
--- a/src/eric7/MicroPython/WifiDialogs/WifiController.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/MicroPython/WifiDialogs/WifiController.py	Sun Jun 30 17:58:31 2024 +0200
@@ -10,7 +10,7 @@
 from PyQt6.QtCore import QObject, pyqtSlot
 from PyQt6.QtWidgets import QDialog, QMenu
 
-from eric7 import Globals
+from eric7 import EricUtilities
 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor
 from eric7.EricWidgets import EricMessageBox
 
@@ -207,7 +207,7 @@
                 if self.__mpy.getDevice().hasCircuitPython():
                     # CircuitPython will reset for the REPL, so no auto-connect
                     # available.
-                    if Globals.versionToTuple(
+                    if EricUtilities.versionToTuple(
                         self.__mpy.getDevice().getDeviceData("release")
                     ) >= (8, 0, 0):
                         EricMessageBox.information(
--- a/src/eric7/Network/IRC/IrcNetworkManager.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Network/IRC/IrcNetworkManager.py	Sun Jun 30 17:58:31 2024 +0200
@@ -11,7 +11,7 @@
 
 from PyQt6.QtCore import QCoreApplication, QObject, pyqtSignal
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.SystemUtilities import OSUtilities
 from eric7.Utilities.AutoSaver import AutoSaver
 from eric7.Utilities.crypto import pwConvert
@@ -80,7 +80,7 @@
         """
         self.__ident = settings.value("Ident", OSUtilities.getUserName())
         self.__realName = settings.value("RealName", "")
-        self.__nickNames = Preferences.toList(settings.value("NickNames", []))
+        self.__nickNames = EricUtilities.toList(settings.value("NickNames", []))
         self.__serviceName = settings.value("ServiceName", "")
         self.__password = settings.value("Password", "")
         self.__quitMessage = settings.value(
@@ -89,7 +89,7 @@
         self.__partMessage = settings.value(
             "PartMessage", IrcIdentity.DefaultPartMessage
         )
-        self.__rememberPosOnAway = Preferences.toBool(
+        self.__rememberPosOnAway = EricUtilities.toBool(
             settings.value("RememberAwayPosition", True)
         )
         self.__awayMessage = settings.value(
@@ -350,7 +350,7 @@
         """
         self.__server = settings.value("Name", "")
         self.__port = int(settings.value("Port", IrcServer.DefaultPort))
-        self.__ssl = Preferences.toBool(settings.value("SSL", False))
+        self.__ssl = EricUtilities.toBool(settings.value("SSL", False))
         self.__password = settings.value("Password", "")
 
     def getName(self):
@@ -463,7 +463,7 @@
         @type QSettings
         """
         self.__key = settings.value("Key", "")
-        self.__autoJoin = Preferences.toBool(settings.value("AutoJoin", False))
+        self.__autoJoin = EricUtilities.toBool(settings.value("AutoJoin", False))
 
     def getName(self):
         """
@@ -563,7 +563,7 @@
         @type QSettings
         """
         self.__identity = settings.value("Identity", "")
-        self.__autoConnect = Preferences.toBool(settings.value("AutoConnect", False))
+        self.__autoConnect = EricUtilities.toBool(settings.value("AutoConnect", False))
 
         settings.beginGroup("Server")
         self.__server = IrcServer("")
--- a/src/eric7/PdfViewer/PdfViewerWindow.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/PdfViewer/PdfViewerWindow.py	Sun Jun 30 17:58:31 2024 +0200
@@ -35,7 +35,7 @@
     QWhatsThis,
 )
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricAction import EricAction
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
@@ -1305,7 +1305,7 @@
         Preferences.Prefs.rsettings.sync()
         rs = Preferences.Prefs.rsettings.value(recentNamePdfFiles)
         if rs is not None:
-            for f in Preferences.toList(rs):
+            for f in EricUtilities.toList(rs):
                 if pathlib.Path(f).exists():
                     self.__recent.append(f)
 
--- a/src/eric7/PipInterface/PipPackagesWidget.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/PipInterface/PipPackagesWidget.py	Sun Jun 30 17:58:31 2024 +0200
@@ -28,7 +28,7 @@
     QWidget,
 )
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor
 from eric7.EricWidgets import EricMessageBox
@@ -363,7 +363,7 @@
                 "pip", Qt.MatchFlag.MatchExactly | Qt.MatchFlag.MatchCaseSensitive
             )
             if len(pipList) > 0:
-                pipVersionTuple = Globals.versionToTuple(
+                pipVersionTuple = EricUtilities.versionToTuple(
                     pipList[0].text(PipPackagesWidget.InstalledVersionColumn)
                 )
 
--- a/src/eric7/PluginManager/PluginManager.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/PluginManager/PluginManager.py	Sun Jun 30 17:58:31 2024 +0200
@@ -23,7 +23,7 @@
 from PyQt6.QtGui import QPixmap
 from PyQt6.QtNetwork import QNetworkAccessManager, QNetworkReply, QNetworkRequest
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Globals, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricNetwork.EricNetworkProxyFactory import proxyAuthenticationRequired
 from eric7.EricWidgets import EricMessageBox
@@ -1438,8 +1438,8 @@
                 self.__updateAvailable = True
             return
 
-        versionTuple = Globals.versionToTuple(version)[:3]
-        pluginVersionTuple = Globals.versionToTuple(pluginDetails["version"])[:3]
+        versionTuple = EricUtilities.versionToTuple(version)[:3]
+        pluginVersionTuple = EricUtilities.versionToTuple(pluginDetails["version"])[:3]
 
         if pluginVersionTuple < versionTuple:
             self.__updateAvailable = True
@@ -1466,7 +1466,7 @@
                 aversion = "0.0.0"
             zipFile.close()
 
-            aversionTuple = Globals.versionToTuple(aversion)[:3]
+            aversionTuple = EricUtilities.versionToTuple(aversion)[:3]
             if aversionTuple != versionTuple:
                 self.__updateAvailable = True
 
--- a/src/eric7/PluginManager/PluginRepositoryDialog.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/PluginManager/PluginRepositoryDialog.py	Sun Jun 30 17:58:31 2024 +0200
@@ -45,7 +45,7 @@
     QWidget,
 )
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Globals, Preferences
 from eric7.EricGui import EricPixmapCache
 from eric7.EricNetwork.EricNetworkProxyFactory import proxyAuthenticationRequired
 from eric7.EricWidgets import EricMessageBox
@@ -886,8 +886,10 @@
                 return PluginStatus.New
             if pluginDetails["error"]:
                 return PluginStatus.Error
-            pluginVersionTuple = Globals.versionToTuple(pluginDetails["version"])[:3]
-            versionTuple = Globals.versionToTuple(version)[:3]
+            pluginVersionTuple = EricUtilities.versionToTuple(pluginDetails["version"])[
+                :3
+            ]
+            versionTuple = EricUtilities.versionToTuple(version)[:3]
             if pluginVersionTuple < versionTuple:
                 return PluginStatus.RemoteUpdate
             else:
@@ -915,8 +917,8 @@
             if pluginDetails is None:
                 return PluginStatus.LocalUpdate
             if (
-                Globals.versionToTuple(pluginDetails["version"])[:3]
-                < Globals.versionToTuple(version)[:3]
+                EricUtilities.versionToTuple(pluginDetails["version"])[:3]
+                < EricUtilities.versionToTuple(version)[:3]
             ):
                 return PluginStatus.LocalUpdate
             else:
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/CodeStyleCheckerDialog.py	Sun Jun 30 17:58:31 2024 +0200
@@ -27,7 +27,7 @@
     QTreeWidgetItem,
 )
 
-from eric7 import Preferences, Utilities
+from eric7 import EricUtilities, Preferences, Utilities
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.QScintilla.Editor import EditorWarningKind
@@ -1694,7 +1694,7 @@
             settings.value("PEP8/IncludeMessages", defaultParameters["IncludeMessages"])
         )
         self.repeatCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/RepeatMessages", defaultParameters["RepeatMessages"]
                 )
@@ -1707,12 +1707,12 @@
             settings.value("PEP8/NoFixCodes", defaultParameters["NoFixCodes"])
         )
         self.fixIssuesCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value("PEP8/FixIssues", defaultParameters["FixIssues"])
             )
         )
         self.ignoredCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value("PEP8/ShowIgnored", defaultParameters["ShowIgnored"])
             )
         )
@@ -1743,7 +1743,7 @@
             )
         )
         self.hangClosingCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value("PEP8/HangClosing", defaultParameters["HangClosing"])
             )
         )
@@ -1791,14 +1791,14 @@
             settings.value("PEP8/FutureChecker", defaultParameters["FutureChecker"])
         )
         self.__initBuiltinsIgnoreList(
-            Preferences.toDict(
+            EricUtilities.toDict(
                 settings.value(
                     "PEP8/BuiltinsChecker", defaultParameters["BuiltinsChecker"]
                 )
             )
         )
         self.aggressiveCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/AggressiveSearch",
                     defaultParameters["CommentedCodeChecker"]["Aggressive"],
@@ -1806,7 +1806,7 @@
             )
         )
         self.__initCommentedCodeCheckerWhiteList(
-            Preferences.toList(
+            EricUtilities.toList(
                 settings.value(
                     "PEP8/CommentedCodeWhitelist",
                     defaultParameters["CommentedCodeChecker"]["WhiteList"],
@@ -1840,7 +1840,7 @@
             )
         )
         self.suppressNoneReturningCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/SuppressNoneReturning",
                     defaultParameters["AnnotationsChecker"]["SuppressNoneReturning"],
@@ -1848,7 +1848,7 @@
             )
         )
         self.suppressDummyArgsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/SuppressDummyArgs",
                     defaultParameters["AnnotationsChecker"]["SuppressDummyArgs"],
@@ -1856,7 +1856,7 @@
             )
         )
         self.allowUntypedDefsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/AllowUntypedDefs",
                     defaultParameters["AnnotationsChecker"]["AllowUntypedDefs"],
@@ -1864,7 +1864,7 @@
             )
         )
         self.allowUntypedNestedCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/AllowUntypedNested",
                     defaultParameters["AnnotationsChecker"]["AllowUntypedNested"],
@@ -1872,7 +1872,7 @@
             )
         )
         self.mypyInitReturnCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/MypyInitReturn",
                     defaultParameters["AnnotationsChecker"]["MypyInitReturn"],
@@ -1880,7 +1880,7 @@
             )
         )
         self.allowStarArgAnyCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/AllowStarArgAny",
                     defaultParameters["AnnotationsChecker"]["AllowStarArgAny"],
@@ -1888,7 +1888,7 @@
             )
         )
         self.forceFutureAnnotationsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/ForceFutureAnnotations",
                     defaultParameters["AnnotationsChecker"]["ForceFutureAnnotations"],
@@ -1896,7 +1896,7 @@
             )
         )
         self.simplifiedTypesCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/CheckFutureAnnotations",
                     defaultParameters["AnnotationsChecker"]["CheckFutureAnnotations"],
@@ -1904,7 +1904,7 @@
             )
         )
         self.typeIgnoreCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/RespectTypeIgnore",
                     defaultParameters["AnnotationsChecker"]["RespectTypeIgnore"],
@@ -1913,7 +1913,7 @@
         )
         self.dispatchDecoratorEdit.setText(
             ", ".join(
-                Preferences.toList(
+                EricUtilities.toList(
                     settings.value(
                         "PEP8/DispatchDecorators",
                         defaultParameters["AnnotationsChecker"]["DispatchDecorators"],
@@ -1923,7 +1923,7 @@
         )
         self.overloadDecoratorEdit.setText(
             ", ".join(
-                Preferences.toList(
+                EricUtilities.toList(
                     settings.value(
                         "PEP8/OverloadDecorators",
                         defaultParameters["AnnotationsChecker"]["OverloadDecorators"],
@@ -1933,7 +1933,7 @@
         )
         self.exemptedTypingSymbolsEdit.setText(
             ", ".join(
-                Preferences.toList(
+                EricUtilities.toList(
                     settings.value(
                         "PEP8/ExemptedTypingSymbols",
                         defaultParameters["AnnotationsChecker"][
@@ -1947,7 +1947,7 @@
         # Security Checker
         self.tmpDirectoriesEdit.setPlainText(
             "\n".join(
-                Preferences.toList(
+                EricUtilities.toList(
                     settings.value(
                         "PEP8/HardcodedTmpDirectories",
                         defaultParameters["SecurityChecker"]["HardcodedTmpDirectories"],
@@ -1957,7 +1957,7 @@
         )
         self.hashesEdit.setText(
             ", ".join(
-                Preferences.toList(
+                EricUtilities.toList(
                     settings.value(
                         "PEP8/InsecureHashes",
                         defaultParameters["SecurityChecker"]["InsecureHashes"],
@@ -1967,7 +1967,7 @@
         )
         self.insecureSslProtocolsEdit.setPlainText(
             "\n".join(
-                Preferences.toList(
+                EricUtilities.toList(
                     settings.value(
                         "PEP8/InsecureSslProtocolVersions",
                         defaultParameters["SecurityChecker"][
@@ -2014,7 +2014,7 @@
             )
         )
         self.typedExceptionsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/CheckTypedException",
                     defaultParameters["SecurityChecker"]["CheckTypedException"],
@@ -2026,7 +2026,7 @@
         self.appPackagesEdit.setPlainText(
             " ".join(
                 sorted(
-                    Preferences.toList(
+                    EricUtilities.toList(
                         settings.value(
                             "PEP8/ApplicationPackageNames",
                             defaultParameters["ImportsChecker"][
@@ -2040,7 +2040,7 @@
         self.bannedModulesEdit.setPlainText(
             " ".join(
                 sorted(
-                    Preferences.toList(
+                    EricUtilities.toList(
                         settings.value(
                             "PEP8/BannedModules",
                             defaultParameters["ImportsChecker"]["BannedModules"],
@@ -2065,7 +2065,7 @@
             )
         )
         self.sortCaseSensitiveCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/SortCaseSensitive",
                     defaultParameters["NameOrderChecker"]["SortCaseSensitive"],
@@ -2073,7 +2073,7 @@
             )
         )
         self.combinedAsImpotsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/CombinedAsImports",
                     defaultParameters["NameOrderChecker"]["CombinedAsImports"],
@@ -2081,7 +2081,7 @@
             )
         )
         self.sortIgnoreStyleCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/SortIgnoringStyle",
                     defaultParameters["NameOrderChecker"]["SortIgnoringStyle"],
@@ -2089,7 +2089,7 @@
             )
         )
         self.sortFromFirstCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/SortFromFirst",
                     defaultParameters["NameOrderChecker"]["SortFromFirst"],
@@ -2099,7 +2099,7 @@
 
         # Unused Checker
         self.ignoreAbstractCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreAbstract",
                     defaultParameters["UnusedChecker"]["IgnoreAbstract"],
@@ -2107,7 +2107,7 @@
             )
         )
         self.ignoreOverloadCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreOverload",
                     defaultParameters["UnusedChecker"]["IgnoreOverload"],
@@ -2115,7 +2115,7 @@
             )
         )
         self.ignoreOverrideCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreOverride",
                     defaultParameters["UnusedChecker"]["IgnoreOverride"],
@@ -2123,7 +2123,7 @@
             )
         )
         self.ignoreStubsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreStubs",
                     defaultParameters["UnusedChecker"]["IgnoreStubs"],
@@ -2131,7 +2131,7 @@
             )
         )
         self.ignoreVariadicNamesCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreVariadicNames",
                     defaultParameters["UnusedChecker"]["IgnoreVariadicNames"],
@@ -2139,7 +2139,7 @@
             )
         )
         self.ignoreLambdasCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreLambdas",
                     defaultParameters["UnusedChecker"]["IgnoreLambdas"],
@@ -2147,7 +2147,7 @@
             )
         )
         self.ignoreNestedFunctionsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreNestedFunctions",
                     defaultParameters["UnusedChecker"]["IgnoreNestedFunctions"],
@@ -2155,7 +2155,7 @@
             )
         )
         self.ignoreDunderMethodsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreDunderMethods",
                     defaultParameters["UnusedChecker"]["IgnoreDunderMethods"],
@@ -2163,7 +2163,7 @@
             )
         )
         self.ignoreSlotsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreSlotMethods",
                     defaultParameters["UnusedChecker"]["IgnoreSlotMethods"],
@@ -2171,7 +2171,7 @@
             )
         )
         self.ignoreEventHandlersCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PEP8/UnusedIgnoreEventHandlerMethods",
                     defaultParameters["UnusedChecker"]["IgnoreEventHandlerMethods"],
@@ -2179,7 +2179,7 @@
             )
         )
         self.ignoreDunderGlobalsCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 settings.value(
                     "PRP8/UnusedIgnoreDunderGlobals",
                     defaultParameters["UnusedChecker"]["IgnoreDunderGlobals"],
--- a/src/eric7/Plugins/PluginTranslator.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Plugins/PluginTranslator.py	Sun Jun 30 17:58:31 2024 +0200
@@ -11,7 +11,7 @@
 
 from PyQt6.QtCore import QCoreApplication, QObject, pyqtSignal
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.__version__ import VersionOnly
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.Plugins.UiExtensionPlugins.Translator.Translator import Translator
@@ -204,13 +204,13 @@
         @rtype Any
         """
         if key in ("EnabledLanguages"):
-            return Preferences.toList(
+            return EricUtilities.toList(
                 Preferences.getSettings().value(
                     self.PreferencesKey + "/" + key, self.__defaults[key]
                 )
             )
         elif key in ("GoogleEnableDictionary", "MultimediaEnabled"):
-            return Preferences.toBool(
+            return EricUtilities.toBool(
                 Preferences.getSettings().value(
                     self.PreferencesKey + "/" + key, self.__defaults[key]
                 )
--- a/src/eric7/Plugins/PluginVcsGit.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Plugins/PluginVcsGit.py	Sun Jun 30 17:58:31 2024 +0200
@@ -12,7 +12,7 @@
 
 from PyQt6.QtCore import QByteArray, QCoreApplication, QObject
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.__version__ import VersionOnly
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.Plugins.VcsPlugins.vcsGit.GitUtilities import getConfigPath
@@ -285,7 +285,7 @@
             "FindCopiesHarder",
             "AggressiveGC",
         ]:
-            return Preferences.toBool(
+            return EricUtilities.toBool(
                 Preferences.getSettings().value("Git/" + key, cls.GitDefaults[key])
             )
         elif key in ["LogLimit", "CommitIdLength", "LogSubjectColumnWidth"]:
@@ -293,7 +293,7 @@
                 Preferences.getSettings().value("Git/" + key, cls.GitDefaults[key])
             )
         elif key in ["Commits", "RepositoryUrlHistory"]:
-            return Preferences.toList(Preferences.getSettings().value("Git/" + key))
+            return EricUtilities.toList(Preferences.getSettings().value("Git/" + key))
         elif key in ["LogBrowserGeometry", "StatusDialogGeometry"]:
             v = Preferences.getSettings().value("Git/" + key)
             if v is not None:
--- a/src/eric7/Plugins/PluginVcsMercurial.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Plugins/PluginVcsMercurial.py	Sun Jun 30 17:58:31 2024 +0200
@@ -12,7 +12,7 @@
 
 from PyQt6.QtCore import QByteArray, QCoreApplication, QObject
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.__version__ import VersionOnly
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.Plugins.VcsPlugins.vcsMercurial.HgUtilities import (
@@ -289,7 +289,7 @@
             "ConsiderHidden",
             "LogBrowserShowFullLog",
         ):
-            return Preferences.toBool(
+            return EricUtilities.toBool(
                 Preferences.getSettings().value(
                     "Mercurial/" + key, cls.MercurialDefaults[key]
                 )
@@ -306,7 +306,7 @@
                 )
             )
         elif key in ("Commits", "CommitAuthors", "RepositoryUrlHistory"):
-            return Preferences.toList(
+            return EricUtilities.toList(
                 Preferences.getSettings().value(
                     "Mercurial/" + key, cls.MercurialDefaults[key]
                 )
--- a/src/eric7/Plugins/PluginVcsPySvn.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Plugins/PluginVcsPySvn.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 
 from PyQt6.QtCore import QCoreApplication, QObject
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.__version__ import VersionOnly
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.Plugins.VcsPlugins.vcsPySvn.SvnUtilities import getConfigPath, getServersPath
@@ -248,7 +248,7 @@
         @rtype Any
         """
         if key in ["StopLogOnCopy"]:
-            return Preferences.toBool(
+            return EricUtilities.toBool(
                 Preferences.getSettings().value(
                     "Subversion/" + key, self.__subversionDefaults[key]
                 )
@@ -260,7 +260,7 @@
                 )
             )
         elif key in ["Commits"]:
-            return Preferences.toList(
+            return EricUtilities.toList(
                 Preferences.getSettings().value("Subversion/" + key)
             )
         else:
--- a/src/eric7/Plugins/PluginVcsSubversion.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Plugins/PluginVcsSubversion.py	Sun Jun 30 17:58:31 2024 +0200
@@ -12,7 +12,7 @@
 
 from PyQt6.QtCore import QCoreApplication, QObject
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.__version__ import VersionOnly
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.Plugins.VcsPlugins.vcsSubversion.SvnUtilities import (
@@ -257,7 +257,7 @@
         @rtype Any
         """
         if key in ["StopLogOnCopy"]:
-            return Preferences.toBool(
+            return EricUtilities.toBool(
                 Preferences.getSettings().value(
                     "Subversion/" + key, self.__subversionDefaults[key]
                 )
@@ -269,7 +269,7 @@
                 )
             )
         elif key in ["Commits"]:
-            return Preferences.toList(
+            return EricUtilities.toList(
                 Preferences.getSettings().value("Subversion/" + key)
             )
         else:
--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditCommitEditor.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditCommitEditor.py	Sun Jun 30 17:58:31 2024 +0200
@@ -10,7 +10,7 @@
 from PyQt6.QtCore import QCoreApplication, pyqtSlot
 from PyQt6.QtWidgets import QDialog
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricMessageBox
 from eric7.UI_HgHisteditCommitEditor import Ui_HgHisteditCommitEditor
 
@@ -36,7 +36,7 @@
         self.__fileName = fileName
         self.__readFile()
 
-        self.recentCommitMessages = Preferences.toList(
+        self.recentCommitMessages = EricUtilities.toList(
             Preferences.getSettings().value("Mercurial/Commits")
         )
         self.recentComboBox.clear()
--- a/src/eric7/Preferences/__init__.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Preferences/__init__.py	Sun Jun 30 17:58:31 2024 +0200
@@ -47,8 +47,9 @@
 except ImportError:
     QWebEngineSettings = None
 
-from eric7 import Globals
+from eric7 import EricUtilities, Globals
 from eric7.EricNetwork.EricFtp import EricFtpProxyType
+from eric7.EricUtilities import toBool, toByteArray, toDict, toList  # noqa
 from eric7.EricWidgets import EricFileDialog
 from eric7.EricWidgets.EricApplication import ericApp
 from eric7.EricWidgets.EricIconBar import EricIconBar
@@ -1959,7 +1960,7 @@
     @return flag indicating the configured status
     @rtype bool
     """
-    return toBool(Prefs.settings.value("General/Configured", False))
+    return EricUtilities.toBool(Prefs.settings.value("General/Configured", False))
 
 
 def setConfigured():
@@ -2047,13 +2048,13 @@
         "NetworkPortIncrement",
         "PythonCallTraceOptimization",
     ):
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("Debugger/" + key, Prefs.debuggerDefaults[key])
         )
     elif key in ("PassiveDbgPort", "MaxVariableSize", "RecentNumber", "NetworkPort"):
         return int(Prefs.settings.value("Debugger/" + key, Prefs.debuggerDefaults[key]))
     elif key in ["AllowedHosts"]:
-        return toList(
+        return EricUtilities.toList(
             Prefs.settings.value("Debugger/" + key, Prefs.debuggerDefaults[key])
         )
     elif key in ["PythonInterpreter", "Python3Interpreter"]:
@@ -2139,7 +2140,9 @@
     ):
         return QColor(Prefs.settings.value("Python/" + key, Prefs.pythonDefaults[key]))
     elif key in ("DisViewerExpandCodeInfoDetails"):
-        return toBool(Prefs.settings.value("Python/" + key, Prefs.pythonDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("Python/" + key, Prefs.pythonDefaults[key])
+        )
     else:
         return Prefs.settings.value("Python/" + key, Prefs.pythonDefaults[key])
 
@@ -2263,7 +2266,9 @@
         "CombinedLeftRightSidebar",
         "LoadUnknownMimeTypeFiles",
     ]:
-        return toBool(Prefs.settings.value("UI/" + key, Prefs.uiDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("UI/" + key, Prefs.uiDefaults[key])
+        )
     elif key in [
         "TabViewManagerFilenameLength",
         "CaptionFilenameLength",
@@ -2336,7 +2341,9 @@
         "TextMimeTypes",
         "TextFilePatterns",
     ]:
-        return toList(Prefs.settings.value("UI/" + key, Prefs.uiDefaults[key]))
+        return EricUtilities.toList(
+            Prefs.settings.value("UI/" + key, Prefs.uiDefaults[key])
+        )
     else:
         return Prefs.settings.value("UI/" + key, Prefs.uiDefaults[key])
 
@@ -2390,9 +2397,13 @@
     @rtype Any
     """
     if key in ("Path",):
-        return toList(Prefs.settings.value("UI/Icons/" + key, Prefs.iconsDefaults[key]))
+        return EricUtilities.toList(
+            Prefs.settings.value("UI/Icons/" + key, Prefs.iconsDefaults[key])
+        )
     elif key in ("PreferVectorIcons",):
-        return toBool(Prefs.settings.value("UI/Icons/" + key, Prefs.iconsDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("UI/Icons/" + key, Prefs.iconsDefaults[key])
+        )
     else:
         return Prefs.settings.value("UI/Icons/" + key, Prefs.iconsDefaults[key])
 
@@ -2419,7 +2430,7 @@
     @rtype Any
     """
     if key in ["AutoStartServer", "TryOtherPorts", "AutoAcceptConnections"]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("Cooperation/" + key, Prefs.cooperationDefaults[key])
         )
     elif key in ["ServerPort", "MaxPortsToTry"]:
@@ -2427,7 +2438,7 @@
             Prefs.settings.value("Cooperation/" + key, Prefs.cooperationDefaults[key])
         )
     elif key in ["BannedUsers"]:
-        return toList(
+        return EricUtilities.toList(
             Prefs.settings.value("Cooperation/" + key, Prefs.cooperationDefaults[key])
         )
     else:
@@ -2525,7 +2536,9 @@
         "PreviewQssFileNameExtensions",
         "FullSpellCheckExtensions",
     ]:
-        return toList(Prefs.settings.value("Editor/" + key, Prefs.editorDefaults[key]))
+        return EricUtilities.toList(
+            Prefs.settings.value("Editor/" + key, Prefs.editorDefaults[key])
+        )
     elif key == "TabIndentOverride":
         overrideStr = Prefs.settings.value("Editor/" + key, Prefs.editorDefaults[key])
         if overrideStr:
@@ -2537,7 +2550,9 @@
             int(Prefs.settings.value("Editor/" + key, Prefs.editorDefaults[key]))
         )
     else:
-        return toBool(Prefs.settings.value("Editor/" + key, Prefs.editorDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("Editor/" + key, Prefs.editorDefaults[key])
+        )
 
 
 def setEditor(key, value):
@@ -2777,7 +2792,7 @@
     @return the requested editor setting
     @rtype Any
     """
-    return toBool(
+    return EricUtilities.toBool(
         Prefs.settings.value("Editor/Typing/" + key, Prefs.editorTypingDefaults[key])
     )
 
@@ -2825,7 +2840,7 @@
         "ODT/OnlyStylesUsed",
         "ODT/UseTabs",
     ]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value(
                 "Editor/Exporters/" + key, Prefs.editorExporterDefaults[key]
             )
@@ -2873,7 +2888,7 @@
     @rtype Any
     """
     if key in ["ColorMode", "FirstPageFirst"]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("Printer/" + key, Prefs.printerDefaults[key])
         )
     elif key in ["Magnification", "Orientation", "PageSize", "Resolution"]:
@@ -2925,7 +2940,9 @@
     elif key in ["LastVirtualEnvironment"]:
         return Prefs.settings.value("Shell/" + key, Prefs.shellDefaults[key])
     else:
-        return toBool(Prefs.settings.value("Shell/" + key, Prefs.shellDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("Shell/" + key, Prefs.shellDefaults[key])
+        )
 
 
 def setShell(key, value):
@@ -2957,11 +2974,11 @@
     if key in ["RecentNumber"]:
         return int(Prefs.settings.value("Project/" + key, Prefs.projectDefaults[key]))
     elif key in ["DebugClientsHistory", "DebuggerInterpreterHistory"]:
-        return toList(
+        return EricUtilities.toList(
             Prefs.settings.value("Project/" + key, Prefs.projectDefaults[key])
         )
     else:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("Project/" + key, Prefs.projectDefaults[key])
         )
 
@@ -2999,7 +3016,9 @@
     except KeyError:
         default = list(Prefs.projectBrowsersDefaults["allBrowsers"][:])
 
-    return toList(Prefs.settings.value("Project/BrowsersEnabled/" + key, default))
+    return EricUtilities.toList(
+        Prefs.settings.value("Project/BrowsersEnabled/" + key, default)
+    )
 
 
 def setProjectBrowsers(key, value):
@@ -3078,7 +3097,7 @@
             Prefs.settings.value("MultiProject/" + key, Prefs.multiProjectDefaults[key])
         )
     elif key in ["OpenMainAutomatically", "TimestampFile"]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("MultiProject/" + key, Prefs.multiProjectDefaults[key])
         )
     else:
@@ -3131,7 +3150,9 @@
     if key in ("HelpViewerType",):
         return int(Prefs.settings.value("Help/" + key, Prefs.helpDefaults[key]))
     elif key in ("QtHelpSearchNewOnStart", "ForceQTextBrowser"):
-        return toBool(Prefs.settings.value("Help/" + key, Prefs.helpDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("Help/" + key, Prefs.helpDefaults[key])
+        )
     else:
         return Prefs.settings.value("Help/" + key, Prefs.helpDefaults[key])
 
@@ -3200,7 +3221,7 @@
             if download["URL"] is None:
                 download["URL"] = QUrl()
             download["Location"] = Prefs.settings.value("Location")
-            download["Done"] = toBool(Prefs.settings.value("Done"))
+            download["Done"] = EricUtilities.toBool(Prefs.settings.value("Done"))
             download["PageURL"] = Prefs.settings.value("PageURL")
             if download["PageURL"] is None:
                 download["PageURL"] = QUrl()
@@ -3331,7 +3352,7 @@
         "ReadingFromCanvasEnabled",
         "ForceDarkMode",
     ]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("WebBrowser/" + key, Prefs.webBrowserDefaults[key])
         )
     elif key in [
@@ -3341,7 +3362,7 @@
         "AdBlockExceptions",
         "SpellCheckLanguages",
     ]:
-        return toList(
+        return EricUtilities.toList(
             Prefs.settings.value("WebBrowser/" + key, Prefs.webBrowserDefaults[key])
         )
     elif key in ["AutoScrollDivider"]:
@@ -3493,7 +3514,9 @@
         "PySide2FromImports",
         "PySide6FromImports",
     ]:
-        return toBool(Prefs.settings.value("Qt/" + key, Prefs.qtDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("Qt/" + key, Prefs.qtDefaults[key])
+        )
     else:
         return Prefs.settings.value("Qt/" + key, Prefs.qtDefaults[key])
 
@@ -3535,12 +3558,14 @@
         "SavePasswords",
         "UseGoogleMailOAuth2",
     ]:
-        return toBool(Prefs.settings.value("User/" + key, Prefs.userDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("User/" + key, Prefs.userDefaults[key])
+        )
     elif key == "MailServerEncryption":
         # convert from old key 'MailServerUseTLS'
         val = Prefs.settings.value("User/" + key)
         if val is None:
-            if toBool(Prefs.settings.value("User/MailServerUseTLS")):
+            if EricUtilities.toBool(Prefs.settings.value("User/MailServerUseTLS")):
                 val = "TLS"
             else:
                 val = Prefs.userDefaults[key]
@@ -3578,7 +3603,9 @@
     if key in ["StatusMonitorInterval", "CommitMessages"]:
         return int(Prefs.settings.value("VCS/" + key, Prefs.vcsDefaults[key]))
     else:
-        return toBool(Prefs.settings.value("VCS/" + key, Prefs.vcsDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("VCS/" + key, Prefs.vcsDefaults[key])
+        )
 
 
 def setVCS(key, value):
@@ -3618,7 +3645,9 @@
     elif key in [
         "ClearOnFileClose",
     ]:
-        return toBool(Prefs.settings.value("Tasks/" + key, Prefs.tasksDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("Tasks/" + key, Prefs.tasksDefaults[key])
+        )
     else:
         return Prefs.settings.value("Tasks/" + key, Prefs.tasksDefaults[key])
 
@@ -3663,7 +3692,7 @@
         )
         return f
     else:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("Templates/" + key, Prefs.templatesDefaults[key])
         )
 
@@ -3703,13 +3732,13 @@
             )
         )
     elif key in ["HiddenPlugins"]:
-        return toList(
+        return EricUtilities.toList(
             Prefs.settings.value(
                 "PluginManager/" + key, Prefs.pluginManagerDefaults[key]
             )
         )
     else:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value(
                 "PluginManager/" + key, Prefs.pluginManagerDefaults[key]
             )
@@ -3799,11 +3828,11 @@
     @rtype Any
     """
     if key in ("IncludeInSyntaxCheck", "IgnoreStarImportWarnings"):
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("Py3Flakes/" + key, Prefs.pyflakesDefaults[key])
         )
     elif key in ("AdditionalBuiltins",):
-        return toList(
+        return EricUtilities.toList(
             Prefs.settings.value("Py3Flakes/" + key, Prefs.pyflakesDefaults[key])
         )
     else:
@@ -3867,7 +3896,9 @@
         "MarkPositionWhenHidden",
         "AskOnShutdown",
     ]:
-        return toBool(Prefs.settings.value("IRC/" + key, Prefs.ircDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("IRC/" + key, Prefs.ircDefaults[key])
+        )
     elif key in ["AutoUserInfoMax", "AutoUserInfoInterval"]:
         return int(Prefs.settings.value("IRC/" + key, Prefs.ircDefaults[key]))
     else:
@@ -3906,7 +3937,7 @@
         "OpenReadOnly",
         "HighlightChanges",
     ]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("HexEditor/" + key, Prefs.hexEditorDefaults[key])
         )
     elif key in ["Font"]:
@@ -3977,7 +4008,7 @@
     @rtype Any
     """
     if key in ["ShowInfoOnOpenParenthesis"]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value(
                 "CodeDocumentationViewer/" + key, Prefs.docuViewerDefaults[key]
             )
@@ -4038,7 +4069,9 @@
         "ExcludeCondaEnvironments",
         "VulnerabilityCheckEnabled",
     ):
-        return toBool(Prefs.settings.value("Pip/" + key, Prefs.pipDefaults[key]))
+        return EricUtilities.toBool(
+            Prefs.settings.value("Pip/" + key, Prefs.pipDefaults[key])
+        )
     elif key in ("VulnerabilityDbCacheValidity",):
         return int(Prefs.settings.value("Pip/" + key, Prefs.pipDefaults[key]))
     else:
@@ -4085,7 +4118,7 @@
         "EnableManualDeviceSelection",
         "NtpDaylight",
     ]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("MicroPython/" + key, Prefs.microPythonDefaults[key])
         )
     elif key in (
@@ -4149,7 +4182,7 @@
         "JediCalltipsEnabled",
         "MouseClickEnabled",
     ]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("AssistantJedi/" + key, Prefs.jediDefaults[key])
         )
     else:
@@ -4186,7 +4219,7 @@
         "PdfViewerOpenRecentInNewWindow",
         "PdfSearchHighlightAll",
     ):
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("PdfViewer/" + key, Prefs.pdfViewerDefaults[key])
         )
     elif key in ("PdfViewerZoomFactor",):
@@ -4231,7 +4264,7 @@
             Prefs.settings.value(f"{prefix}{key}", Prefs.ericServerDefaults[key])
         )
     elif key in ("AutostartShell",):
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value(f"{prefix}{key}", Prefs.ericServerDefaults[key])
         )
     elif key in ("ConnectionProfiles",):
@@ -4271,7 +4304,7 @@
     @rtype Any
     """
     if key in ["MainMaximized"]:
-        return toBool(
+        return EricUtilities.toBool(
             Prefs.settings.value("Geometry/" + key, Prefs.geometryDefaults[key])
         )
     else:
@@ -4327,70 +4360,6 @@
             Prefs.settings.setValue("Geometry/" + key, Prefs.geometryDefaults[key])
 
 
-def toBool(value):
-    """
-    Module function to convert a value to bool.
-
-    @param value value to be converted
-    @type Any
-    @return converted data
-    @rtype bool
-    """
-    if value in ["true", "1", "True"]:
-        return True
-    elif value in ["false", "0", "False"]:
-        return False
-    else:
-        return bool(value)
-
-
-def toList(value):
-    """
-    Module function to convert a value to a list.
-
-    @param value value to be converted
-    @type list, None or Any
-    @return converted data
-    @rtype list
-    """
-    if value is None:
-        return []
-    elif not isinstance(value, list):
-        return [value]
-    else:
-        return value
-
-
-def toByteArray(value):
-    """
-    Module function to convert a value to a byte array.
-
-    @param value value to be converted
-    @type QByteArray or None
-    @return converted data
-    @rtype QByteArray
-    """
-    if value is None:
-        return QByteArray()
-    else:
-        return value
-
-
-def toDict(value):
-    """
-    Module function to convert a value to a dictionary.
-
-    @param value value to be converted
-    @type dict or None
-    @return converted data
-    @rtype dict
-    """
-    if value is None:
-        return {}
-    else:
-        return value
-
-
 def convertPasswords(oldPassword, newPassword):
     """
     Module function to convert all passwords.
--- a/src/eric7/Project/Project.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Project/Project.py	Sun Jun 30 17:58:31 2024 +0200
@@ -31,7 +31,7 @@
 from PyQt6.QtGui import QAction, QKeySequence
 from PyQt6.QtWidgets import QDialog, QInputDialog, QLineEdit, QMenu, QToolBar
 
-from eric7 import Globals, Preferences, Utilities
+from eric7 import EricUtilities, Preferences, Utilities
 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction
 from eric7.CodeFormatting.BlackUtilities import aboutBlack
 from eric7.CodeFormatting.IsortFormattingAction import IsortFormattingAction
@@ -7172,8 +7172,8 @@
                                     os.path.join(self.ppath, self.__pdata["MAINSCRIPT"])
                                 )
                                 if archiveVersion and (
-                                    Globals.versionToTuple(version)
-                                    < Globals.versionToTuple(archiveVersion)
+                                    EricUtilities.versionToTuple(version)
+                                    < EricUtilities.versionToTuple(archiveVersion)
                                 ):
                                     version = archiveVersion
                     except OSError as why:
--- a/src/eric7/QScintilla/Editor.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/QScintilla/Editor.py	Sun Jun 30 17:58:31 2024 +0200
@@ -57,7 +57,7 @@
     QToolTip,
 )
 
-from eric7 import Globals, Preferences, Utilities
+from eric7 import EricUtilities, Globals, Preferences, Utilities
 from eric7.CodeFormatting.BlackFormattingAction import BlackFormattingAction
 from eric7.CodeFormatting.BlackUtilities import aboutBlack
 from eric7.CodeFormatting.IsortFormattingAction import IsortFormattingAction
@@ -2843,7 +2843,7 @@
                 # get recently used breakpoint conditions
                 rs = Preferences.Prefs.rsettings.value(recentNameBreakpointConditions)
                 condHistory = (
-                    Preferences.toList(rs)[: Preferences.getDebugger("RecentNumber")]
+                    EricUtilities.toList(rs)[: Preferences.getDebugger("RecentNumber")]
                     if rs is not None
                     else []
                 )
@@ -9994,9 +9994,9 @@
             elif option == "DefaultEncoding":
                 value = config["charset"]
             elif option == "InsertFinalNewline":
-                value = Globals.toBool(config["insert_final_newline"])
+                value = EricUtilities.toBool(config["insert_final_newline"])
             elif option == "StripTrailingWhitespace":
-                value = Globals.toBool(config["trim_trailing_whitespace"])
+                value = EricUtilities.toBool(config["trim_trailing_whitespace"])
             elif option == "TabWidth":
                 value = int(config["tab_width"])
             elif option == "IndentWidth":
--- a/src/eric7/QScintilla/Lexers/SubstyledLexer.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/QScintilla/Lexers/SubstyledLexer.py	Sun Jun 30 17:58:31 2024 +0200
@@ -11,7 +11,7 @@
 
 from PyQt6.QtGui import QColor
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 
 from .Lexer import Lexer
 
@@ -116,7 +116,7 @@
                                     style["paper"] = int(settings.value(key))
                                 key = substyleKey + "eolfill"
                                 if settings.contains(key):
-                                    style["eolfill"] = Preferences.toBool(
+                                    style["eolfill"] = EricUtilities.toBool(
                                         settings.value(key)
                                     )
                                 key = substyleKey + "font_family"
@@ -127,17 +127,17 @@
                                     style["font_size"] = int(settings.value(key))
                                 key = substyleKey + "font_bold"
                                 if settings.contains(key):
-                                    style["font_bold"] = Preferences.toBool(
+                                    style["font_bold"] = EricUtilities.toBool(
                                         settings.value(key)
                                     )
                                 key = substyleKey + "font_italic"
                                 if settings.contains(key):
-                                    style["font_italic"] = Preferences.toBool(
+                                    style["font_italic"] = EricUtilities.toBool(
                                         settings.value(key)
                                     )
                                 key = substyleKey + "font_underline"
                                 if settings.contains(key):
-                                    style["font_underline"] = Preferences.toBool(
+                                    style["font_underline"] = EricUtilities.toBool(
                                         settings.value(key)
                                     )
 
--- a/src/eric7/QScintilla/MiniEditor.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/QScintilla/MiniEditor.py	Sun Jun 30 17:58:31 2024 +0200
@@ -45,7 +45,7 @@
     QWidget,
 )
 
-from eric7 import Globals, Preferences, Utilities
+from eric7 import EricUtilities, Preferences, Utilities
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricAction import EricAction, createActionGroup
 from eric7.EricGui.EricOverrideCursor import EricOverrideCursor
@@ -4456,9 +4456,9 @@
             elif option == "DefaultEncoding":
                 value = config["charset"]
             elif option == "InsertFinalNewline":
-                value = Globals.toBool(config["insert_final_newline"])
+                value = EricUtilities.toBool(config["insert_final_newline"])
             elif option == "StripTrailingWhitespace":
-                value = Globals.toBool(config["trim_trailing_whitespace"])
+                value = EricUtilities.toBool(config["trim_trailing_whitespace"])
             elif option == "TabWidth":
                 value = int(config["tab_width"])
             elif option == "IndentWidth":
--- a/src/eric7/Testing/TestingWidget.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/Testing/TestingWidget.py	Sun Jun 30 17:58:31 2024 +0200
@@ -22,7 +22,7 @@
     QWidget,
 )
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.DataViews.PyCoverageDialog import PyCoverageDialog
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets import EricMessageBox
@@ -465,21 +465,21 @@
         self.__discoverHistory = []
         rs = Preferences.Prefs.rsettings.value(recentNameTestDiscoverHistory)
         if rs is not None:
-            recent = [f for f in Preferences.toList(rs) if os.path.exists(f)]
+            recent = [f for f in EricUtilities.toList(rs) if os.path.exists(f)]
             self.__discoverHistory = recent[: Preferences.getDebugger("RecentNumber")]
 
         # 3. test file history
         self.__fileHistory = []
         rs = Preferences.Prefs.rsettings.value(recentNameTestFileHistory)
         if rs is not None:
-            recent = [f for f in Preferences.toList(rs) if os.path.exists(f)]
+            recent = [f for f in EricUtilities.toList(rs) if os.path.exists(f)]
             self.__fileHistory = recent[: Preferences.getDebugger("RecentNumber")]
 
         # 4. test name history
         self.__testNameHistory = []
         rs = Preferences.Prefs.rsettings.value(recentNameTestNameHistory)
         if rs is not None:
-            recent = [n for n in Preferences.toList(rs) if n]
+            recent = [n for n in EricUtilities.toList(rs) if n]
             self.__testNameHistory = recent[: Preferences.getDebugger("RecentNumber")]
 
     def __saveRecent(self):
--- a/src/eric7/UI/FindFileWidget.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/UI/FindFileWidget.py	Sun Jun 30 17:58:31 2024 +0200
@@ -26,7 +26,7 @@
     QWidget,
 )
 
-from eric7 import Preferences, Utilities
+from eric7 import EricUtilities, Preferences, Utilities
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets import EricMessageBox
 from eric7.EricWidgets.EricApplication import ericApp
@@ -122,7 +122,7 @@
 
         self.findProgressLabel.setMaximumWidth(550)
 
-        self.searchHistory = Preferences.toList(
+        self.searchHistory = EricUtilities.toList(
             Preferences.getSettings().value("FindFileWidget/SearchHistory")
         )
         self.findtextCombo.lineEdit().setClearButtonEnabled(True)
@@ -131,7 +131,7 @@
         self.findtextCombo.addItems(self.searchHistory)
         self.findtextCombo.setEditText("")
 
-        self.replaceHistory = Preferences.toList(
+        self.replaceHistory = EricUtilities.toList(
             Preferences.getSettings().value("FindFileWidget/ReplaceHistory")
         )
         self.replacetextCombo.lineEdit().setClearButtonEnabled(True)
@@ -140,14 +140,14 @@
         self.replacetextCombo.addItems(self.replaceHistory)
         self.replacetextCombo.setEditText("")
 
-        self.dirHistory = Preferences.toList(
+        self.dirHistory = EricUtilities.toList(
             Preferences.getSettings().value("FindFileWidget/DirectoryHistory")
         )
         self.dirPicker.addItems(self.dirHistory)
         self.dirPicker.setText("")
 
         self.excludeHiddenCheckBox.setChecked(
-            Preferences.toBool(
+            EricUtilities.toBool(
                 Preferences.getSettings().value("FindFileWidget/ExcludeHidden", True)
             )
         )
--- a/src/eric7/UI/UserInterface.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/UI/UserInterface.py	Sun Jun 30 17:58:31 2024 +0200
@@ -59,7 +59,7 @@
     QWidget,
 )
 
-from eric7 import Globals, Preferences, Testing, Utilities
+from eric7 import EricUtilities, Globals, Preferences, Testing, Utilities
 from eric7.__version__ import Version, VersionOnly
 from eric7.CondaInterface.Conda import Conda
 from eric7.Debugger.DebugServer import DebugServer
@@ -8444,12 +8444,12 @@
                             # daily, weekly, monthly
                             return
 
-            versionTuple = Globals.versionToTuple(VersionOnly)
+            versionTuple = EricUtilities.versionToTuple(VersionOnly)
             availableVersions = self.pipInterface.getPackageVersions("eric-ide")
             newerVersionsTuple = [
-                Globals.versionToTuple(v)
+                EricUtilities.versionToTuple(v)
                 for v in availableVersions
-                if Globals.versionToTuple(v) > versionTuple
+                if EricUtilities.versionToTuple(v) > versionTuple
             ]
             updateAvailable = bool(newerVersionsTuple)
             if updateAvailable:
@@ -8558,9 +8558,9 @@
                 vers = VersionOnly.split("snapshot-")[1]
                 return vers > snapshot
 
-        versionTuple = Globals.versionToTuple(VersionOnly)
+        versionTuple = EricUtilities.versionToTuple(VersionOnly)
         if isinstance(required, str):
-            required = Globals.versionToTuple(required)
+            required = EricUtilities.versionToTuple(required)
         try:
             res = versionTuple > required
         except TypeError:
--- a/src/eric7/ViewManager/ViewManager.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/ViewManager/ViewManager.py	Sun Jun 30 17:58:31 2024 +0200
@@ -24,7 +24,7 @@
 from PyQt6.QtGui import QKeySequence, QPixmap
 from PyQt6.QtWidgets import QApplication, QDialog, QMenu, QToolBar, QWidget
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricCore import EricFileSystemWatcher
 from eric7.EricGui import EricPixmapCache
 from eric7.EricGui.EricAction import EricAction, createActionGroup
@@ -193,7 +193,7 @@
         Preferences.Prefs.rsettings.sync()
         rs = Preferences.Prefs.rsettings.value(recentNameFiles)
         if rs is not None:
-            for f in Preferences.toList(rs):
+            for f in EricUtilities.toList(rs):
                 if pathlib.Path(f).exists():
                     self.recent.append(f)
 
--- a/src/eric7/VirtualEnv/VirtualenvUpgradeConfigurationDialog.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/VirtualEnv/VirtualenvUpgradeConfigurationDialog.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 from PyQt6.QtCore import QProcess, QTimer, pyqtSlot
 from PyQt6.QtWidgets import QDialog, QDialogButtonBox
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets.EricPathPicker import EricPathPickerModes
 from eric7.SystemUtilities import FileSystemUtilities, PythonUtilities
 
@@ -107,7 +107,7 @@
             ).strip()
             match = re.match(self.__versionRe, output)
             if match:
-                return Globals.versionToTuple(match.group(1))
+                return EricUtilities.versionToTuple(match.group(1))
 
         return (0, 0, 0)  # dummy version tuple
 
--- a/src/eric7/WebBrowser/CookieJar/CookieJar.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/WebBrowser/CookieJar/CookieJar.py	Sun Jun 30 17:58:31 2024 +0200
@@ -13,7 +13,7 @@
 from PyQt6.QtCore import QSettings, pyqtSignal, pyqtSlot
 from PyQt6.QtNetwork import QNetworkCookie, QNetworkCookieJar
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Globals, Preferences
 from eric7.Utilities.AutoSaver import AutoSaver
 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow
 
@@ -139,13 +139,13 @@
         cookieSettings = QSettings(self.__cookiesFile, QSettings.Format.IniFormat)
 
         # load exceptions
-        self.__exceptionsBlock = Preferences.toList(
+        self.__exceptionsBlock = EricUtilities.toList(
             cookieSettings.value("Exceptions/block")
         )
-        self.__exceptionsAllow = Preferences.toList(
+        self.__exceptionsAllow = EricUtilities.toList(
             cookieSettings.value("Exceptions/allow")
         )
-        self.__exceptionsAllowForSession = Preferences.toList(
+        self.__exceptionsAllowForSession = EricUtilities.toList(
             cookieSettings.value("Exceptions/allowForSession")
         )
         self.__exceptionsBlock.sort()
@@ -170,7 +170,7 @@
         if self.__keepCookies == CookieKeepPolicy.UntilExit:
             self.clear()
 
-        self.__filterTrackingCookies = Preferences.toBool(
+        self.__filterTrackingCookies = EricUtilities.toBool(
             Preferences.getWebBrowser("FilterTrackingCookies")
         )
 
--- a/src/eric7/WebBrowser/FeaturePermissions/FeaturePermissionManager.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/WebBrowser/FeaturePermissions/FeaturePermissionManager.py	Sun Jun 30 17:58:31 2024 +0200
@@ -11,7 +11,7 @@
 from PyQt6.QtWebEngineCore import QWebEnginePage
 from PyQt6.QtWidgets import QDialog
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow
 
 
@@ -192,7 +192,7 @@
             return
 
         for (feature, permission), key in self.__featurePermissionsKeys.items():
-            self.__featurePermissions[feature][permission] = Globals.toList(
+            self.__featurePermissions[feature][permission] = EricUtilities.toList(
                 Preferences.getSettings().value(
                     FeaturePermissionManager.SettingsKeyFormat.format(key), []
                 )
--- a/src/eric7/WebBrowser/Network/NetworkManager.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/WebBrowser/Network/NetworkManager.py	Sun Jun 30 17:58:31 2024 +0200
@@ -19,7 +19,7 @@
 )
 from PyQt6.QtWidgets import QDialog, QStyle
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricNetwork.EricNetworkProxyFactory import (
     EricNetworkProxyFactory,
     proxyAuthenticationRequired,
@@ -385,7 +385,7 @@
         """
         from eric7.WebBrowser.WebBrowserLanguagesDialog import WebBrowserLanguagesDialog
 
-        languages = Preferences.toList(
+        languages = EricUtilities.toList(
             Preferences.getSettings().value(
                 "WebBrowser/AcceptLanguages",
                 WebBrowserLanguagesDialog.defaultAcceptLanguages(),
--- a/src/eric7/WebBrowser/SearchWidget.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/WebBrowser/SearchWidget.py	Sun Jun 30 17:58:31 2024 +0200
@@ -107,7 +107,7 @@
         else:
             self.infoLabel.setText(
                 self.tr("Match {0} of {1}").format(
-                        result.activeMatch(), result.numberOfMatches()
+                    result.activeMatch(), result.numberOfMatches()
                 )
             )
 
--- a/src/eric7/WebBrowser/WebBrowserLanguagesDialog.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/WebBrowser/WebBrowserLanguagesDialog.py	Sun Jun 30 17:58:31 2024 +0200
@@ -10,7 +10,7 @@
 from PyQt6.QtCore import QLocale, QModelIndex, QStringListModel, pyqtSlot
 from PyQt6.QtWidgets import QDialog
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 
 from .Ui_WebBrowserLanguagesDialog import Ui_WebBrowserLanguagesDialog
 
@@ -36,7 +36,7 @@
             self.__currentChanged
         )
 
-        languages = Preferences.toList(
+        languages = EricUtilities.toList(
             Preferences.getSettings().value(
                 "WebBrowser/AcceptLanguages", self.defaultAcceptLanguages()
             )
--- a/src/eric7/WebBrowser/WebBrowserPage.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/WebBrowser/WebBrowserPage.py	Sun Jun 30 17:58:31 2024 +0200
@@ -21,7 +21,7 @@
 from PyQt6.QtWebChannel import QWebChannel
 from PyQt6.QtWebEngineCore import QWebEnginePage, QWebEngineScript, QWebEngineSettings
 
-from eric7 import Globals, Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.EricWidgets import EricMessageBox
 from eric7.WebBrowser.WebBrowserWindow import WebBrowserWindow
 
@@ -646,7 +646,7 @@
         if not certList:
             return False
 
-        certificateDict = Globals.toDict(
+        certificateDict = EricUtilities.toDict(
             Preferences.getSettings().value("Ssl/CaCertificatesDict")
         )
         for server in certificateDict:
--- a/src/eric7/WebBrowser/WebBrowserView.py	Sun Jun 30 15:37:49 2024 +0200
+++ b/src/eric7/WebBrowser/WebBrowserView.py	Sun Jun 30 17:58:31 2024 +0200
@@ -48,7 +48,7 @@
 from PyQt6.QtWebEngineWidgets import QWebEngineView
 from PyQt6.QtWidgets import QApplication, QDialog, QMenu, QStyle
 
-from eric7 import Preferences
+from eric7 import EricUtilities, Preferences
 from eric7.__version__ import VersionOnly
 from eric7.EricGui import EricPixmapCache
 from eric7.EricWidgets import EricFileDialog, EricMessageBox
@@ -931,7 +931,7 @@
 
         menu.addSeparator()
 
-        languages = Preferences.toList(
+        languages = EricUtilities.toList(
             Preferences.getSettings().value(
                 "WebBrowser/AcceptLanguages",
                 WebBrowserLanguagesDialog.defaultAcceptLanguages(),
@@ -1061,7 +1061,7 @@
             act.setData(w3url)
             act.triggered.connect(functools.partial(self.__openLinkInNewTab, act))
 
-            languages = Preferences.toList(
+            languages = EricUtilities.toList(
                 Preferences.getSettings().value(
                     "WebBrowser/AcceptLanguages",
                     WebBrowserLanguagesDialog.defaultAcceptLanguages(),

eric ide

mercurial