Updated version calculation

This commit is contained in:
Ross Lawley 2012-08-24 15:08:37 +01:00
parent 7c08c140da
commit d645ce9745
2 changed files with 6 additions and 8 deletions

View File

@ -16,9 +16,8 @@ VERSION = (0, 6, 20)
def get_version(): def get_version():
version = '%s.%s' % (VERSION[0], VERSION[1]) if isinstance(VERSION[-1], basestring):
if VERSION[2]: return '.'.join(map(str, VERSION[:-1])) + VERSION[-1]
version = '%s.%s' % (version, VERSION[2]) return '.'.join(map(str, VERSIONs))
return version
__version__ = get_version() __version__ = get_version()

View File

@ -18,10 +18,9 @@ except:
def get_version(version_tuple): def get_version(version_tuple):
version = '%s.%s' % (version_tuple[0], version_tuple[1]) if isinstance(version_tuple[-1], basestring):
if version_tuple[2]: return '.'.join(map(str, version_tuple[:-1])) + version_tuple[-1]
version = '%s.%s' % (version, version_tuple[2]) return '.'.join(map(str, version_tuple))
return version
# Dirty hack to get version number from monogengine/__init__.py - we can't # Dirty hack to get version number from monogengine/__init__.py - we can't
# import it as it depends on PyMongo and PyMongo isn't installed until this # import it as it depends on PyMongo and PyMongo isn't installed until this