Skip to content

Commit 5926edf

Browse files
author
brushtyler
committed
manage string in release name
git-svn-id: http://svn.osgeo.org/qgis/trunk@13644 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent dbb8bbe commit 5926edf

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

python/plugins/GdalTools/tools/GdalTools_utils.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -617,14 +617,19 @@ def string2vers(string):
617617
vers = [0, 0, 0]
618618

619619
nums = str(string).split(".")
620+
620621
if len(nums) > 0:
621-
vers[0] = int(nums[0])
622+
n = QString(nums[0]).remove( QRegExp( "[^0-9].*$" ) )
623+
if not n.isEmpty():
624+
vers[0] = int(n)
622625
if len(nums) > 1:
623-
vers[1] = int(nums[1])
626+
n = QString(nums[1]).remove( QRegExp( "[^0-9].*$" ) )
627+
if not n.isEmpty():
628+
vers[1] = int(n)
624629
if len(nums) > 2:
625630
n = QString(nums[2]).remove( QRegExp( "[^0-9].*$" ) )
626-
if not n.isEmpty():
627-
vers[2] = int(n)
631+
if not n.isEmpty():
632+
vers[2] = int(n)
628633

629634
return (vers[0], vers[1], vers[2])
630635

0 commit comments

Comments
 (0)