|
@ -238,12 +238,11 @@ def validate_parser_argument(raw_schema): |
|
|
try: |
|
|
try: |
|
|
schema.validate(argument) |
|
|
schema.validate(argument) |
|
|
except Rx.SchemaMismatch as exception: |
|
|
except Rx.SchemaMismatch as exception: |
|
|
msg = 'Invalid `{}` syntax:\n---\n{}---\n{}'.format( |
|
|
msg = 'Invalid syntax:\n---\n{}---\n{}'.format( |
|
|
keyword, |
|
|
|
|
|
yaml.dump({keyword: argument}, default_flow_style=False), |
|
|
yaml.dump({keyword: argument}, default_flow_style=False), |
|
|
str(exception) |
|
|
str(exception) |
|
|
) |
|
|
) |
|
|
raise SBFileError(msg) |
|
|
raise ContentError(keyword, msg) |
|
|
return parse(keyword, argument=argument, config=config) |
|
|
return parse(keyword, argument=argument, config=config) |
|
|
return wrapped |
|
|
return wrapped |
|
|
return wrap |
|
|
return wrap |
|
@ -272,11 +271,14 @@ def process_content(content, config=None): |
|
|
if keyword not in plugins: |
|
|
if keyword not in plugins: |
|
|
contentlist.append_error(ContentError(keyword, "Unknown content keyword.")) |
|
|
contentlist.append_error(ContentError(keyword, "Unknown content keyword.")) |
|
|
continue |
|
|
continue |
|
|
|
|
|
try: |
|
|
contentlist.extend(plugins[keyword]( |
|
|
contentlist.extend(plugins[keyword]( |
|
|
keyword, |
|
|
keyword, |
|
|
argument=argument, |
|
|
argument=argument, |
|
|
config=config, |
|
|
config=config, |
|
|
)) |
|
|
)) |
|
|
|
|
|
except ContentError as error: |
|
|
|
|
|
contentlist.append_error(error) |
|
|
else: |
|
|
else: |
|
|
contentlist.append_error(ContentError(elem, "Unknown content type.")) |
|
|
contentlist.append_error(ContentError(str(elem), "Unknown content type.")) |
|
|
return contentlist |
|
|
return contentlist |
|
|