Coverage for /home/martinb/.local/share/virtualenvs/camcops/lib/python3.6/site-packages/hl7/version.py : 67%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# -*- coding: utf-8 -*-
3"""
4Primary version number source.
6Forth element can be 'dev' < 'a' < 'b' < 'rc' < 'final'. An empty 4th
7element is equivalent to 'final'.
8"""
9VERSION = (0, 3, 5, 'final')
12def get_version():
13 """Provide version number
15 Use verlib format [1]_:
16 N.N[.N]+[{a|b|c|rc}N[.N]+][.postN][.devN]
18 .. [1] http://www.python.org/dev/peps/pep-0386/
19 """
20 main_version = '%s.%s.%s' % VERSION[0:3]
22 if len(VERSION) < 4:
23 return main_version
25 version_type = VERSION[3]
26 if not version_type or version_type == 'final':
27 return main_version
28 elif version_type == 'dev':
29 return '%s.dev' % main_version
30 else:
31 return '%s%s' % (main_version, version_type)