|
From: David G. <go...@us...> - 2002-10-12 00:42:09
|
Aahz wrote:
> I tried this recipe David gave to Michael Hudson::
>
> pub = core.Publisher()
> options = pub.set_options()
> pub.source = io.FileInput(options, source_path=sys.argv[1])
> pub.destination = io.StringOutput(options)
> pub.set_reader('standalone', None, 'restructuredtext')
> pub.writer = OOwriter.Writer
Is "OOwriter.Writer" a class or an object? "pub.writer" needs to be
an object.
> content = pub.publish()
>
> and got this traceback::
Sorry, I forgot that you need to set up the reader & writer *before*
calling pub.set_options(). The reader, parser, and writer
(collectively, the "components") specify the available options along
with their default values.
I'm considering renaming "options" (and all its uses) to "settings".
Once the command line is processed, they're not options any more.
When running Docutils programmatically, there are no true "options" to
be found.
> I'll probably find the answer before I get a response. ;-)
Unfortunately, I have to answer mail in batch mode, evenings (EST).
But I've found though experience that (reasonable) delays in
responding to requests often result in the originators figuring out
the solutions on their own.
--
David Goodger <go...@us...> 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/
|