On Jun 7, 6:04 pm, Christopher Arndt <[EMAIL PROTECTED]> wrote:
> aspineux schrieb:
>
> > class EmailNameValidator(Regex):
> >     regex = r"^[a-zA-Z_\-0-9]*$"
> >     messages = {
> >         'invalid': _('Enter only letters, numbers, or _
> > (underscore)'),
> >         }
> > OPS: If I remove the _() operator, then its works !
> > Any idea ?
>
> Which one, the outer one or the inner one?

The outer one of course.

>
> > TypeError: Error when calling the metaclass bases
> >     expected string or buffer
>
> This the error that used to occur with previous non-gettext versions of
> FormEncode, when you tried to make a validation error message
> translatable. But you seem to be using version 0.7.1, which should
> support translatable messages.

I have a old TG 1.0.1 with Formencode 0.6, and I get the same error
message :

Traceback (most recent call last):
  File "./start-emailgency.py", line 50, in ?
    from emailgency.controllers import Root
  File "/s0/asx/src/emailgency/trunk/emailgency/controllers.py", line
9, in ?
    import main_ctrl, password_ctrl
  File "/s0/asx/src/emailgency/trunk/emailgency/main_ctrl.py", line
15, in ?
    from common_ctrl import *
  File "/s0/asx/src/emailgency/trunk/emailgency/common_ctrl.py", line
129, in ?
    class EmailNameValidator(Regex):
  File "/usr/lib/python2.4/site-packages/FormEncode-0.6-py2.4.egg/
formencode/declarative.py", line 84, in __new__
    cls.__classinit__(cls, new_attrs)
  File "/usr/lib/python2.4/site-packages/FormEncode-0.6-py2.4.egg/
formencode/api.py", line 128, in __classinit__
    cls._initialize_docstring()
  File "/usr/lib/python2.4/site-packages/FormEncode-0.6-py2.4.egg/
formencode/api.py", line 201, in _initialize_docstring
    default = re.sub(r'(%\(.*?\)[rsifcx])', r'``\1``', default)
  File "/usr/lib/python2.4/sre.py", line 142, in sub
    return _compile(pattern, 0).sub(repl, string, count)
TypeError: Error when calling the metaclass bases
    expected string or buffer


>
> Chris


--~--~---------~--~----~------------~-------~--~----~
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