Hide keyboard shortcuts

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 -*- 

2 

3""" 

4Primary version number source. 

5 

6Forth element can be 'dev' < 'a' < 'b' < 'rc' < 'final'. An empty 4th 

7element is equivalent to 'final'. 

8""" 

9VERSION = (0, 3, 5, 'final') 

10 

11 

12def get_version(): 

13 """Provide version number 

14 

15 Use verlib format [1]_: 

16 N.N[.N]+[{a|b|c|rc}N[.N]+][.postN][.devN] 

17 

18 .. [1] http://www.python.org/dev/peps/pep-0386/ 

19 """ 

20 main_version = '%s.%s.%s' % VERSION[0:3] 

21 

22 if len(VERSION) < 4: 

23 return main_version 

24 

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)