Package Gnumed :: Package timelinelib :: Package meta :: Module version
[frames] | no frames]

Source Code for Module Gnumed.timelinelib.meta.version

 1  # Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018  Rickard Lindberg, Roger Lindberg 
 2  # 
 3  # This file is part of Timeline. 
 4  # 
 5  # Timeline is free software: you can redistribute it and/or modify 
 6  # it under the terms of the GNU General Public License as published by 
 7  # the Free Software Foundation, either version 3 of the License, or 
 8  # (at your option) any later version. 
 9  # 
10  # Timeline is distributed in the hope that it will be useful, 
11  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
12  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
13  # GNU General Public License for more details. 
14  # 
15  # You should have received a copy of the GNU General Public License 
16  # along with Timeline.  If not, see <http://www.gnu.org/licenses/>. 
17   
18   
19  import sys 
20   
21   
22  TYPE_DEV = "development" 
23  TYPE_BETA = "beta" 
24  TYPE_FINAL = "" 
25  VERSION = (2, 0, 0) 
26  TYPE = TYPE_BETA 
27  REVISION_HASH = "e73292739f1c" 
28  REVISION_DATE = "2019-08-13" 
29   
30   
31 -def get_full_version():
32 parts = [] 33 parts.append(get_version_number_string()) 34 if TYPE: 35 parts.append(TYPE) 36 if (REVISION_HASH or REVISION_DATE): 37 revision_parts = [] 38 if REVISION_HASH: 39 revision_parts.append(REVISION_HASH) 40 if REVISION_DATE: 41 revision_parts.append(REVISION_DATE) 42 parts.append("(%s)" % " ".join(revision_parts)) 43 return " ".join(parts)
44 45
46 -def get_filename_version():
47 parts = [] 48 parts.append("timeline") 49 parts.append(get_version_number_string()) 50 if not is_final(): 51 parts.append(TYPE) 52 parts.append(REVISION_HASH) 53 parts.append(REVISION_DATE) 54 return "-".join(parts)
55 56
57 -def get_version_number_string():
58 return "%s.%s.%s" % VERSION
59 60
61 -def is_dev():
62 return TYPE == TYPE_DEV
63 64
65 -def is_final():
66 return TYPE == TYPE_FINAL
67