[Zope] Publish.py / publish hack

Pierre-Julien Grizel grizel@mouli.net
Mon, 30 Oct 2000 17:24:44 +0100


Hi,


I'm using Zope 2.2.2 and for some personal reasons I need to patch the
publish function from Publish.py.
I used the usual __init__.py straegy to patch ZPublisher :


from MyModule import Mypublish
import ZPublisher.Publish
from ImageFile import ImageFile

# Patch the original publish function
ZPublisher.Publish.publish = Mypublish


But the fact is, publish is called several times at several places in
the source code, and especially from the publish_module function when an
exception is raised...
And, although my patch works most of the times, it doesn't work when an
exception is raised.

I may need to replace another 'publish' reference somewhere, but does
anyone know WHERE exactly ??


Many thanks,



P.-J.



-- 
If the only tool you have is a hammer, 
    you tend to see every problem as a nail.
Si le seul outil dont vous disposez est un marteau, 
    vous avez tendance à voir chaque problème comme un clou. 
                                       --Abraham Maslow