mirror of https://github.com/ArduPilot/ardupilot
param_metadata: support .pde files for parameter autodocs
This commit is contained in:
parent
d20644e664
commit
bfd61fec15
|
@ -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))
|
||||||
|
|
Loading…
Reference in New Issue