3
Apply patch for Python 2.5 compatibility from both
6
Create distro tarball via:
9
USE_MELD3_EXTENSION_MODULES=1 python setup.py sdist
11
.. in order to get the cmeld3.c file in the distribution.
14
Make the default build use the Python-based meld "helper" instead of
15
the C-based one. Since the primary consumer of meld3 (as far as I
16
know) is "supervisor", and since the typical supervisor consumer is
17
likely not to have a C compiler and Python development libraries on
18
his system, it makes more sense for the default build not to compile
19
the C extensions. However, if the environment variable
20
"USE_MELD3_EXTENSION_MODULES" is set when "setup.py install" is
21
invoked, the C extensions will be built. meld3 is much slower
22
without the C extensions, so using "USE_MELD3_EXTENSION_MODULES" is
23
usually a good idea for performance-sensitive systems.
25
As a result of this change, the "NO_MELD3_EXTENSION_MODULES"
26
environment variable introduced in 0.6.1 now has no effect.
30
Fixed two more memory leaks (one in bfclonehandler, the other in
31
findmeldhandler) in the c helper module.
35
Fixed a number of memory leaks in the C implementation of the helper
36
module. Any use of "findmeld", "clone", "getiterator", or "content"
37
previously leaked references.
41
Allow people to install meld3 without building extension modules.
42
If the environment variable "NO_MELD3_EXTENSION_MODULES" is set, the
43
meld3 setup.py file will not build any extension modules. meld3
44
will still work, only more slowly than if the extension modules
49
Fixed crashbug when repeating trees with "structure" nodes in them.
50
Symptom: bus error. Thanks to Terrence Brannon for the report.
54
Add 'fillmeldhtmlform' method to nodes.
56
Fix obscure parsing bug that arose when attempting to change the
57
URI used as a "meld id" (do not lowercase).
59
Added three methods to element nodes:
65
These methods have the same respective argument lists as their
66
"write_foo" cousins, except they don't accept a "file" argument.
67
Instead of writing to a file, they return a string containing the
68
renderering of the element.
70
You can now use the meld3.py module to interactively try out
71
different renderings. To do this, invoke meld3.py with a filename
72
and a dotted-python-path name to a mutator function that accepts a
73
single argument (the root element), e.g.:
75
python meld3.py sample.html meld3.sample_mutator
77
The rendering will be sent to stdout
79
Remove unused parse method.
81
Add __setslice__, __delslice__, remove methods that correctly update
84
Don't call into superclass to do append, insert, __setitem__, etc.
88
- Avoid function call overhead in various places by inlining code.
90
- _write_html/_write_xml now accept a callable "write" argument
91
instead of a file argument (avoid file.write call overhead).
93
- HTML serializer only calls _escape_cdata/_escape_attrib if necessary
94
instead of calling it without regard to its need.
96
- Use string.encode(encoding) instead of calling an _encode function.
98
- Perform special-case rendering for English-centric encodings
101
- Ignore things that might be "QNames" during rendering.
103
- "getiterator", "content", "clone", and "findmeld" now
104
implemented in a C module. Experimental. Disable via changing
105
"import cmeld3 as helper" in meld3.py to something like "import
108
Fix text and attribute serialization to only quote ampersands that
109
aren't already part of entities.
111
Do the minimal possible thing to escape text and attribute values during
112
rendering. For text, this is escaping ampersands that aren't parts of
113
entities and the less-than (<) character. For attribute values, this is
114
amps and less-than as well as the quote (") character. This was done
115
partly because I think the spec allows it but it's also what Kid does,
118
Change 'diffmeld()' to return a dictionary of dictionaries. The
119
dictionary returned by diffmeld has the keys 'reduced' and
120
'unreduced'. the values of both 'reduced' and 'unreduced' is
121
another dictionary. The leafmost dictionary has the keys 'added',
122
'removed', and 'moved. In the 'unreduced' dictionary, *all* meld
123
tags that have been added, removed, or moved are present (this was
124
the behavior of diffmeld previously). In the 'reduced' dictionary,
125
the added, removed, and moved values are reduced to the smallest
126
number of tags which share a common lineage.
128
Add a meldprofile.py script.
132
The clone() method of elements copied neither the text nor the tail
133
of the element (this is what caused markup created by "repeats" to
134
fall all on one line).
136
Add diffing capability to meld nodes. The file 'melddiff.py' shows an
137
example of using the diff API.
139
Add a 'meldid()' method to elements. This returns None if the element
140
has no meld id, otherwise it returns the id.
142
Add a 'fillmeld(**kw)' method to elements. This does the same thing
143
as '__mod__' but returns meld ids (the keys of **kw) that cannot be
144
found anywhere in the tree.
146
Make source distro into a distutils-installable package.
150
Fix broken example.py file.
152
Add ZPT-alike methods on elements: 'content', 'replace', and
153
'attributes'. 'content' replaces the node's content; 'replace'
154
replaces the node itself with a text value, and 'attributes' sets
155
the attributes of the node. Using the ElementTree API to do the
156
same things usually causes the code to run faster, but these
157
functions are more convenient and more easily grokked by ZPT people.
159
Override __delitem__ on meld elements in order to relieve deleted
160
items of their parent pointers.
162
Strip all xhtml namespace identifiers out of XHTML output. Browsers
163
just can't deal with this.
165
Undocumented element API method 'remove' renamed to 'deparent' (it
166
was shadowing an ElementTree API method).
168
Documentation improvements and change examples to use ZPT-alike
171
Add support for HTML input files. Input files don't need to be
172
strictly well-formed XML anymore.
174
Remove the 'parse' top-level function in favor of explicit separate
175
xml parsing and html parsing functions.
177
Add 'parse_xml' and 'parse_html' top-level parsing functions.
179
Add 'parse_xmlstring' and 'parse_htmlstring' module-scope functions
180
which calls their respective 'parse_xxx' function with a StringIO
181
containing the passed text.
186
Use a method on elements to do writing rather than requiring a user
187
call a "write" function. The equivalent is now a method of the
188
element named "write_xml". element.write_xml(file) performs a write
189
of XML into the file. element.write_xml(...) includes an XML
190
declaration in its serialization (but no doctype, at least by
193
Various non-XML serialization methods have been added. The default
194
arguments of these serialization methods are what I'm guessing are
195
the most common cases desired for various kinds of qoutput::
197
element.write_html(...). This serializes the node and its
198
children to HTML. This feature was inspired by and based on code
199
Ian Bicking. By default, the serialization will include a
200
'loose' HTML DTD doctype (this can be overridden with the
201
doctype= argument). "Empty" shortcut elements such as "<div/>"
202
will be converted to a balanced pair of tags e.g. "<div></div>".
203
But some HTML tags (defined as per the HTML 4 spec as area, base,
204
basefont, br, col, frame, hr, img, input, isindex, link, meta,
205
param) will not be followed with a balanced ending tag; only the
206
beginning tag will be output. Additionally, "boolean" tag
207
attributes will not be followed with any value. The "boolean"
208
tags are selected, checked, compact, declare, defer, disabled,
209
ismap, multiple, nohref, noresize, noshade, and nowrap. So the
210
XML input "<input type="checkbox" checked="checked"/>" will be
211
turned into "<input type="checkbox" checked>". Additionally,
212
'script' and 'style' tags will not have their contents escaped
213
(e.g. so "&" will not be turned into & when it's iside the
214
textual content of a script or style tag.)
216
element.write_xhtml(...). This serializes the node and its
217
children to XHTML. By default, the serialization will include a
218
'loose' XHTML doctype (this can be overridden with the doctype=
219
argument). No XML declaration is included in the serialization by
220
default. If you want to serialize an XML declaration, pass
223
All serialization methods have a number of optional
226
fragment: If this is true, serialize an element as a "fragment".
227
When an element is serialized as a fragment, it will not include
228
either a declaration nor a doctype (the declaration= and doctype=
229
arguments will be ignored).
231
doctype: Output a custom doctype during the writing of XML and
232
HTML (see write, write_xml, write_xhtml, and write_html). Use
233
the constants in meld3.doctype (xhtml, xhtml_strict, html, and
234
html_strict) to avoid passing a literal 3-tuple of (name, pubid,
235
system) as the doctype parameter. If fragment=True is specified
236
for serialization, this argument has no effect.
238
encoding: Specify a character encoding to be used during writing
239
(see write, write_xml write_html, and write_xhtml). The encoding
240
must be a valid Python codec name (e.g. 'utf-8'). If this is
241
provided for write_xml and write_xhtml, and the XML declaration
242
is serialized, the declaration will include the encoding. If an
243
encoding is passed to write_html, no explicit encoding is
244
included in the declaration but the serialization will be done
247
XML serializations (write_xml and write_xhtml) have the
248
aforementioned arguments but expose two additional optional
251
declaration: If this is true, an xml declaration header is output
252
during the writing of XML (see write, write_xml, and
253
write_xhtml). If the encoding is specified, and the
254
serialization is meant to include an XML declaration (via
255
declaration=), the declaration will include the encoding. If
256
'fragment=True' is specified for serialization, this argument has
257
no effect. It doesn't matter if your input document had a
258
declaration header; this option must be used to control
261
pipeline: If this is true, allow meld identifiers to be preserved
262
during the writing of XML and XHTML (see write, write_xml and
263
write_xhtml). meld identifiers cannot be preserved on HTML
264
serializations because HTML doesn't understand namespaces.
266
HTML entities can now be parsed properly (magically) when a DOCTYPE
267
is not supplied in the source of the XML passed to 'parse'. If your
268
source document does not contain a DOCTYPE declaration, the DOCTYPE
269
is set to 'loose' XHTML 'by magic'. If your source document does
270
contain a DOCTYPE declaration, the existing DOCTYPE is used (and
271
HTML entities thus may or may not work as a result, depending on the
272
DOCTYPE). To prevent this behavior, pass a false value to the
273
xhtml= parameter of the 'parse' function. This in no way effects
274
output, which is independent of parsing. This does not imply that
275
any *non*-HTML entity can be parsed in the input stream under any
276
circumstance without having it defined it in your source document.
278
Comments are now preserved in output. They are also present in the
279
ElementTree node tree (as Comment elements), so beware. Processing
280
instructions (e.g. <?xml version="1.0">) are completely thrown away
281
at parse time and do not exist anywhere in the element tree.
283
Avoid use of deepcopy in the clone() method of elements (much
284
speedier to explicitly recurse).
286
The "meld helper" namespace (e.g. element.meld) is no longer present
287
or supported. Instead of using element.meld['foo'] to find an
288
element with the meld:id "foo", use element.findmeld('foo'). This
289
returns None if the node cannot be found. Instead of using
290
element.meld.get('foo', 'somedefault'), use element.findmeld('foo',
291
'somedefault'). Instead of using element.meld.repeat(...), use
294
Elements now support a __mod__ which can accept a dictionarylike
295
operand and which causes the text of elements with meld ids which
296
match the keys in the dictionary to be set to the key's value in the
297
dictionary. For example, if an element contains subelements with
298
the meld ids "foo" and "bar", you can replace those nodes' text
299
values with the following::
301
element % {'foo':'foo text', 'bar':'bar text'}
303
__mod__ will not accept a non-dictionary-like object (such as a list
304
or tuple). __mod__ will never raise an error unless you pass it a
305
non-dictionary-like object; if it can't find a node corresponding to
306
a key in the dictionary, it moves on to the next key. Only the text
307
values of the nodes which are found during this process are
310
Using duplicate meld identifiers on separate elements in the document
311
now causes a ValueError to be raised at parse time.