2020-08-28 01:06:57 +02:00
|
|
|
import os
|
2020-06-02 01:47:24 +02:00
|
|
|
from collections import namedtuple
|
|
|
|
|
2020-08-28 01:06:57 +02:00
|
|
|
build = os.popen('git rev-parse --short HEAD').read().strip()
|
|
|
|
info = os.popen('git log -n 1 -s --format="%s"').read().strip()
|
2020-06-02 01:47:24 +02:00
|
|
|
|
2020-08-28 01:06:57 +02:00
|
|
|
VersionInfo = namedtuple(
|
|
|
|
"VersionInfo", "major minor micro releaselevel build, info"
|
|
|
|
)
|
|
|
|
version_info = VersionInfo(
|
|
|
|
major=3, minor=0, micro=0,
|
|
|
|
releaselevel="alpha", build=build, info=info
|
|
|
|
)
|
2020-06-02 01:47:24 +02:00
|
|
|
|
2020-06-04 00:14:50 +02:00
|
|
|
__version__ = "v{}.{}.{}-{}.{}".format(
|
2020-06-06 18:51:47 +02:00
|
|
|
version_info.major,
|
|
|
|
version_info.minor,
|
|
|
|
version_info.micro,
|
|
|
|
version_info.releaselevel,
|
|
|
|
version_info.build,
|
|
|
|
).replace("\n", "")
|
2020-08-28 01:06:57 +02:00
|
|
|
|
|
|
|
|
|
|
|
class ExitCodes:
|
|
|
|
CRITICAL = 1
|
|
|
|
SHUTDOWN = 0
|
|
|
|
RESTART = 42
|