version file has been updated to include a travis commit and time of build.

This commit is contained in:
Nicholas Staples
2016-02-01 11:37:22 +00:00
parent 8c20c3e7be
commit cd5a91d4c8
5 changed files with 21 additions and 9 deletions

View File

@@ -121,13 +121,15 @@ def convert_to_number(value):
def get_api_version():
_version_re = re.compile(r'__version__\s+=\s+(.*)')
version = 'n/a'
dir_path = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(dir_path, 'version.py'), 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode('utf-8')).group(1)))
return version
build = 'n/a'
build_time = "n/a"
try:
from app import version
build = version.__build__
build_time = version.__time__
except:
pass
return build, build_time
def get_db_version():