summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2010-04-17 17:23:09 +0000
committeryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2010-04-17 17:23:09 +0000
commit7654c1cfe6a14b07a9d8f7cf19a9b9a5e3f2d8ae (patch)
treebdbbe705801b066e9928aac0b95a4ff5090b2a71
parenta588e01a6ee69b8a8f4f51d8d5956ed7fdc04ffb (diff)
downloadebus-alt-7654c1cfe6a14b07a9d8f7cf19a9b9a5e3f2d8ae.tar.gz
ebus-alt-7654c1cfe6a14b07a9d8f7cf19a9b9a5e3f2d8ae.zip
test.py xml
git-svn-id: http://10.2.2.13/svn/common/ebus@1660 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
-rw-r--r--test.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..292ac42
--- /dev/null
+++ b/test.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python2.5
+import os
+from lxml import objectify
+from lxml import etree
+class EbusProtocol:
+ doc = objectify.parse(open(
+ os.path.join( os.path.dirname(__file__), "ebus/ebus_specification.xml")))
+
+ @staticmethod
+ def get_packet(primary, secondary):
+ return (EbusProtocol.doc.xpath("/ebus/packets/packet[@primary=$primary and @secondary=$secondary]",
+ primary=primary,secondary=secondary) or [None])[0]
+
+p=EbusProtocol.get_packet("0x05","0x07")
+for field in p.fields.iterchildren():
+ print field.tag,field.get("name"), "l"