Example #1
0
def CompatibleWithYcmCore():
    try:
        current_core_version = ycm_core.YcmCoreVersion()
    except AttributeError:
        return False

    return current_core_version == COMPATIBLE_WITH_CORE_VERSION
Example #2
0
def ImportAndCheckCore():
    """Checks if ycm_core library is compatible and returns with an exit
  status."""
    try:
        LoadYcmCoreDependencies()
        ycm_core = ImportCore()
    except ImportError as error:
        message = str(error)
        if CORE_MISSING_ERROR_REGEX.match(message):
            LOGGER.exception(CORE_MISSING_MESSAGE)
            return CORE_MISSING_STATUS
        if CORE_PYTHON2_ERROR_REGEX.match(message):
            LOGGER.exception(CORE_PYTHON2_MESSAGE)
            return CORE_PYTHON2_STATUS
        if CORE_PYTHON3_ERROR_REGEX.match(message):
            LOGGER.exception(CORE_PYTHON3_MESSAGE)
            return CORE_PYTHON3_STATUS
        LOGGER.exception(message)
        return CORE_UNEXPECTED_STATUS

    try:
        current_core_version = ycm_core.YcmCoreVersion()
    except AttributeError:
        LOGGER.exception(CORE_OUTDATED_MESSAGE)
        return CORE_OUTDATED_STATUS

    if ExpectedCoreVersion() != current_core_version:
        LOGGER.error(CORE_OUTDATED_MESSAGE)
        return CORE_OUTDATED_STATUS

    return CORE_COMPATIBLE_STATUS
Example #3
0
def CompatibleWithCurrentCoreVersion():
    import ycm_core
    try:
        current_core_version = ycm_core.YcmCoreVersion()
    except AttributeError:
        return False
    return ExpectedCoreVersion() == current_core_version