mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-29 20:18:31 -04:00
Tools: param_parse: add *args and **kwargs to emitters
This commit is contained in:
parent
5a927d84c8
commit
229b25d916
@ -11,7 +11,8 @@ import subprocess
|
|||||||
|
|
||||||
|
|
||||||
class EDNEmit(Emit):
|
class EDNEmit(Emit):
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
|
Emit.__init__(self, *args, **kwargs)
|
||||||
self.output = "{:date " + edn_format.dumps(datetime.datetime.now(pytz.utc)) + " "
|
self.output = "{:date " + edn_format.dumps(datetime.datetime.now(pytz.utc)) + " "
|
||||||
git = subprocess.Popen(["git log --pretty=format:'%h' -n 1"], shell=True, stdout=subprocess.PIPE).communicate()[0]
|
git = subprocess.Popen(["git log --pretty=format:'%h' -n 1"], shell=True, stdout=subprocess.PIPE).communicate()[0]
|
||||||
self.output += ":git-hash \"" + git.decode("ascii") + "\" "
|
self.output += ":git-hash \"" + git.decode("ascii") + "\" "
|
||||||
|
@ -7,7 +7,7 @@ import re
|
|||||||
|
|
||||||
|
|
||||||
class Emit:
|
class Emit:
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
prog_values_field = re.compile(r"\s*(-?\w+:\w+)+,*")
|
prog_values_field = re.compile(r"\s*(-?\w+:\w+)+,*")
|
||||||
|
@ -13,8 +13,8 @@ except Exception:
|
|||||||
|
|
||||||
class HtmlEmit(Emit):
|
class HtmlEmit(Emit):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
Emit.__init__(self)
|
Emit.__init__(self, *args, **kwargs)
|
||||||
html_fname = 'Parameters.html'
|
html_fname = 'Parameters.html'
|
||||||
self.f = open(html_fname, mode='w')
|
self.f = open(html_fname, mode='w')
|
||||||
self.preamble = """<!-- Dynamically generated list of documented parameters
|
self.preamble = """<!-- Dynamically generated list of documented parameters
|
||||||
|
@ -7,8 +7,8 @@ from emit import Emit
|
|||||||
|
|
||||||
# Emit APM documentation in JSON format
|
# Emit APM documentation in JSON format
|
||||||
class JSONEmit(Emit):
|
class JSONEmit(Emit):
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
Emit.__init__(self)
|
Emit.__init__(self, *args, **kwargs)
|
||||||
json_fname = 'apm.pdef.json'
|
json_fname = 'apm.pdef.json'
|
||||||
self.f = open(json_fname, mode='w')
|
self.f = open(json_fname, mode='w')
|
||||||
self.content = {"json": {"version": 0}}
|
self.content = {"json": {"version": 0}}
|
||||||
|
@ -17,8 +17,8 @@ nparams = ['RCn_', 'SERVOn_', 'SRn_', 'BTNn_']
|
|||||||
|
|
||||||
class MDEmit(Emit):
|
class MDEmit(Emit):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
Emit.__init__(self)
|
Emit.__init__(self, *args, **kwargs)
|
||||||
fname = 'Parameters.md'
|
fname = 'Parameters.md'
|
||||||
self.nparams = []
|
self.nparams = []
|
||||||
self.f = open(fname, mode='w')
|
self.f = open(fname, mode='w')
|
||||||
|
@ -20,8 +20,8 @@ This list is automatically generated from the latest ardupilot source code, and
|
|||||||
def toolname(self):
|
def toolname(self):
|
||||||
return "Tools/autotest/param_metadata/param_parse.py"
|
return "Tools/autotest/param_metadata/param_parse.py"
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
Emit.__init__(self)
|
Emit.__init__(self, *args, **kwargs)
|
||||||
output_fname = 'Parameters.rst'
|
output_fname = 'Parameters.rst'
|
||||||
self.f = open(output_fname, mode='w')
|
self.f = open(output_fname, mode='w')
|
||||||
self.spacer = re.compile("^", re.MULTILINE)
|
self.spacer = re.compile("^", re.MULTILINE)
|
||||||
|
@ -7,8 +7,8 @@ from param import known_param_fields, known_units
|
|||||||
|
|
||||||
# Emit APM documentation in an machine readable XML format
|
# Emit APM documentation in an machine readable XML format
|
||||||
class XmlEmit(Emit):
|
class XmlEmit(Emit):
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
Emit.__init__(self)
|
Emit.__init__(self, *args, **kwargs)
|
||||||
self.wiki_fname = 'apm.pdef.xml'
|
self.wiki_fname = 'apm.pdef.xml'
|
||||||
self.f = open(self.wiki_fname, mode='w')
|
self.f = open(self.wiki_fname, mode='w')
|
||||||
self.preamble = '''<?xml version="1.0" encoding="utf-8"?>
|
self.preamble = '''<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
@ -8,8 +8,8 @@ from lxml import etree
|
|||||||
|
|
||||||
# Emit ArduPilot documentation in an machine readable XML format for Mission Planner
|
# Emit ArduPilot documentation in an machine readable XML format for Mission Planner
|
||||||
class XmlEmitMP(Emit):
|
class XmlEmitMP(Emit):
|
||||||
def __init__(self):
|
def __init__(self, *args, **kwargs):
|
||||||
Emit.__init__(self)
|
Emit.__init__(self, *args, **kwargs)
|
||||||
self.mp_fname = 'ParameterMetaData.xml'
|
self.mp_fname = 'ParameterMetaData.xml'
|
||||||
self.f = open(self.mp_fname, mode='w')
|
self.f = open(self.mp_fname, mode='w')
|
||||||
self.preamble = '''<?xml version="1.0" encoding="utf-8"?>\n'''
|
self.preamble = '''<?xml version="1.0" encoding="utf-8"?>\n'''
|
||||||
|
Loading…
Reference in New Issue
Block a user