45 lines
1.3 KiB
GDScript
45 lines
1.3 KiB
GDScript
extends Node
|
|
|
|
## 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.
|
|
|
|
|
|
var version = Version.new('pymodbus', 2, 5, 3)
|
|
|
|
|
|
class Version extends Object:
|
|
var package
|
|
var major
|
|
var minor
|
|
var micro
|
|
var pre
|
|
var name
|
|
|
|
## [param package] Name of the package that this is a version of.[br]
|
|
## [param major] The major version number.[br]
|
|
## [param minor] The minor version number.[br]
|
|
## [param micro] The micro version number.[br]
|
|
## [param pre] The pre release tag.[br]
|
|
func _init(pkg, mjr, mnr, mcr, pr=null):
|
|
self.package = pkg
|
|
self.major = mjr
|
|
self.minor = mnr
|
|
self.micro = mcr
|
|
self.pre = pr
|
|
self.name = 'pymodbus'
|
|
|
|
## Return a string in canonical short version format
|
|
## <major>.<minor>.<micro>.<pre>
|
|
func short():
|
|
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]
|
|
|
|
## Returns a string representation of the object
|
|
## A string representation of this object
|
|
func _to_string() -> String:
|
|
return '[%s, version %s]' % [self.package, self.short()]
|