Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
manage string in release name
git-svn-id: http://svn.osgeo.org/qgis/trunk@13644 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
brushtyler committed Jun 4, 2010
1 parent dbb8bbe commit 5926edf
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions python/plugins/GdalTools/tools/GdalTools_utils.py
Expand Up @@ -617,14 +617,19 @@ def string2vers(string):
vers = [0, 0, 0]

nums = str(string).split(".")

if len(nums) > 0:
vers[0] = int(nums[0])
n = QString(nums[0]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[0] = int(n)
if len(nums) > 1:
vers[1] = int(nums[1])
n = QString(nums[1]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[1] = int(n)
if len(nums) > 2:
n = QString(nums[2]).remove( QRegExp( "[^0-9].*$" ) )
if not n.isEmpty():
vers[2] = int(n)
if not n.isEmpty():
vers[2] = int(n)

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

Expand Down

0 comments on commit 5926edf

Please sign in to comment.