mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-13 00:03:09 -04:00
[Plugin Installer] More uniform behaviour when comparing versions: always exclude any non-numeric parts
This commit is contained in:
parent
040e9d54cb
commit
af04c794fc
@ -46,6 +46,8 @@ list is usually recognized as higher, except following suffixes:
|
||||
ALPHA, BETA, RC, PREVIEW and TRUNK which make the version number lower.
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
# ------------------------------------------------------------------------ #
|
||||
def normalizeVersion(s):
|
||||
""" remove possible prefix from given string and convert to uppercase """
|
||||
@ -169,9 +171,9 @@ def splitVersion(s):
|
||||
|
||||
def isCompatible(curVer, minVer, maxVer=None):
|
||||
""" Compare current QGIS version with qgisMinVersion and qgisMaxVersion """
|
||||
minVer = splitVersion(minVer)
|
||||
maxVer = splitVersion(maxVer)
|
||||
curVer = splitVersion( curVer.split("-")[0] )
|
||||
minVer = splitVersion( re.sub(r'[^0-9.]+', '', minVer) )
|
||||
maxVer = splitVersion( re.sub(r'[^0-9.]+', '', maxVer) )
|
||||
curVer = splitVersion( re.sub(r'[^0-9.]+', '', curVer) )
|
||||
|
||||
if not minVer or not curVer:
|
||||
return False
|
||||
|
Loading…
x
Reference in New Issue
Block a user