How to use the sdv.ArgumentError function in sdv

To help you get started, we’ve selected a few sdv 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 STIXProject / stix-validator / sdv.py View on Github external
if (args.files and any((settings.SCHEMAS, args.use_schemaloc))):
        schema_validate = True

    if schema_validate and args.profile:
        profile_validate = True

    if args.profile and any((args.schematron, args.xslt)):
        profile_convert = True

    if all((args.stix_version, args.use_schemaloc)):
        raise ArgumentError("Cannot set both --stix-version and "
                            "--use-schemalocs")

    if any((args.xslt, args.schematron)) and not args.profile:
        raise ArgumentError("Profile filename is required when profile "
                            "conversion options are set.")

    if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
        raise ArgumentError("Must provide either --use-schemaloc or "
                            "settings.SCHEMAS when --input-file or input-dir "
                            "declared")

    if (args.profile and not any((profile_validate, profile_convert))):
        raise ArgumentError("Profile specified but no conversion options or "
                            "validation options specified")
github STIXProject / stix-validator / sdv.py View on Github external
if schema_validate and args.profile:
        profile_validate = True

    if args.profile and any((args.schematron, args.xslt)):
        profile_convert = True

    if all((args.stix_version, args.use_schemaloc)):
        raise ArgumentError("Cannot set both --stix-version and "
                            "--use-schemalocs")

    if any((args.xslt, args.schematron)) and not args.profile:
        raise ArgumentError("Profile filename is required when profile "
                            "conversion options are set.")

    if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
        raise ArgumentError("Must provide either --use-schemaloc or "
                            "settings.SCHEMAS when --input-file or input-dir "
                            "declared")

    if (args.profile and not any((profile_validate, profile_convert))):
        raise ArgumentError("Profile specified but no conversion options or "
                            "validation options specified")
github STIXProject / stix-validator / sdv.py View on Github external
def _validate_args(args):

    schema_validate = False
    profile_validate = False
    profile_convert = False

    if len(sys.argv) == 1:
        raise ArgumentError("Invalid arguments", show_help=True)

    if (args.files and any((settings.SCHEMAS, args.use_schemaloc))):
        schema_validate = True

    if schema_validate and args.profile:
        profile_validate = True

    if args.profile and any((args.schematron, args.xslt)):
        profile_convert = True

    if all((args.stix_version, args.use_schemaloc)):
        raise ArgumentError("Cannot set both --stix-version and "
                            "--use-schemalocs")

    if any((args.xslt, args.schematron)) and not args.profile:
        raise ArgumentError("Profile filename is required when profile "
github STIXProject / stix-validator / sdv.py View on Github external
if all((args.stix_version, args.use_schemaloc)):
        raise ArgumentError("Cannot set both --stix-version and "
                            "--use-schemalocs")

    if any((args.xslt, args.schematron)) and not args.profile:
        raise ArgumentError("Profile filename is required when profile "
                            "conversion options are set.")

    if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
        raise ArgumentError("Must provide either --use-schemaloc or "
                            "settings.SCHEMAS when --input-file or input-dir "
                            "declared")

    if (args.profile and not any((profile_validate, profile_convert))):
        raise ArgumentError("Profile specified but no conversion options or "
                            "validation options specified")
github STIXProject / stix-validator / sdv.py View on Github external
profile_convert = False

    if len(sys.argv) == 1:
        raise ArgumentError("Invalid arguments", show_help=True)

    if (args.files and any((settings.SCHEMAS, args.use_schemaloc))):
        schema_validate = True

    if schema_validate and args.profile:
        profile_validate = True

    if args.profile and any((args.schematron, args.xslt)):
        profile_convert = True

    if all((args.stix_version, args.use_schemaloc)):
        raise ArgumentError("Cannot set both --stix-version and "
                            "--use-schemalocs")

    if any((args.xslt, args.schematron)) and not args.profile:
        raise ArgumentError("Profile filename is required when profile "
                            "conversion options are set.")

    if (args.files and not any((settings.SCHEMAS, args.use_schemaloc))):
        raise ArgumentError("Must provide either --use-schemaloc or "
                            "settings.SCHEMAS when --input-file or input-dir "
                            "declared")

    if (args.profile and not any((profile_validate, profile_convert))):
        raise ArgumentError("Profile specified but no conversion options or "
                            "validation options specified")