示例#1
0
    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)
示例#2
0
    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)
示例#3
0
    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')
            }
示例#4
0
    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')
            }
示例#5
0
文件: package.py 项目: ll2b/OpenDoor
    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