mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-10 08:17:49 -06:00
Use UM.Version instead of VersionTools
This commit is contained in:
parent
921e8f7602
commit
fbf73176d3
2 changed files with 4 additions and 6 deletions
|
@ -12,9 +12,7 @@ from PyQt5.QtCore import pyqtSlot, QObject, pyqtSignal
|
|||
|
||||
from UM.Logger import Logger
|
||||
from UM.Resources import Resources
|
||||
|
||||
from cura.Utils import VersionTools
|
||||
|
||||
from UM.Version import Version
|
||||
|
||||
class CuraPackageManager(QObject):
|
||||
|
||||
|
@ -186,7 +184,7 @@ class CuraPackageManager(QObject):
|
|||
# Compare versions and only schedule the installation if the given package is newer
|
||||
new_version = package_info["package_version"]
|
||||
installed_version = installed_package_info["package_version"]
|
||||
if VersionTools.compareSemanticVersions(new_version, installed_version) > 0:
|
||||
if Version(new_version) > Version(installed_version):
|
||||
Logger.log("i", "Package [%s] version [%s] is newer than the installed version [%s], update it.",
|
||||
package_id, new_version, installed_version)
|
||||
to_install_package = True
|
||||
|
|
|
@ -16,7 +16,7 @@ from UM.PluginRegistry import PluginRegistry
|
|||
from UM.Qt.Bindings.PluginsModel import PluginsModel
|
||||
from UM.Extension import Extension
|
||||
from UM.i18n import i18nCatalog
|
||||
from cura.Utils.VersionTools import compareSemanticVersions
|
||||
from UM.Version import Version
|
||||
|
||||
from cura.CuraApplication import CuraApplication
|
||||
from .AuthorsModel import AuthorsModel
|
||||
|
@ -289,7 +289,7 @@ class Toolbox(QObject, Extension):
|
|||
|
||||
local_version = local_package["package_version"]
|
||||
remote_version = remote_package["package_version"]
|
||||
return compareSemanticVersions(remote_version, local_version) > 0
|
||||
return Version(remote_version) > Version(local_version)
|
||||
|
||||
@pyqtSlot(str, result = bool)
|
||||
def isInstalled(self, package_id) -> bool:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue