durusmail: qp: Subclassing Site thoughts.
Subclassing Site thoughts.
2006-06-27
2006-06-27
2006-06-27
2006-06-27
2006-06-27
2006-06-27
2006-06-28
2006-06-28
2006-06-27
2006-06-27
2006-06-28
Subclassing Site thoughts.
David Binger
2006-06-27
On Jun 27, 2006, at 10:33 AM, Peter Wilkinson wrote:

> The issue with doing this is that start_web and start_durus aren't
> fine grained enough to do the subclassing cleanly. Making a
> Site.run_web and Site.run_durus that replaced the code between the
> try: finally: section of both of those methods would be ideal. Any
> possibility of getting something like that?

In Site.start_web(), we now have this in the unreleased code:

             try:
                 self.get_publisher_class().run_web(self)
             finally:
                ...

Your publisher can implement the customized part.

---

It would be possible to do the same in Site.start_durus().
I'll think about it more.

I'm not all that hot on customized run_web() or start_durus() because
it makes the core qp code a little bit more complicated and opens
the door for customizations that won't work.  I feel like it
sets a bit of a trap for future users.  I know, though, that
you're not the only one with these ambitions, so maybe it is
better for me to adjust to that.



reply