17 from genericpath
import exists, isfile
18 from os.path
import join, expanduser
26 CORE_VERSION_MAJOR = 19
27 CORE_VERSION_MINOR = 2
28 CORE_VERSION_BUILD = 12
31 CORE_VERSION_TUPLE = (CORE_VERSION_MAJOR,
34 CORE_VERSION_STR =
'.'.join(map(str, CORE_VERSION_TUPLE))
40 data_dir = expanduser(Configuration.get()[
'data_dir'])
41 version_file = join(data_dir,
'version.json')
42 if exists(version_file)
and isfile(version_file):
44 with open(version_file)
as f:
47 LOG.error(
"Failed to load version from '%s'" % version_file)
48 return {
"coreVersion":
None,
"enclosureVersion":
None}
53 Check if current version is equal or higher than the 54 version string provided to the function 57 version_string (string): version string ('Major.Minor.Build') 59 version_tuple = tuple(map(int, version_string.split(
'.')))
60 return CORE_VERSION_TUPLE >= version_tuple
def check_version(version_string)