Beispiel #1
0
 def deserialize(data):
     return SystemID(
         data[SystemID.SERIAL_NAME_ID_KEY],
         version_id=Version.deserialize(data[SystemID.SERIAL_VERSION_ID_KEY]),
         biiType=BiiType.deserialize(data[SystemID.SERIAL_BIITYPE_KEY]),
         language_version=Version.deserialize(data[SystemID.SERIAL_LANGUAGE_VERSION_KEY]),
         os_info=OSInfo.deserialize(data[SystemID.SERIAL_OS_INFO_KEY]),
         tool_info=ToolInfo.deserialize(data[SystemID.SERIAL_TOOL_INFO_KEY]),
         path=data[SystemID.SERIAL_PATH_KEY],
     )
Beispiel #2
0
def install_or_upgrade(installed_version, version, user_io):
    if not installed_version:
        user_io.out.writeln('Not found. Do you want to download it?',
                            front=Color.CYAN)
        return user_io.request_boolean(default_option=True)
    elif Version(installed_version) < Version(version):
        user_io.out.writeln('%s older than %s. Do you want to upgrade?' %
                            (Version(installed_version), version),
                            front=Color.CYAN)
        return user_io.request_boolean(default_option=True)
    elif Version(installed_version) >= Version(version):
        user_io.out.writeln('%s newer or equal %s. Already installed' %
                            (Version(installed_version), version),
                            front=Color.GREEN)
Beispiel #3
0
from biicode.client.shell.biistream import Color
from biicode.common.settings.osinfo import OSInfo
from biicode.common.settings.version import Version
import os
from biicode.client.setups.setup_tools import download, decompress
from biicode.common.utils.file_utils import load, save
from biicode.client.setups.conf.downloads_url import S3_URL
from biicode.client.command.process_executor import simple_exe
import re

_CMAKE_VERSION = Version('3.0.2')
_CMAKE_MIN_VERSION = Version('3.0')


def _get_cmake_download_url():
    if OSInfo.is_win():
        url = S3_URL + "cmake-%s-win32-x86.zip" % _CMAKE_VERSION
    elif OSInfo.is_mac():
        url = S3_URL + 'cmake-%s-Darwin64-universal.dmg' % _CMAKE_VERSION
    elif OSInfo.is_linux():
        import platform
        if OSInfo.architecture() == "64bit":
            url = S3_URL + "cmake-%s-Linux-64.tar.gz" % _CMAKE_VERSION
        elif OSInfo.architecture() == "32bit":
            url = S3_URL + "cmake-%s-Linux-i386.tar.gz" % _CMAKE_VERSION
        if platform.machine() == "armv6l" or platform.machine() == "armv7l":
            url = S3_URL + "cmake-%s-Linux-armv6.tar.gz" % _CMAKE_VERSION
    return url


def _cmake_version(cmake_path):
Beispiel #4
0
 def language_version(self, language_version):
     assert isinstance(language_version, str)
     self.__language_version = Version(language_version)
Beispiel #5
0
 def version_id(self, version_id):
     assert isinstance(version_id, str)
     self.__version_id = Version(version_id)
Beispiel #6
0
 def set_generic_system(self):
     self.language_version = Version()
     self.os_info = OSInfo()
Beispiel #7
0
 def test_language_version_id_setter_with_string(self):
     self.sut.language_version = "1"
     self.assertEquals(self.sut.language_version, Version("1"))
Beispiel #8
0
 def test_language_version_id_setter_with_version_instance(self):
     self.sut.language_version = Version()
     self.assertEquals(self.sut.language_version, Version())
Beispiel #9
0
 def test_version_id_setter_with_version_instance(self):
     self.sut.version_id = Version()
Beispiel #10
0
 def test_set_generic_system(self):
     self.sut.set_generic_system()
     self.assertEquals(self.sut.language_version, Version())
Beispiel #11
0
 def test_major_str(self):
     v1 = Version("3a")
     self.assertEquals("3a", str(v1))
     self.assertEquals("3a", v1.list[0])
Beispiel #12
0
 def test_major_minor_fix(self):
     v1 = Version("3.4.1")
     self.assertEquals("3.4.1", str(v1))
     self.assertEquals(3, v1.list[0])
     self.assertEquals(4, v1.list[1])
     self.assertEquals(1, v1.list[2])
Beispiel #13
0
 def test_major(self):
     v1 = Version("3")
     self.assertEquals('3', str(v1))
     self.assertEquals(3, v1.list[0])