I've just checked in code for ViewList and StringList classes to docutils/statemachine.py. StringList objects are now used inside the state machine (the guts of the parser) instead of standard Python lists. The change should be internal-only, with no outside effects, but outside code should be tested. Please let me know if there are any problems. Here's the ViewList class docstring: List with extended functionality: slices of ViewList objects are child lists, linked to their parents. Changes made to a child list also affect the parent list. A child list is effectively a "view" (in the SQL sense) of the parent list. Changes to parent lists, however, do *not* affect active child lists. If a parent list is changed, any active child lists should be recreated. The start and end of the slice can be trimmed using the `trim_start()` and `trim_end()` methods, without affecting the parent list. The link between child and parent lists can be broken by calling `disconnect()` on the child list. Also, ViewList objects keep track of the source & offset of each item. This information is accessible via the `source()`, `offset()`, and `info()` methods. BTW, this solves the "include" directive problems brought up by Brett Porter last week. (A long way to go to fix a small problem! But it should pay off in the long term.) -- David Goodger <goodger@python.org> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ ------------------------------------------------------- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en _______________________________________________ Docutils-develop mailing list Docutils-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/docutils-develop
participants (1)
-
David Goodger