On Mon, Aug 30, 2010 at 9:52 PM, Ralph Versteegen <[email protected]> wrote: > I tried it out, discovered it was broken, and eventually discovered > that this was due (only) to errors in the RELOAD documentation. Nice > work! Patch attached.
Thanks! Pushed to git master + fixed the doctests that had broken due to the stringtable changes. (also I had added a reload_from_dict function since then. That's available now too FWIW) > It now correctly reads and writes all RELOAD > documents that I threw at it, including the unittest.rld that > reloadtest produces. Also, I reimplemented reload2xml in a couple > lines (MUCH nicer than the 'real' thing :) ), lxml2 is pretty nice :) I had it's model in mind vaguely when implementing my system. > to check that it really > was reading things correctly, and not just that writing was undoing > some kind of error in the read code. > > And the string table optimisation really works, it trimmed 1kB off a 15kB > file! Great - I figured the canonical code didn't do that, and I thought it would be worthwhile for repetitious documents :) > > I noticed that when testing nodes/trees for equality, you don't > actually look at their values. kinda slow, and creates more temporary data (get the names, sort them, copy the list of children, sort according to name order) Anyway, implementation is in my local git checkout; not tested/pushed yet. (probably do that tomorrow.. my clock says 12.04) This means it's no longer assumed that children are in the same order (eg. sorted). This will probably avoid considerably weird breakage in some circumstances. > I suggest comparing the textual > representation of data, so that None == "", and maybe an option for > exact comparison like reloadutil's --pedantic option. Not quite how I > would have designed things, but that's how things worked out: the > official implementation's interface doesn't distinguish between null > and zero-length string nodes. That seems slightly evil. I'll have to consider it. (for the purposes of conditionals in python, '' is equivalent to None; that is, 'not 0', 'not None' "not '' " all evaluate to True (meaning that if you remove the Not, they all evaluate to False.). That may or may not help, though.) > > BTW, why don't the FB packages for your system work? What system is it? Arch Linux. It can't find its include files (crt.bi, for example). It seems to have part of itself installed in /usr and the other part in /usr/local (it claims to be compiled with prefix=/usr/local; the includes are in there IIRC but it doesn't find them) _______________________________________________ Ohrrpgce mailing list [email protected] http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
