diff options
author | Julian Oes <julian@oes.ch> | 2014-02-12 17:10:20 +0100 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2014-02-12 17:10:20 +0100 |
commit | 3462054f73dda9303fcb1b2b5ba0a6f0882ddbd9 (patch) | |
tree | 511c63dcc6aae5222c6685e3f1648b2d8f5b2c6b /Tools/px4params/dokuwikiout.py | |
parent | 76ae004e5c6c1dcc05f1eb784f6dc14cff2a3671 (diff) | |
parent | 03cfb79b29a81443665208396ba8fc0ab67a021a (diff) | |
download | px4-firmware-3462054f73dda9303fcb1b2b5ba0a6f0882ddbd9.tar.gz px4-firmware-3462054f73dda9303fcb1b2b5ba0a6f0882ddbd9.tar.bz2 px4-firmware-3462054f73dda9303fcb1b2b5ba0a6f0882ddbd9.zip |
Merge remote-tracking branch 'px4/beta' into beta_mavlink
Conflicts:
src/modules/mavlink/mavlink.c
src/modules/mavlink/mavlink_receiver.h
src/modules/mavlink/orb_listener.c
Diffstat (limited to 'Tools/px4params/dokuwikiout.py')
-rw-r--r-- | Tools/px4params/dokuwikiout.py | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/Tools/px4params/dokuwikiout.py b/Tools/px4params/dokuwikiout.py index 4d40a6201..c5cf65ea6 100644 --- a/Tools/px4params/dokuwikiout.py +++ b/Tools/px4params/dokuwikiout.py @@ -1,10 +1,24 @@ import output +from xml.sax.saxutils import escape class DokuWikiOutput(output.Output): def Generate(self, groups): - result = "" + pre_text = """<?xml version='1.0'?> + <methodCall> + <methodName>wiki.putPage</methodName> + <params> + <param> + <value> + <string>:firmware:parameters</string> + </value> + </param> + <param> + <value> + <string>""" + result = "====== Parameter Reference ======\nThis list is auto-generated every few minutes and contains the most recent parameter names and default values." for group in groups: result += "==== %s ====\n\n" % group.GetName() + result += "|< 100% 20% 20% 10% 10% 10% 30%>|\n" result += "^ Name ^ Description ^ Min ^ Max ^ Default ^ Comment ^\n" for param in group.GetParams(): code = param.GetFieldValue("code") @@ -13,25 +27,36 @@ class DokuWikiOutput(output.Output): result += "| %s | %s " % (code, name) min_val = param.GetFieldValue("min") if min_val is not None: - result += "| %s " % min_val + result += " | %s " % min_val else: - result += "|" + result += " | " max_val = param.GetFieldValue("max") if max_val is not None: - result += "| %s " % max_val + result += " | %s " % max_val else: - result += "|" + result += " | " def_val = param.GetFieldValue("default") if def_val is not None: result += "| %s " % def_val else: - result += "|" + result += " | " long_desc = param.GetFieldValue("long_desc") if long_desc is not None: long_desc = long_desc.replace("\n", "") result += "| %s " % long_desc else: - result += "|" - result += "|\n" + result += " | " + result += " |\n" result += "\n" - return result + post_text = """</string> + </value> + </param> + <param> + <value> + <name>sum</name> + <string>Updated parameters automagically from code.</string> + </value> + </param> + </params> + </methodCall>""" + return pre_text + escape(result) + post_text |