Ups, forgot to commit decorator.py. Fixed in r1260. Sorry for the
inconvenience.
Cheers,
Simon
Jorge Godoy wrote:
> Em Quarta 26 Abril 2006 18:40, Simon Belak escreveu:
>> Hi,
>>
>> I would just like to highlight some (breaking) changes I made in r1257.
>> For now all are intended for First Class, if we decide anything should
>> be released beforehand I will merge than (I hope this covers me from
>> Michelle's wrath ;)).
>>
>> 1) Fail-safe mechanism is uncoupled from error handling and validate()
>> decorator. Some examples can be had in test_errorhandling.py (should
>> probably refactor as well), I will update the "docs" soon (on sprint at
>> the latest).
>>
>> 2) tg_exceptions is renamed to tg_exception and is in fact no longer an
>> exception as such, but a tuple compatible with what sys.exc_info() returns.
>> (it should be possible to do some pretty sick things with stack
>> manipulation now ...)
>
> Hi Simon.
>
>
> I believe that your changes breaks the expose decorator:
>
> ===============================================================================
> File
> "/home/godoy/empresa/clientes/latam/Site-Amostras/siteamostras/controllers/analises.py",
>
> line 213, in Analises
> @turbogears.expose()
> File
> "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/util.py",
> line 200, in entagle
> signature=(argnames, varargs, kwargs, defaults))(func)
> TypeError: decorator() got an unexpected keyword argument 'signature'
> ===============================================================================
>
> Here's the offending function (with its 'svn blame' output):
>
> ===============================================================================
> 760 simon def bind_args(**add):
> 807 max """Call with arguments set to a predefined value."""
> 807 max def entagle(func):
> 1257 simon argnames, varargs, kwargs, defaults =
> getargspec(func)
> 1257 simon defaults = list(ensure_sequence(defaults))
> 1257 simon defaults = [d for d in defaults if
> 1257 simon argnames[-len(defaults) +
> defaults.index(d)] not in add]
> 1257 simon argnames = [arg for arg in argnames if arg not in
> add]
> 1257 simon
> 807 max def bind_args(func, *args, **kw):
> 1257 simon return inject_call(func, add, *args, **kw)
> 1257 simon return decorator(bind_args,
> 1257 simon signature=(argnames, varargs,
> kwargs, defaults))(func)
> 760 simon return entagle
> 760 simon
> ===============================================================================
>
> And here's the signature of this function:
>
> ===============================================================================
> @turbogears.expose(html="siteamostras.templates.form_generico")
> @identity.require(identity.conditions.in_group("latam_ver"))
> def analises(self, **kword):
> ===============================================================================
>
>
> Also, now I have:
>
> ===============================================================================
> Ran 170 tests in 25.538s
>
> FAILED (failures=6, errors=66)
> ===============================================================================
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---