From: David G. <go...@us...> - 2002-10-24 00:43:01
|
Update of /cvsroot/docutils/docutils/docutils/writers In directory usw-pr-cvs1:/tmp/cvs-serv2898/docutils/docutils/writers Modified Files: __init__.py Log Message: Completed transform reform; removed ``transform()`` method; updated. Index: __init__.py =================================================================== RCS file: /cvsroot/docutils/docutils/docutils/writers/__init__.py,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- __init__.py 18 Oct 2002 04:55:20 -0000 1.10 +++ __init__.py 24 Oct 2002 00:42:58 -0000 1.11 @@ -29,6 +29,8 @@ Call `write()` to process a document. """ + component_type = 'writer' + document = None """The document to write.""" @@ -38,32 +40,17 @@ destination = None """`docutils.io` IO object; where to write the document.""" - transforms = () - """Ordered list of transform classes (each with an ``apply()`` method). - Populated by subclasses. `Writer.transform()` instantiates & runs them.""" - def __init__(self): """Initialize the Writer instance.""" - self.transforms = list(self.transforms) - """Instance copy of `Writer.transforms`; may be modified by client.""" - def write(self, document, destination): self.document = document self.language = languages.get_language( document.settings.language_code) self.destination = destination - self.transform() self.translate() output = self.destination.write(self.output) return output - - def transform(self): - """Run all of the transforms defined for this Writer.""" - for xclass in (universal.first_writer_transforms - + tuple(self.transforms) - + universal.last_writer_transforms): - xclass(self.document, self).apply() def translate(self): """ |