param_metadata: support .pde files for parameter autodocs

This commit is contained in:
Andrew Tridgell 2013-09-12 09:51:59 +10:00
parent d20644e664
commit bfd61fec15
1 changed files with 11 additions and 2 deletions

View File

@ -104,12 +104,21 @@ for library in libraries:
paths = library.Path.split(',') paths = library.Path.split(',')
for path in paths: for path in paths:
path = path.strip() path = path.strip()
debug("\n Processing file %s" % path) debug("\n Processing file '%s'" % path)
libraryfname = os.path.normpath(os.path.join(apm_path + '/libraries/' + path)) if path.endswith('.pde'):
if len(vehicles) != 1:
error("Unable to handle multiple vehicles with .pde library")
continue
libraryfname = os.path.join(vehicles[0].path, path)
else:
libraryfname = os.path.normpath(os.path.join(apm_path + '/libraries/' + path))
if path and os.path.exists(libraryfname): if path and os.path.exists(libraryfname):
f = open(libraryfname) f = open(libraryfname)
p_text = f.read() p_text = f.read()
f.close() f.close()
else:
error("Path %s not found for library %s" % (path, library.name))
continue
param_matches = prog_group_param.findall(p_text) param_matches = prog_group_param.findall(p_text)
debug("Found %u documented parameters" % len(param_matches)) debug("Found %u documented parameters" % len(param_matches))