Broken inheritance when generating code
Brought to you by:
dkuhlman
Hello!
I have been testing the people library, but when running python people.py people.xml I receive the following error:
Traceback (most recent call last):
File "people.py", line 4390, in <module>
main()
File "people.py", line 4383, in main
parse(args[0])
File "people.py", line 4253, in parse
rootObj.build(rootNode, gds_collector_=gds_collector)
File "people.py", line 1196, in build
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
File "people.py", line 1203, in _buildChildren
obj_.build(child_, gds_collector_=gds_collector_)
File "people.py", line 1368, in build
self._buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
File "people.py", line 1375, in _buildChildren
valuestr_ = self.gds_parse_string(valuestr_, node, 'emp')
AttributeError: 'commentsType' object has no attribute 'gds_parse_string'
The generated “commentsType” class appears to be a subclass of GeneratedsSuper, so it should have visibility on gds_parse_string. Is this a bug or am I doing something wrong?
Many thanks!
Pablo
Pablo,
I'm trying to reproduce the exception that you've reported.
Here's what I've done:
I copied
people.xsdand people.xml fromgenerateds/testsinthe source code distribution.
I generated a module with this:
$ ./generateDS.py -o people.py people.xsd
I ran that module against
people.xml:$ python people.py people.xml
The above ran successfully and produced output.
There are also
people.xsdandpeople.xmlin thegenerateds/Demos/Peoplesubdirectory. In order to run a test withthose, you need to use the
run-full-test.shshell script (or amodified version of it for Windows, I suppose). That also runs
successfully.
So, we need to figure out what you are doing that is different from
what I've done.
Question 1: Can you suggest something that I can do to reproduce
your exception?
Question 2: Are you using
people.xsdandpeople.xmlthat aredifferent from the ones I've tested with? If so, where did you get
people.xsdandpeople.xml?Question 3: Can you think of anything else that I am doing that is
different from your test and that might cause that exception?
Dave
One more question: What command line flags did you use when you ran
generateDS.py(orgenerateds)? What were the commands that you ran for your test? Perhaps you could copy and paste them in a reply.In general, I'm groping for any information that would enable me to reproduce the error.
Dave