[EMAIL PROTECTED] wrote:
> Simon Belak wrote:
> > Hi,
> >
> > TG is working under the assumption all decorators are "well behaved",
> > meaning they are either invariants or themselves decorated with
> > decorator() from turbogears/decorator.py.
> > For examples on how to use decorator() have a look at expose() or
> > validate() in turbogears/controllers.py. Since our decorator library is
> > based on work by Michele Simionato, his documentation [1] may prove
> > viable as well.
> >
> >
> > Cheers,
> > Simon
> >
> > [1] http://www.phyast.pitt.edu/~micheles/python/documentation.html
> >
> Thanks but I am still confused.
>
> I have changed my decorator to
>
> @decorator
> deco(func, self, *arg,**kw):
> return func(self, *arg, **kw)
>
> which seems to have the error handling dispatching things fixed.
> However, I encountered another error(not error handling related but
> again about decorator).
>
> html = func.__module__[:func.__module__.rfind('.')]+html
> AttributeError: 'NoneType' object has no attribute 'rfind'
>
> If I remove my deco, things is fine.
>
> Is there any documenation on how one should write the proper decorator
> for turbogears ?
found the problem. I think the decorator factory in decorator.py should
copy the __module__ attribute too. Should I submit a ticket for that ?