How to use the kas.__compatible_file_version__ function in kas

To help you get started, we’ve selected a few kas examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github siemens / kas / kas / kas.py View on Github external
def kas_get_argparser():
    """
        Creates an argparser for kas with all plugins.
    """
    parser = argparse.ArgumentParser(description='kas - setup tool for '
                                     'bitbake based project')

    verstr = '%(prog)s {} (configuration format version {}, ' \
        'earliest compatible version {})'.format(__version__, __file_version__,
                                                 __compatible_file_version__)
    parser.add_argument('--version', action='version', version=verstr)

    parser.add_argument('-d', '--debug',
                        action='store_true',
                        help='Enable debug logging')

    subparser = parser.add_subparsers(help='sub command help', dest='cmd')
    for ext_plugin in pkg_resources.iter_entry_points('kas.plugins'):
        ext_plugin.load()

    for plugin in getattr(kasplugin, 'plugins', []):
        plugin_parser = subparser.add_parser(plugin.name, help=plugin.helpmsg)
        setup_parser_common_args(plugin_parser)
        plugin.setup_parser(plugin_parser)

    return parser
github siemens / kas / kas / includehandler.py View on Github external
raise LoadConfigException('Error(s) occured while validating the '
                                  'config file', filename)

    try:
        version_value = int(config['header']['version'])
    except ValueError:
        # Be compatible: version string '0.10' is equivalent to file version 1
        # This check is already done in the config schema so here just set the
        # right version
        version_value = 1

    if version_value < __compatible_file_version__ or \
       version_value > __file_version__:
        raise LoadConfigException('This version of kas is compatible with '
                                  'version {} to {}, file has version {}'
                                  .format(__compatible_file_version__,
                                          __file_version__, version_value),
                                  filename)

    return config
github siemens / kas / kas / includehandler.py View on Github external
validation_error = True
        logging.error('Config file validation Error:\n%s', error)

    if validation_error:
        raise LoadConfigException('Error(s) occured while validating the '
                                  'config file', filename)

    try:
        version_value = int(config['header']['version'])
    except ValueError:
        # Be compatible: version string '0.10' is equivalent to file version 1
        # This check is already done in the config schema so here just set the
        # right version
        version_value = 1

    if version_value < __compatible_file_version__ or \
       version_value > __file_version__:
        raise LoadConfigException('This version of kas is compatible with '
                                  'version {} to {}, file has version {}'
                                  .format(__compatible_file_version__,
                                          __file_version__, version_value),
                                  filename)

    return config