Re: [Structuredtext-develop] Re: wanting to use restructuredtext in a zope product
Status: Pre-Alpha
Brought to you by:
goodger
From: tav <ta...@es...> - 2002-04-12 09:16:19
|
>>>>> DG == "David Goodger" <go...@us...> wrote: DG> I think I'll keep the document parts separate to some DG> extent, within the Writer object, but leave the access DG> up to client subclasses. ah, nice plan. tav> i simply added a couple of returns in core.py and [snip] DG> I looked over them, and I think you can simplify life greatly DG> if you rethink your approach. Instead of inserting "return" DG> statements all over the place, take advantage of the DG> interface, which allows for three types of "destination": DG> (a) a file-like object, which is written directly; DG> (b) a path to a file, which is opened and then written; or DG> (c) `None`, which implies `sys.stdout`. DG> You can get a return value by passing a file-like object as DG> in (a). A StringIO object would do the trick. i appreciate the interface, and in fact using a tempfile or a stringio object was how i was going to approach it inittially. however, it seemed like pointless overhead, given my singular application. DG> I may rethink the interface so you don't need DG> StringIO, but not the way you've outlined: could you elaborate on how you see it working without a file-like object? and, re the way that i have done it. please pay no heed. it was a quick hack for my needs, and i wasn't suggesting that such a crude approach be taken in the codebase. tav> can restx not adapt such a practise? DG> No! Or at least, not by me! you seem pretty set on this point... can you at least accomodate for a decode() method in the XHTMLTransformer class? tav> the anchor tag is very problematic, as: tav> [snip : example] DG> All kinds of special-casing would have to be done, DG> and the result would be a quagmire of ambiguity. hmz. how could i go about disabling protocol recognition then? i.e. conversion of http://foo.com into a url. thanks btw. -- best regards, tav ta...@es... |