Commit dfe21aaf authored by Dave Kuhlman's avatar Dave Kuhlman

v. 2.29.25 Derived types, converted unit tests to Py 3

parent a3537011
......@@ -141,6 +141,19 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Change history
--------------
Version 2.29.25 (10/05/2018)
- Added a section to the documentation (generateDS.txt) for types
derived by extension, i.e. types that use the xsi:type attribute
in the XML instance document. Thanks to Justin McManus for
motivating me to learn about this and for providing guidance and
pointers along the way.
- Added a unit test for types derived by extension.
- Converted unit tests so that we can use Python 3 not Python 2.
- Changes in ``generateDS.py`` so that it uses the ``six``
compatibility library to handle the ``urllib`` name changes
between Python 2 and 3.
Version 2.29.24 (08/27/2018)
- Changed name of parameter in the export method from "namespace_"
......
This diff is collapsed.
......@@ -187,6 +187,7 @@ also generates member specifications in each class (in a dictionary).
from __future__ import print_function
from six.moves import input
from six.moves import urllib
import six
import sys
import os.path
......@@ -202,12 +203,8 @@ import operator
import re
if sys.version_info.major == 2:
import urllib2
import StringIO
else:
import urllib.request
import urllib.error
import urllib.parse
import io
from functools import reduce
......@@ -235,7 +232,7 @@ _log = logging.getLogger(__name__)
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
VERSION = '2.29.24'
VERSION = '2.29.25'
##VERSION##
BaseStrTypes = six.string_types
......@@ -2491,7 +2488,7 @@ def generateToEtree(wrt, element, Targetnamespace):
generateToEtreeAttributes(wrt, element)
generateToEtreeChildren(wrt, element, Targetnamespace)
wrt(" if mapping_ is not None:\n")
wrt(" mapping_[self] = element\n")
wrt(" mapping_[id(self)] = element\n")
wrt(" return element\n")
# end generateToEtree
......@@ -5883,7 +5880,7 @@ def generateHeader(wrt, prefix, options, args, externalImports):
preserve_cdata_tags_pat = ""
preserve_cdata_get_text = Preserve_cdata_get_all_text2
gds_reverse_node_mapping_text = \
"return dict(((v, k) for k, v in mapping.iteritems()))"
"return dict(((v, k) for k, v in mapping.items()))"
quote_xml_text = \
"s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)"
quote_attrib_text = \
......@@ -6206,21 +6203,13 @@ def get_impl_body(classBehavior, baseImplUrl, implUrl):
if implUrl:
if baseImplUrl:
implUrl = '%s%s' % (baseImplUrl, implUrl)
if sys.version_info.major == 2:
urllib_urlopen = urllib2.urlopen
urllib_httperror = urllib2.HTTPError
urllib_urlerror = urllib2.URLError
else:
urllib_urlopen = urllib.request.urlopen
urllib_httperror = urllib.error.HTTPError
urllib_urlerror = urllib.error.URLError
try:
implFile = urllib_urlopen(implUrl)
implFile = urllib.request.urlopen(implUrl)
impl = implFile.read()
implFile.close()
except urllib_httperror:
except urllib.error.HTTPError:
err_msg('*** Implementation at %s not found.\n' % implUrl)
except urllib_urlerror:
except urllib.error.URLError:
err_msg('*** Connection refused for URL: %s\n' % implUrl)
return impl
......@@ -7075,16 +7064,17 @@ def parseAndGenerate(
for path in rootPaths:
if path.startswith('http:') or path.startswith('ftp:'):
try:
urlfile = urllib2.urlopen(path)
urlfile = urllib.request.urlopen(path)
content = urlfile.read()
urlfile.close()
if sys.version_info.major == 2:
rootFile = StringIO.StringIO()
else:
rootFile = io.StringIO()
content = content.decode()
rootFile.write(content)
rootFile.seek(0)
except urllib2.HTTPError:
except urllib.error.HTTPError:
msg = "Can't find file %s." % (path, )
raise IOError(msg)
else:
......
......@@ -12,7 +12,7 @@ generateDS -- Generate Data Structures from XML Schema
.. version
:revision: 2.29.24
:revision: 2.29.25
.. version
......@@ -1449,6 +1449,117 @@ http://www.w3.org/TR/xmlschema-0/#abstract
<http://www.w3.org/TR/xmlschema-0/#abstract>`_.
Types derived by extension
--------------------------
This section describes some of the support for types derived by
extension and also how to use the data bindings generated for those
types in Python.
For example, suppose you have an XML schema that looks like this
(``example.xsd``)::
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:element name="animalCollection">
<xs:complexType>
<xs:sequence>
<xs:element name="animal" type="animal" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="animal" abstract="true"></xs:complexType>
<xs:complexType name="dog">
<xs:complexContent>
<xs:extension base="animal">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:schema>
An XML instance document for this document type might be the
following::
<?xml version="1.0"?>
<animalCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<animal xsi:type="dog">
<name>fido</name>
</animal>
</animalCollection>
Question: How would you, in Python, using bindings generated by
``generateDS.py``, create an instance of type ``dog`` that is
derived from type ``animal`` and when exported to XML, appears as an
animal with attribute ``xsi:type="dog"``?
First, we need to generate our bindings::
$ generateDS.py -o example01.py example.xsd
And, now, here is Python some code that creates those instances and
exports them::
# sample01.py
import sys
import example01
def test():
animal_collection = example01.animalCollection()
animal = example01.dog(name='milicent')
#
# must set original_tagname_ and extensiontype_ for
# type derived by extension. See:
# https://www.w3.org/TR/2004/REC-xmlschema-0-20041028/#DerivExt
animal.original_tagname_ = 'animal'
animal.extensiontype_ = 'dog'
animal_collection.add_animal(animal)
animal_collection.export(sys.stdout, 0)
return animal_collection, animal
test()
Notes:
- The above code creates an instance of class ``animalCollection``
and an instance of class ``dog``.
- Because we want the ``dog`` to be represented in XML as a
"<animal>" with an "xsi:type" attribute, we must set the
``original_tagname_`` and ``extensiontype_`` attributes in the
instance of class ``dog``.
- Then we add our ``dog`` to the ``animalCollection``, and finally,
we export it.
- We can get some clues about this by reading the code generated for
classes ``animalCollection``, ``animal``, and ``dog``.
When we run it, we'll see::
$ python sample01.py
<animalCollection>
<animal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="dog">
<name>milicent</name>
</animal>
</animalCollection>
For more information on types derived by extension, see "XML Schema
Part 0: Primer Second Edition", specifically:
- "Deriving Types by Extension" --
https://www.w3.org/TR/2004/REC-xmlschema-0-20041028/#DerivExt
- "Using Derived Types in Instance Documents" --
https://www.w3.org/TR/2004/REC-xmlschema-0-20041028/#UseDerivInInstDocs
The XML schema input to generateDS
==================================
......
......@@ -220,7 +220,7 @@ They are used by updateversion.py. -->
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.24</td>
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.25</td>
</tr>
</tbody>
</table>
......@@ -229,7 +229,7 @@ They are used by updateversion.py. -->
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">date:</th><td class="field-body">August 27, 2018</td>
<tr class="field"><th class="field-name">date:</th><td class="field-body">October 05, 2018</td>
</tr>
</tbody>
</table>
......@@ -401,7 +401,7 @@ $ mv generateds_gui.mo locale/ru/LC_MESSAGES/
<div class="footer">
<hr class="footer" />
<a class="reference external" href="generateds_gui_notes.txt">View document source</a>.
Generated on: 2018-08-27 21:50 UTC.
Generated on: 2018-10-05 19:59 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
......
......@@ -12,7 +12,7 @@ GenerateDS GUI Notes
.. version
:revision: 2.29.24
:revision: 2.29.25
.. version
......
......@@ -41,7 +41,7 @@ from libgenerateDS.gui import generateds_gui_session
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
VERSION = '2.29.24'
VERSION = '2.29.25'
##VERSION##
......
......@@ -217,7 +217,7 @@ dkuhlman (at) davekuhlman (dot) org
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.24</td>
<tr class="field"><th class="field-name">revision:</th><td class="field-body">2.29.25</td>
</tr>
</tbody>
</table>
......@@ -226,7 +226,7 @@ dkuhlman (at) davekuhlman (dot) org
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">date:</th><td class="field-body">August 27, 2018</td>
<tr class="field"><th class="field-name">date:</th><td class="field-body">October 05, 2018</td>
</tr>
</tbody>
</table>
......@@ -380,7 +380,7 @@ this command for your needs. For example, you may need to use
<div class="footer">
<hr class="footer" />
<a class="reference external" href="librarytemplate_howto.txt">View document source</a>.
Generated on: 2018-08-27 21:50 UTC.
Generated on: 2018-10-05 19:59 UTC.
Generated by <a class="reference external" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference external" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
......
......@@ -8,7 +8,7 @@ How to package a generateDS.py generated library
.. version
:revision: 2.29.24
:revision: 2.29.25
.. version
......
......@@ -40,7 +40,7 @@ except ImportError:
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
VERSION = '2.29.24'
VERSION = '2.29.25'
##VERSION##
CatalogDict = {}
......
......@@ -8,7 +8,7 @@ setup(
# Do not modify the following VERSION comments.
# Used by updateversion.py.
##VERSION##
version="2.29.24",
version="2.29.25",
##VERSION##
author="Dave Kuhlman",
author_email="dkuhlman@davekuhlman.org",
......
......@@ -3,7 +3,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......@@ -404,7 +404,7 @@ except ImportError as exp:
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
......@@ -731,8 +731,8 @@ def _cast(typ, value):
class oneperType00_1(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('inner01', 'oneperType01_1', 0, 0, {u'type': u'oneperType01_1', u'name': u'inner01'}, None),
MemberSpec_('inner02', 'oneperType01_2', 0, 0, {u'type': u'oneperType01_2', u'name': u'inner02'}, None),
MemberSpec_('inner01', 'oneperType01_1', 0, 0, {'name': 'inner01', 'type': 'oneperType01_1'}, None),
MemberSpec_('inner02', 'oneperType01_2', 0, 0, {'name': 'inner02', 'type': 'oneperType01_2'}, None),
]
subclass = None
superclass = None
......
......@@ -3,7 +3,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......@@ -404,7 +404,7 @@ except ImportError as exp:
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
......@@ -731,8 +731,8 @@ def _cast(typ, value):
class oneperType01_1(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('username', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'username'}, None),
MemberSpec_('inner01', 'oneperType01_2', 0, 0, {u'type': u'oneperType01_2', u'name': u'inner01'}, None),
MemberSpec_('username', 'xs:string', 0, 0, {'name': 'username', 'type': 'xs:string'}, None),
MemberSpec_('inner01', 'oneperType01_2', 0, 0, {'name': 'inner01', 'type': 'oneperType01_2'}, None),
]
subclass = None
superclass = None
......@@ -820,7 +820,7 @@ class oneperType01_1(GeneratedsSuper):
class oneperType01_2(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('userdescription', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'userdescription'}, None),
MemberSpec_('userdescription', 'xs:string', 0, 0, {'name': 'userdescription', 'type': 'xs:string'}, None),
]
subclass = None
superclass = None
......
......@@ -3,7 +3,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......@@ -404,7 +404,7 @@ except ImportError as exp:
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
......@@ -731,8 +731,8 @@ def _cast(typ, value):
class oneperType02_1(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('clientname', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'clientname'}, None),
MemberSpec_('inner01', 'oneperType02_2', 0, 0, {u'type': u'oneperType02_2', u'name': u'inner01'}, None),
MemberSpec_('clientname', 'xs:string', 0, 0, {'name': 'clientname', 'type': 'xs:string'}, None),
MemberSpec_('inner01', 'oneperType02_2', 0, 0, {'name': 'inner01', 'type': 'oneperType02_2'}, None),
]
subclass = None
superclass = None
......@@ -820,7 +820,7 @@ class oneperType02_1(GeneratedsSuper):
class oneperType02_2(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('clientdescription', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'clientdescription'}, None),
MemberSpec_('clientdescription', 'xs:string', 0, 0, {'name': 'clientdescription', 'type': 'xs:string'}, None),
]
subclass = None
superclass = None
......
......@@ -3,7 +3,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......@@ -404,7 +404,7 @@ except ImportError as exp:
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
......@@ -731,8 +731,8 @@ def _cast(typ, value):
class oneperType03_1(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('helpername', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'helpername'}, None),
MemberSpec_('inner01', 'oneperType02_2', 0, 0, {u'type': u'oneperType02_2', u'name': u'inner01'}, None),
MemberSpec_('helpername', 'xs:string', 0, 0, {'name': 'helpername', 'type': 'xs:string'}, None),
MemberSpec_('inner01', 'oneperType02_2', 0, 0, {'name': 'inner01', 'type': 'oneperType02_2'}, None),
]
subclass = None
superclass = None
......@@ -820,7 +820,7 @@ class oneperType03_1(GeneratedsSuper):
class oneperType03_2(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('helperdescription', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'helperdescription'}, None),
MemberSpec_('helperdescription', 'xs:string', 0, 0, {'name': 'helperdescription', 'type': 'xs:string'}, None),
]
subclass = None
superclass = None
......
......@@ -2,7 +2,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......
......@@ -3,7 +3,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......@@ -403,7 +403,7 @@ except ImportError as exp:
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
......@@ -730,7 +730,7 @@ def _cast(typ, value):
class carrierType(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('fleet', 'Vehicle', 1, 0, {u'maxOccurs': u'unbounded', u'type': u'Vehicle', u'name': u'fleet'}, None),
MemberSpec_('fleet', 'Vehicle', 1, 0, {'name': 'fleet', 'type': 'Vehicle', 'maxOccurs': 'unbounded'}, None),
]
subclass = None
superclass = None
......
......@@ -2,7 +2,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......
......@@ -3,7 +3,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......@@ -403,7 +403,7 @@ except ImportError as exp:
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
......@@ -733,8 +733,8 @@ class document1Type(GeneratedsSuper):
test purposes. It should make a somewhat uninteresting
docstring."""
member_data_items_ = [
MemberSpec_('comments', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'comments'}, None),
MemberSpec_('otherdoc', 'document2Type', 0, 0, {u'type': u'document2Type', u'name': u'otherdoc'}, None),
MemberSpec_('comments', 'xs:string', 0, 0, {'name': 'comments', 'type': 'xs:string'}, None),
MemberSpec_('otherdoc', 'document2Type', 0, 0, {'name': 'otherdoc', 'type': 'document2Type'}, None),
]
subclass = None
superclass = None
......@@ -825,9 +825,9 @@ class document2Type(GeneratedsSuper):
test purposes. It should make a somewhat uninteresting
docstring."""
member_data_items_ = [
MemberSpec_('comments', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'comments'}, None),
MemberSpec_('rating', 'xs:integer', 0, 0, {u'type': u'xs:integer', u'name': u'rating'}, None),
MemberSpec_('anotherdoc', 'document3Type', 0, 0, {u'type': u'document3Type', u'name': u'anotherdoc'}, None),
MemberSpec_('comments', 'xs:string', 0, 0, {'name': 'comments', 'type': 'xs:string'}, None),
MemberSpec_('rating', 'xs:integer', 0, 0, {'name': 'rating', 'type': 'xs:integer'}, None),
MemberSpec_('anotherdoc', 'document3Type', 0, 0, {'name': 'anotherdoc', 'type': 'document3Type'}, None),
]
subclass = None
superclass = None
......@@ -931,8 +931,8 @@ class document2Type(GeneratedsSuper):
class document3Type(GeneratedsSuper):
"""This is a element of Type 3. It is short."""
member_data_items_ = [
MemberSpec_('comments', 'xs:string', 0, 0, {u'type': u'xs:string', u'name': u'comments'}, None),
MemberSpec_('rating', 'xs:integer', 0, 0, {u'type': u'xs:integer', u'name': u'rating'}, None),
MemberSpec_('comments', 'xs:string', 0, 0, {'name': 'comments', 'type': 'xs:string'}, None),
MemberSpec_('rating', 'xs:integer', 0, 0, {'name': 'rating', 'type': 'xs:integer'}, None),
]
subclass = None
superclass = None
......
......@@ -2,7 +2,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......
......@@ -3,7 +3,7 @@
#
# Generated by generateDS.py.
# Python 2.7.15 |Anaconda custom (64-bit)| (default, May 1 2018, 23:32:55) [GCC 7.2.0]
# Python 3.6.6 |Anaconda custom (64-bit)| (default, Jun 28 2018, 17:14:51) [GCC 7.2.0]
#
# Command line options:
# ('--no-dates', '')
......@@ -403,7 +403,7 @@ except ImportError as exp:
return None
@classmethod
def gds_reverse_node_mapping(cls, mapping):
return dict(((v, k) for k, v in mapping.iteritems()))
return dict(((v, k) for k, v in mapping.items()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
......@@ -730,9 +730,9 @@ def _cast(typ, value):
class FooList(GeneratedsSuper):
member_data_items_ = [
MemberSpec_('Foo', 'FooType1', 0, 0, {u'type': u'FooType1', u'name': u'Foo'}, None),
MemberSpec_('Bar', 'BarType2', 0, 0, {u'type': u'BarType2', u'name': u'Bar'}, None),
MemberSpec_('Baz', 'BazType3', 0, 0, {u'type': u'BazType3', u'name': u'Baz'}, None),