Em Sexta 28 Abril 2006 12:04, Simon Belak escreveu:
> Forgot to mention, decorator() and weak_signature_decorator() expect a
> closure. In your case
>
> def mensagem_json():
>       def entangle(func):
>           def caller(func, *args, **kwords):
>               print "#################"
>           return caller
>       return weak_signature_decorator(entangle)
>
> ....
>
> @mensagem_json()
> def ...
>
> should do the trick.

It didn't.

> As of 1285 two new decorator factories are available:
>
>    simple_decorator()
>    simple_simple_weak_signature_decorator()
>
> which work as before (apply to caller, no Py2.3 compatibility).

They still give me errors.  Second is with simple_weak_signature_decorator.


[EMAIL PROTECTED] ~/empresa/clientes/latam/Site-Amostras % 
./start-siteamostras.py
Traceback (most recent call last):
  File "./start-siteamostras.py", line 26, in ?
    from siteamostras.controllers import Root
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/__init__.py",
 
line 18, in ?
    from siteamostras.controllers.toxicologia import Toxicologia
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/toxicologia.py",
 
line 24, in ?
    from siteamostras.controllers import analises
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/analises.py",
 
line 24, in ?
    from siteamostras.decorador import mensagem_json
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/decorador.py", 
line 18, in ?
    @decorator()
TypeError: simple_decorator() takes at least 1 argument (0 given)
[EMAIL PROTECTED] ~/empresa/clientes/latam/Site-Amostras % 
./start-siteamostras.py
Traceback (most recent call last):
  File "./start-siteamostras.py", line 26, in ?
    from siteamostras.controllers import Root
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/__init__.py",
 
line 18, in ?
    from siteamostras.controllers.toxicologia import Toxicologia
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/toxicologia.py",
 
line 24, in ?
    from siteamostras.controllers import analises
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/analises.py",
 
line 29, in ?
    class Analises(controllers.Controller):
  File 
"/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/analises.py",
 
line 213, in Analises
    @turbogears.expose()
TypeError: entangle() takes exactly 1 argument (0 given)
[EMAIL PROTECTED] ~/empresa/clientes/latam/Site-Amostras % 

> I would however very much appreciate if you could also try to make the
> new weak_signature_decorator() work with your code, just to make sure
> before I apply these changes to a5. Thanks!

I'm trying that for hours :-)

May I send you my decorator off list so that you take a look and see what I'm 
doing wrong? :-)

-- 
Jorge Godoy      <[EMAIL PROTECTED]>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears Trunk" 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-trunk
-~----------~----~----~----~------~----~------~--~---

Reply via email to