Package ZenUtils :: Module Version
[show private | hide private]
[frames | no frames]

Module ZenUtils.Version

Zenoss versioning module.
Classes
Version A class for obtaining and manipulating version numbers as well as creating the necessary version files Zenoss utilizes.

Exceptions
ComponentVersionError  
IncomparableVersions  
VersionError  
VersionNotSupported  

Function Summary
  getVersionTupleFromString(versionString)
A utility function for parsing dot-delimited stings as a version tuple.

Function Details

getVersionTupleFromString(versionString)

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)

Generated by Epydoc 2.1 on Thu Aug 16 09:55:10 2007 http://epydoc.sf.net