def __current_version(): """ Get current application version :raise PackageError :return: str """ try: local = Package.local_version() remote = Package.__remote_version() if True is helper.is_less(local, remote): current_version = tpl.line(local, color='red') else: current_version = tpl.line(local, color='green') return current_version except (FileSystemError, CoreSystemError, PackageError) as error: raise PackageError(error)
def check_interpreter(): """ Get interpreter version :return: dict or bool """ versions = CoreConfig.get('info').get('required_versions') actual_version = sys.version() target_compare = (actual_version == versions.get('minor') or actual_version == versions.get('major')) relative_compare = (helper.is_less(versions.get('minor'), actual_version) is True or helper.is_more(actual_version, versions.get('major')) is True) if target_compare or relative_compare: return True else: return { 'status': False, 'actual': actual_version, 'expected': versions.get('minor') + ' -> ' + versions.get('major') }
def check_interpreter(): """ Get interpreter version :return: dict or bool """ versions = Config.params.get('required_versions') actual_version = sys.version() target_compare = (actual_version == versions.get('minor') or actual_version == versions.get('major')) relative_compare = (helper.is_less(versions.get('minor'), actual_version) is True or helper.is_more(actual_version, versions.get('major')) is True) if target_compare or relative_compare: return True else: return { 'status': False, 'actual': actual_version, 'expected': versions.get('minor') + ' -> ' + versions.get('major') }
def check_interpreter(): """ Get interpreter version :return: dict or bool """ expected_version = Config.params.get('required_version') actual_version = sys.version() if True is helper.is_less(expected_version, actual_version) or True is helper.is_more( expected_version, actual_version): return { 'status': False, 'actual': actual_version, 'expected': expected_version } else: return True