Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
87 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python | ||
from __future__ import print_function | ||
|
||
from optparse import OptionParser | ||
#import xml.etree.ElementTree as ET | ||
import lxml.etree as ET | ||
#print(lxml.etree.LXML_VERSION) | ||
|
||
|
||
import os | ||
import sys | ||
import glob | ||
import re | ||
|
||
import paparazzi | ||
|
||
def organize_airframe_xml(): | ||
airframe = ET.fromstring("<!DOCTYPE airframe SYSTEM \"airframe.dtd\"><!-- Airframe comment --> <airframe/>") | ||
airframe.append(ET.Comment("+-+-+-+-+-+-+- FIRMWARES -+-+-+-+-+-+-+")) | ||
child2 = ET.SubElement(airframe, "firmware") | ||
#airframe.append(airframe_xml.getroot().find("firmware")) | ||
airframe.append(ET.Comment("+-+-+-+-+-+-+- MODULES -+-+-+-+-+-+-+")) | ||
child3 = ET.SubElement(airframe, "modules") | ||
airframe.append(ET.Comment("+-+-+-+-+-+-+- ACTUATORS -+-+-+-+-+-+-+")) | ||
airframe.append(ET.Comment("+-+-+-+-+-+-+- GAINS -+-+-+-+-+-+-+")) | ||
child4 = ET.SubElement(airframe, "gains") | ||
airframe.append(ET.Comment("+-+-+-+-+-+-+- MISC -+-+-+-+-+-+-+")) | ||
print(ET.tostring(airframe, encoding=None, method="xml", pretty_print=True, with_tail=True, | ||
standalone=None)) | ||
ET.ElementTree(airframe).write('test.xml', pretty_print=True) | ||
|
||
|
||
if __name__ == '__main__': | ||
print(paparazzi.home_dir) | ||
organize_airframe_xml() | ||
|
||
print("test") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters