t.p.v.Version(object) : class documentation

Part of twisted.python.versions View Source View In Hierarchy

An object that represents a three-part version number.

If running from an svn checkout, include the revision number in the version string.

Method __init__ No summary
Method short Return a string in canonical short version format, <major>.<minor>.<micro>[+rSVNVer].
Method base Like short, but without the +rSVNVer.
Method __repr__ Undocumented
Method __str__ Undocumented
Method __cmp__ Compare two versions, considering major versions, minor versions, micro versions, then prereleases.
Method _parseSVNEntries_4 No summary
Method _parseSVNEntries_8 Given a readable file object which represents a .svn/entries file in format version 8, return the revision as a string.
Method _getSVNVersion No summary
Method _formatSVNVersion Undocumented
def __init__(self, package, major, minor, micro, prerelease=None): (source)
ParameterspackageName of the package that this is a version of. (type: str)
majorThe major version number. (type: int)
minorThe minor version number. (type: int)
microThe micro version number. (type: int)
prereleaseThe prerelease number. (type: int)
def short(self): (source)
Return a string in canonical short version format, <major>.<minor>.<micro>[+rSVNVer].
def base(self): (source)
Like short, but without the +rSVNVer.
def __repr__(self): (source)
Undocumented
def __str__(self): (source)
Undocumented
def __cmp__(self, other): (source)
Compare two versions, considering major versions, minor versions, micro versions, then prereleases.

A version with a prerelease is always less than a version without a prerelease. If both versions have prereleases, they will be included in the comparison.

ParametersotherAnother version. (type: Version)
ReturnsNotImplemented when the other object is not a Version, or one of -1, 0, or 1.
RaisesIncomparableVersionswhen the package names of the versions differ.
def _parseSVNEntries_4(self, entriesFile): (source)
Given a readable file object which represents a .svn/entries file in format version 4, return the revision as a string. We do this by reading first XML element in the document that has a 'revision' attribute.
def _parseSVNEntries_8(self, entriesFile): (source)
Given a readable file object which represents a .svn/entries file in format version 8, return the revision as a string.
def _getSVNVersion(self): (source)
Figure out the SVN revision number based on the existance of <package>/.svn/entries, and its contents. This requires discovering the format version from the 'format' file and parsing the entries file accordingly.
ReturnsNone or string containing SVN Revision number.
def _formatSVNVersion(self): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2012-06-04 17:20:01.