mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-29 19:17:28 +08:00
[messages] rename class to msg_class
makes it possible to use the python parser using xmlobject since class is a reserved word.
This commit is contained in:
@@ -609,7 +609,8 @@ module MessagesOfXml(Class:CLASS_Xml) = struct
|
||||
let messages_by_id, messages_by_name =
|
||||
try
|
||||
let select = fun x -> Xml.attrib x "name" = Class.name in
|
||||
parse_class (ExtXml.child Class.xml ~select "class")
|
||||
let xml_class = try ExtXml.child Class.xml ~select "msg_class" with Not_found -> ExtXml.child Class.xml ~select "class" in
|
||||
parse_class xml_class
|
||||
with
|
||||
Not_found -> failwith (sprintf "Unknown message class: %s" Class.name)
|
||||
let messages = messages_by_id
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ let ubx_xml =
|
||||
|
||||
let ubx_get_class = fun name ->
|
||||
let ubx_xml = Lazy.force ubx_xml in
|
||||
ExtXml.child ubx_xml ~select:(fun x -> ExtXml.attrib x "name" = name) "class"
|
||||
ExtXml.child ubx_xml ~select:(fun x -> ExtXml.attrib x "name" = name) "msg_class"
|
||||
|
||||
let ubx_get_msg = fun ubx_class name ->
|
||||
ExtXml.child ubx_class ~select:(fun x -> ExtXml.attrib x "name" = name) "message"
|
||||
|
||||
@@ -40,7 +40,7 @@ def GetOptions():
|
||||
def ParseMessages():
|
||||
from lxml import etree
|
||||
tree = etree.parse( messages_path)
|
||||
for the_class in tree.xpath("//class[@name]"):
|
||||
for the_class in tree.xpath("//msg_class[@name]"):
|
||||
class_name = the_class.attrib['name']
|
||||
if class_name not in message_dictionary:
|
||||
message_dictionary_id_name[class_name] = {}
|
||||
|
||||
Reference in New Issue
Block a user