-
Notifications
You must be signed in to change notification settings - Fork 951
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
668612e
commit 1e1af47
Showing
1 changed file
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,53 @@ | ||
''' | ||
""" | ||
Handle the version information here; you should only have to | ||
change the version tuple. | ||
Since we are using twisted's version class, we can also query | ||
the svn version as well using the local .entries file. | ||
''' | ||
""" | ||
|
||
|
||
class Version(object): | ||
|
||
def __init__(self, package, major, minor, micro, pre=None): | ||
''' | ||
""" | ||
:param package: Name of the package that this is a version of. | ||
:param major: The major version number. | ||
:param minor: The minor version number. | ||
:param micro: The micro version number. | ||
:param pre: The pre release tag | ||
''' | ||
""" | ||
self.package = package | ||
self.major = major | ||
self.minor = minor | ||
self.micro = micro | ||
self.pre = pre | ||
|
||
def short(self): | ||
''' Return a string in canonical short version format | ||
""" Return a string in canonical short version format | ||
<major>.<minor>.<micro>.<pre> | ||
''' | ||
""" | ||
if self.pre: | ||
return '%d.%d.%d.%s' % (self.major, self.minor, self.micro, self.pre) | ||
else: | ||
return '%d.%d.%d' % (self.major, self.minor, self.micro) | ||
|
||
def __str__(self): | ||
''' Returns a string representation of the object | ||
""" Returns a string representation of the object | ||
:returns: A string representation of this object | ||
''' | ||
""" | ||
return '[%s, version %s]' % (self.package, self.short()) | ||
|
||
|
||
version = Version('pymodbus', 1, 4, 0, "rc1") | ||
|
||
version = Version('pymodbus', 1, 4, 0, "rc2") | ||
|
||
|
||
version.__name__ = 'pymodbus' # fix epydoc error | ||
|
||
#---------------------------------------------------------------------------# | ||
# --------------------------------------------------------------------------- # | ||
# Exported symbols | ||
#---------------------------------------------------------------------------# | ||
# --------------------------------------------------------------------------- # | ||
|
||
__all__ = ["version"] |