Kirk Strauser schrieb:
> I want to make my own decorate that takes an argument and works well with the 
> standard TurboGears decorators, like
> 
>     @mydec('foo')
>     @expose(template='myproject.templates.page')
>     def index(self):
>         [....]
> 
> Now, I've written more decorators than I care to remember, and this time I'd 
> like to do it the "TG way" if there is one.  I looked at the tg.decorate 
> module but the documentation seems to be written for people who already know 
> now to use it.
> 
> First, is this worth pursuing, or should I just write this the same way I've 
> done umpteen times before?  If so, could someone point me to examples?  Bonus 
> points for the Google query you used to find this so I don't have to pester 
> next time.  :-)

If you can, use the decorator module. There is documentation for it 
available.

However, you can't always do that - when you e.g. expect the wrapper to 
take more arguments than the wrappee - that won't work with 
decorator-module.

Apart from that, I don't think that there is much more to care about.

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to