On Sat, Jul 13, 2013 at 9:16 PM, Alessandro Molina < [email protected]> wrote:
> On Fri, Jul 12, 2013 at 3:19 PM, Moritz Schlarb <[email protected]>wrote: > >> Since I struggled with that lately, too, I appreciate all kind of >> improvement, although I now know my way around :D >> >> My 2 cents atm: >> >> Why is it strictly required for @expose to know about the renderers? >> Couldn't that be done more lazy when they are first used? >> >> > Up to now I have actually two branches on my local repo that try to do > that, but both of them don't satisfy me due to various reasons. > I'll give a third try, I have an idea for a more flexible solution and > that should not slow down too much things, but it won't go in 2.3 stable as > it is too big change between a beta and a stable. > > I'm quite satisfied with how the third try at solving the issue is coming out. Maybe this is the right one. The current solution provides support for "configuration milestones". When a feature of TG depend on the availability of parts of the configuration it can register for milestones. Whenever a milestone is reached all the registered entities are notified and can proceed with their configuration. If the entity registers for a milestone that is already passed it's immediately notified and proceeds like before in synchronous manner. Suppose you need to perform something that depends on the available template engines (like tgext.admin that changes template depending on the default renderer), you simply register for renderers_ready milestone and whenever is reached you are notified an can perform your own setup. Normally due to the way TG applications and pluggables are setup, every milestone is already passed before any controller is imported, so nothing changes practically since before. On the other side custom extensions and minimal mode applications can import controllers at any time which would lead to issues before milestones were available. I'm going to push this on config_milestones as soon as I get back to 100% coverage, any feedback will be appreciated! -- You received this message because you are subscribed to the Google Groups "TurboGears Trunk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/turbogears-trunk. For more options, visit https://groups.google.com/groups/opt_out.
