-- Dave Kuhlman http://www.davekuhlman.org
--- Begin Message ---Juha,Thank you for your report. Your fix looks like a good one. But, let me to a little testing before I commit it to the source code repository. Dave On Fri, Feb 02, 2018 at 04:02:30PM +0200, Juha Tuomala wrote: > > Long lines, see without wordwrap: > > python2.7 ./generateds.hg/build/scripts-2.7//generateDS.py -o einvoice12.py > xsd/1.2/eng/e-invoice_ver1.2.xsd > *** warning. Removing child with duplicate name: "PaymentDescription" > Traceback (most recent call last): > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 7426, in > <module> > main() > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 7414, in main > superModule=superModule) > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 6902, in > parseAndGenerate > prefix, root, options, args, superModule) > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 6712, in > generate > generateFromTree(wrt, prefix, elements, processed) > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 6627, in > generateFromTree > generateClasses(wrt, prefix, element, 0, nameSpacesDef) > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 4987, in > generateClasses > generateValidatorDefs(wrt, element) > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 4712, in > generateValidatorDefs > typeName, stObj.getBase(), element, child) > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 4588, in > getValidatorBody > patterns1) > File "./generateds.hg/build/scripts-2.7//generateDS.py", line 4353, in > processValidatorBodyRestrictions > pats2 = ['^{}$'.format(replaceVbars(p1)) for p1 in pats1] > UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-7: > ordinal not in range(128) > > > https://stackoverflow.com/questions/3235386/python-using-format-on-a-unicode-escaped-string > > > I add 'u' into > > pats2 = ['^{}$'.format(replaceVbars(p1)) for p1 in pats1] > > changed > > pats2 = [u'^{}$'.format(replaceVbars(p1)) for p1 in pats1] > > > making first sting into unicode and it works: > > python2.7 ./generateds.hg/build/scripts-2.7//generateDS.py -o einvoice12.py > xsd/1.2/eng/e-invoice_ver1.2.xsd > *** warning. Removing child with duplicate name: "PaymentDescription" > [tuju@wasa]/net/alca/srv/sys/lib/python2.6/estonia/centralbank% > > > Maybe you could fix this into source repository? I will migrate into python3 > at some > point but whole surrounding system is in 2.7, so it will take time. > > Btw, i first tried pyXB and it made very weird class names, could not use it. > Once I found how to append to generateDS class variables, it works great. > I really like it, thank you very much for coding and sharing it. > > BR, > > Tuju > > > -- > [email protected] | http://tuju.ee | sip:[email protected] | +3726311345 | +3725025337 > Better to have one, and not need it, than to need one and not have it. > > -- Dave Kuhlman http://www.davekuhlman.org
--- End Message ---
------------------------------------------------------------------------------ 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 [email protected] https://lists.sourceforge.net/lists/listinfo/generateds-users
