mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 01:12:31 +00:00
airframes srcparser.py: Allow non-param comments
Add a "@desc" tag that gets ignored by the parameter parser. This allows you to add (multi-line) documentation to airframe init files.
This commit is contained in:
committed by
Lorenz Meier
parent
032b9909fa
commit
b186614857
@@ -273,7 +273,7 @@ class SourceParser(object):
|
|||||||
re_remove_dots = re.compile(r'\.+$')
|
re_remove_dots = re.compile(r'\.+$')
|
||||||
re_remove_carriage_return = re.compile('\n+')
|
re_remove_carriage_return = re.compile('\n+')
|
||||||
|
|
||||||
valid_tags = set(["url", "maintainer", "output", "arch", "name", "type"])
|
valid_tags = set(["url", "maintainer", "output", "arch", "name", "type", "desc"])
|
||||||
|
|
||||||
# Order of parameter groups
|
# Order of parameter groups
|
||||||
priority = {
|
priority = {
|
||||||
@@ -394,6 +394,9 @@ class SourceParser(object):
|
|||||||
airframe_class = tags[tag]
|
airframe_class = tags[tag]
|
||||||
elif tag == "name":
|
elif tag == "name":
|
||||||
airframe_name = tags[tag]
|
airframe_name = tags[tag]
|
||||||
|
elif tag == "desc":
|
||||||
|
# General documentation - not a parameter to be saved.
|
||||||
|
pass
|
||||||
elif tag not in self.valid_tags:
|
elif tag not in self.valid_tags:
|
||||||
sys.stderr.write("Aborting due to invalid documentation tag: '%s'\n" % tag)
|
sys.stderr.write("Aborting due to invalid documentation tag: '%s'\n" % tag)
|
||||||
return False
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user