A utility function for parsing dot-delimited stings as a version
tuple.
# test some simple version formats >>> version = '1'
>>> getVersionTupleFromString(version) (1, 0, 0) >>>
version = '1.0' >>> getVersionTupleFromString(version) (1, 0, 0)
>>> version = '1.0.0' >>>
getVersionTupleFromString(version) (1, 0, 0) >>> version =
'1.0.2' >>> getVersionTupleFromString(version) (1, 0, 2)
# here's one for Fedora >>> version = '2.6.17-1.2174_FC5'
>>> getVersionTupleFromString(version) (2, 6, 17)
# here's a bizzare one >>> version = '1a.23zzX.abs'
>>> getVersionTupleFromString(version) (1, 23, 0)
# checks against ints and floats being passed instead of strings
>>> version = 1 >>> getVersionTupleFromString(version)
(1, 0, 0) >>> version = 1.0 >>>
getVersionTupleFromString(version) (1, 0, 0) >>> version = 0
>>> getVersionTupleFromString(version) (0, 0, 0) >>>
version = 'a.1.2' >>> getVersionTupleFromString(version) (0, 1,
2) >>> version = '' >>>
getVersionTupleFromString(version) (0, 0, 0)
|