dbprocessing.Version.Version

class dbprocessing.Version.Version(interface_version, quality_version, revision_version)[source]

A version class to simplify pushing around version information

Handles Boolean operators (>, <, =, !=) and database interface for version is also implemented in another module.

The version scheme is X,Y,Z where:
  • X is the interface version, incremented only when the interface to a file or code changes

  • Y is the quality version, incremented when a change is made to a file that affects quality

  • Z is the revision version, incremented when a revision has been done to a code or file, as minor as fixing a typo

See also

Versions

Notes

The interface version starts at 1.

Examples

>>> import Version
>>> v = Version.Version(1,1,1)
>>> print(v)
1.1.1

Version objects can perform Boolean operations

>>> v2 = Version.Version(1,2,1)
>>> print(v2 > v)
True

Increment the version

>>> v.incQuality()
>>> print(v)
1.2.1

Same version is equal

>>> v == v2
True
__init__(interface_version, quality_version, revision_version)[source]

Sets the class attributes

Parameters
interface_versionint

The interface version for the object

quality_versionint

The quality version for the object

revision_versionint

The revision version for the object

Methods

fromString(inval)

Given a string of the form x.y.z return a Version object

incInterface()

Increment the interface version and reset the other two

incQuality()

Increment the quality version and reset the revision

incRevision()

Increment the revision version

Attributes

static fromString(inval)[source]

Given a string of the form x.y.z return a Version object

Parameters
invalstr

Version in the form xx.yy.zz

Returns
Version

Version instance created from the string

incInterface()[source]

Increment the interface version and reset the other two

incQuality()[source]

Increment the quality version and reset the revision

incRevision()[source]

Increment the revision version

interface

The interface version for the object

quality

The quality version for the object

revision

The revision version for the object


Release: 0.1.0 Doc generation date: Feb 10, 2022