Skip to content

Commit

Permalink
fix custom messages validation
Browse files Browse the repository at this point in the history
  • Loading branch information
gautierhattenberger committed Jul 5, 2017
1 parent 775e698 commit 182409f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/generator/gen_messages.py
Expand Up @@ -66,9 +66,12 @@ def pprz_validate(fname, schema, errorLimitNumber) :
directory = os.path.dirname(fname)
schemaFile = os.path.join(directory, schemaFileName)
if not os.path.isfile(schemaFile):
print ("Schema file %s does not exist." % (schemaFile))
sys.exit(1);
print("Validating msg_class %s in %s with %s" % (opts.class_name, fname,schemaFile))
print ("Schema file %s does not exist. Trying default path." % (schemaFile))
schemaFile = os.path.join(os.path.dirname(os.path.realpath(__file__)), schemaFileName)
if not os.path.isfile(schemaFile):
print ("Schema default file %s does not exist. Leaving." % (schemaFile))
sys.exit(1)
print("Validating msg_class %s in %s with %s" % (opts.class_name, fname, schemaFile))

validation_result = pprz_validate(fname, schemaFile, opts.error_limit)
else:
Expand Down

0 comments on commit 182409f

Please sign in to comment.