diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-29 14:51:57 +0100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-29 14:51:57 +0100 |
commit | d40382425f3b79bd662949e7259479e568e8698e (patch) | |
tree | 06126afa087bd4b263b637c6c376c9060ae44632 | |
parent | 08a6057ef8c4aa796751c5ac07ab8efa7529b150 (diff) | |
download | px4-firmware-d40382425f3b79bd662949e7259479e568e8698e.tar.gz px4-firmware-d40382425f3b79bd662949e7259479e568e8698e.tar.bz2 px4-firmware-d40382425f3b79bd662949e7259479e568e8698e.zip |
Triggering param documentation generation
-rw-r--r-- | Tools/px4params/.gitignore | 3 | ||||
-rw-r--r-- | Tools/px4params/dokuwikiout.py | 29 | ||||
-rw-r--r-- | Tools/px4params/xmlrpc.sh | 5 |
3 files changed, 34 insertions, 3 deletions
diff --git a/Tools/px4params/.gitignore b/Tools/px4params/.gitignore index 73cf39575..5d0378b4a 100644 --- a/Tools/px4params/.gitignore +++ b/Tools/px4params/.gitignore @@ -1,2 +1,3 @@ parameters.wiki -parameters.xml
\ No newline at end of file +parameters.xml +cookies.txt
\ No newline at end of file diff --git a/Tools/px4params/dokuwikiout.py b/Tools/px4params/dokuwikiout.py index 4d40a6201..c4fadbd35 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>:dev:parameters:reference</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") @@ -34,4 +48,15 @@ class DokuWikiOutput(output.Output): 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 diff --git a/Tools/px4params/xmlrpc.sh b/Tools/px4params/xmlrpc.sh new file mode 100644 index 000000000..36c52ff71 --- /dev/null +++ b/Tools/px4params/xmlrpc.sh @@ -0,0 +1,5 @@ +python px_process_params.py + +rm cookies.txt +curl --cookie cookies.txt --cookie-jar cookies.txt --user-agent Mozilla/4.0 --data "u=$XMLRPCUSER&p=$XMLRPCPASS" https://pixhawk.org/start?do=login +curl -k --cookie cookies.txt -H "Content-Type: application/xml" -X POST --data-binary @parameters.wiki "https://pixhawk.org/lib/exe/xmlrpc.php" |