On Thu, Oct 13, 2016 at 03:42:33PM +0300, Lev Israel wrote:
> Sorry - the corrected code should be:
>
> self.value.export(outfile, level, namespace, name,
> pretty_print=pretty_print)
>
> The positional arguments were in the right order, it was only the absence
> of a namespacedef_ and/or passing pretty_print as a positional argument
> that was troublesome here.
Lev,
Thanks for catching this bug. And, thank you for the fix.
I've patched your fix into my repo. And, I've re-run the unit tests
and brought them up-to-date.
I've attached a patch file containing this change. And, I pushed
this change to the Mercurial repository at Bitbucket:
https://bitbucket.org/dkuhlman/generateds
Thanks again.
Dave
>
> On Thu, Oct 13, 2016 at 3:30 PM, Lev Israel <l...@sefaria.org> wrote:
>
> > The attached python file was generated from the attached XSD using version
> > 2.23a.
> > I found that in trying to parse the attached XML (I apologize for the
> > extended RTL character set), I would get this error (just the tail here):
> >
> > File "/Users/levisrael/sefaria/Sefaria-Data/sources/Mesechtot
> > Ketanot/DCXML.py", line 2034, in exportChildren
> > item_.export(outfile, level, item_.name, namespace_,
> > pretty_print=pretty_print)
> > File "/Users/levisrael/sefaria/Sefaria-Data/sources/Mesechtot
> > Ketanot/DCXML.py", line 545, in export
> > self.value.export(outfile, level, namespace, name, pretty_print)
> > File "/Users/levisrael/sefaria/Sefaria-Data/sources/Mesechtot
> > Ketanot/DCXML.py", line 2123, in export
> > outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' +
> > namespacedef_ or '', ))
> > TypeError: cannot concatenate 'str' and 'bool' objects
> >
> > In looking at the code, it looks like there's a signature mismatch in the
> > terminal branch of MixedContainer.export():
> >
> > I changed:
> > self.value.export(outfile, level, namespace, name,
> > pretty_print)
> >
> > to:
> > self.value.export(outfile, level, name, namespace,
> > pretty_print=pretty_print)
> >
> > And the error seems to be solved.
> >
> > Did I find a bug here, or am I lost in the weeds?
> >
> > --
> > Lev Israel
> > Software Architect
> > SEFARIA <http://www.sefaria.org/>
> > +972-54-239-1852
> >
> > Twitter <https://twitter.com/sefariaproject>
> > Facebook <http://www.facebook.com/sefaria.org>
> >
>
>
>
> --
> Lev Israel
> Software Architect
> SEFARIA <http://www.sefaria.org/>
> +972-54-239-1852
>
> Twitter <https://twitter.com/sefariaproject>
> Facebook <http://www.facebook.com/sefaria.org>
--
Dave Kuhlman
http://www.davekuhlman.org
diff -r 0ebdcf6d7d5c generateDS.py
--- a/generateDS.py Wed Oct 05 15:05:23 2016 -0700
+++ b/generateDS.py Thu Oct 13 15:28:04 2016 -0700
@@ -5457,7 +5457,8 @@
elif self.category == MixedContainer.CategorySimple:
self.exportSimple(outfile, level, name)
else: # category == MixedContainer.CategoryComplex
- self.value.export(outfile, level, namespace, name, pretty_print)
+ self.value.export(
+ outfile, level, namespace, name, pretty_print=pretty_print)
def exportSimple(self, outfile, level, name):
if self.content_type == MixedContainer.TypeString:
outfile.write('<%s>%s</%s>' % (
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users