[pypy-dev] Re: Problem with current ReST snapshot

holger krekel hpk at trillke.net
Fri Sep 30 11:06:44 CEST 2005


Hi Christian!

On Fri, Sep 30, 2005 at 04:48 +0200, Christian Tismer wrote:
> while struggling with templates and OOo, I encountered a problem
> when I tried toswitch to the recent docutils snapshot.

If i may ask: did you go for a docutils snapshot instead
of the stable releases 0.3.7/8/9 for a particular reason? 

> There seems to be some problem with mutually exclusive parameters.
> 
> I tried to track this down by reading the py library, but I have
> to admit that I could not find the source of the problem in
> reasonable time, because the related py modules have small
> or no documentation how they gather their configuration and
> how they process the input.
>
>     def get_stylesheet_reference(settings, relative_to=None):
>         """
>         Retrieve a stylesheet reference from the settings object.
>         """
>         if settings.stylesheet_path:
>             assert not settings.stylesheet, \
> E                  'stylesheet and stylesheet_path are mutually exclusive.'
> >                  AssertionError: stylesheet and stylesheet_path are 
> mutually e
> xclusive.
> 
> [D:\Python23\Lib\site-packages\docutils\utils.py:433]

Well, is it really the py library that is hard to debug here? 
IMHO it is docutils which is sometimes hard to track
regarding it's configuration limitations/restrictions. 
The 67 lines of py/misc/rest.py support are there to
prevent everybody from having to think about this, btw. 

In fact, it seems that docutils changed the defaults
in the snapshot and sets 'stylesheet_path' now itself, 
making the previously valid passing of a 'stylesheet' 
parameter suddenly invalid. 

I just tweaked the invocation in py/misc/rest.py to explicitely
pass 'stylesheet_path' as None to docutils.  This should fix
your problem.  

cheers, 

    holger



More information about the Pypy-dev mailing list