|
From: <gr...@us...> - 2002-05-31 06:01:09
|
On Wed, 29 May 2002, David Goodger wrote: > Sorry I've taken so long to reply; been busy. i am busy too, as you might have noticed by my sandbox. > As I replied last time, > > ``Node.walk`` & ``Node.walkabout`` call > ``NodeVisitor.unknown_visit`` & ``.unknown_departure`` when > unknown node types are encountered. > > You can implement the ``unknown_visit``/``unknown_departure`` methods > of your ``NodeVisitor`` subclass to do whatever you like (such as call > ``node.astext()``). If you choose to do this, I'd recommend issuing a > warning (a Python warning is OK, doesn't have to be a system_message) > saying "an unknown node (name) has been encountered", otherwise it > will be difficult to track down the remaining unimplemented node > types. > > This is only an interim solution though. It's OK during development, > but the writer won't be complete until *all* node types are handled in > some way. At that point, the unknown_visit/unknown_departure methods > should be removed, so that later bugs *will* be noticed. > A Python warning means what to you ? And this is not an interim solution, as a user i want a document output and this has to contain every text, so i would leave the unknown_visit/departure in the writer. it does no harm if everything is known, but it gives at least illformatted output if something is unknown. -- BINGO: Red Flag --- Engelbert Gruber -------+ SSG Fintl,Gruber,Lassnig / A6410 Telfs Untermarkt 9 / Tel. ++43-5262-64727 ----+ |