pyloxi: parse unknown subclasses as the superclass
Previously we would throw an exception if we encountered a (for example)
experimenter action subclass that we didn't know existed. This was fine for
OFTest but causes problems for other tools that use pyloxi.
This change generates a full set of pack/unpack/pretty_print functions for
virtual classes. If a discriminator field contains a subtype we don't know
about, the virtual class is instantiated instead.
This also removes the special cases around unknown hello elements.
diff --git a/py_gen/templates/_unpack.py b/py_gen/templates/_unpack.py
index 81f74c7..cce9de3 100644
--- a/py_gen/templates/_unpack.py
+++ b/py_gen/templates/_unpack.py
@@ -42,7 +42,7 @@
:: elif type(m) == OFTypeMember:
_${m.name} = ${gen_unpack_expr(m.oftype, 'reader', version=version)}
assert(_${m.name} == ${m.value})
-:: elif type(m) == OFDataMember:
+:: elif type(m) == OFDataMember or type(m) == OFDiscriminatorMember:
:: if m.name in field_length_members:
:: reader_expr = 'reader.slice(_%s)' % field_length_members[m.name].name
:: else: