[QGIS Commit] r13644 - trunk/qgis/python/plugins/GdalTools/tools
svn_qgis at osgeo.org
svn_qgis at osgeo.org
Fri Jun 4 07:23:58 EDT 2010
Author: brushtyler
Date: 2010-06-04 07:23:58 -0400 (Fri, 04 Jun 2010)
New Revision: 13644
Modified:
trunk/qgis/python/plugins/GdalTools/tools/GdalTools_utils.py
Log:
manage string in release name
Modified: trunk/qgis/python/plugins/GdalTools/tools/GdalTools_utils.py
===================================================================
--- trunk/qgis/python/plugins/GdalTools/tools/GdalTools_utils.py 2010-06-04 11:16:35 UTC (rev 13643)
+++ trunk/qgis/python/plugins/GdalTools/tools/GdalTools_utils.py 2010-06-04 11:23:58 UTC (rev 13644)
@@ -617,14 +617,19 @@
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])
More information about the QGIS-commit
mailing list