From 156ed14b8b700918294c8b0d3f5d3b74597dbbde Mon Sep 17 00:00:00 2001 From: Abdul Raheem Siddiqui <53625184+ar-siddiqui@users.noreply.github.com> Date: Sun, 7 Aug 2022 21:35:01 -0400 Subject: [PATCH] Update utils.py --- curve_number_generator/processing/tools/utils.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/curve_number_generator/processing/tools/utils.py b/curve_number_generator/processing/tools/utils.py index 6c4668d..26ac9ba 100644 --- a/curve_number_generator/processing/tools/utils.py +++ b/curve_number_generator/processing/tools/utils.py @@ -85,11 +85,16 @@ def openFileInBrowser(): ) -def checkPluginUptodate(plugin_name: str) -> None: +def checkPluginUptodate(plugin_name: str): # check if new version is available of the plugin avail_version = checkAvailPluginVersion(plugin_name) - if avail_version != PLUGIN_VERSION: - displayMessage("Newer version of the plugin is available.", "Upgrade", installPlugin) + version_comp = zip(avail_version.split("."), PLUGIN_VERSION.split(".")) + for level in version_comp: + if int(level[0]) > int(level[1]): + displayMessage("Newer version of the plugin is available.", "Upgrade", installPlugin) + return + elif int(level[0]) < int(level[1]): + break def checkAvailPluginVersion(plugin_name: str) -> str: