Kevin Dangoor <[EMAIL PROTECTED]> writes:
> FYI to those running from svn code: tomorrow morning, I'm going to
> switch over to the new widget API. (I'll attempt to put in a toggle to
> switch it back while you're transitioning code, but no guarantees).
I've just done that here and I'm having troubles with CalendarDatePicker (I
think). But I'm not being able to find what is wrong.
The problem is the one we solved a while ago by using lazy_gettext (the
tread_local...). Here's the new traceback:
================================================================================
Traceback (most recent call last):
File "./start-site_amostras.py", line 24, in ?
from site_amostras.controllers import Root
File "/home/godoy/.eclipse/LATAM/site_amostras/site_amostras/controllers.py",
line 14, in ?
from toxicologia import Toxicologia
File "/home/godoy/.eclipse/LATAM/site_amostras/site_amostras/toxicologia.py",
line 25, in ?
import analises
File "/home/godoy/.eclipse/LATAM/site_amostras/site_amostras/analises.py",
line 17, in ?
import fornecedores
File
"/home/godoy/.eclipse/LATAM/site_amostras/site_amostras/fornecedores.py", line
13, in ?
from formularios import formulario_fornecedores
File "/home/godoy/.eclipse/LATAM/site_amostras/site_amostras/formularios.py",
line 129, in ?
labeltext = lazy_gettext(
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/widgets/newbase.py",
line 44, in widgetinit
func(self, *args, **kw)
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/widgets/newforms.py",
line 512, in __init__
self.javascript=[JSLink(static, "calendar.js"),
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/i18n/tg_gettext.py",
line 100, in __str__
return str(self.eval())
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/i18n/tg_gettext.py",
line 94, in eval
return self.func(*self.args, **self.kw)
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/i18n/tg_gettext.py",
line 46, in gettext
return gettext_f(key, locale, domain)
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/i18n/tg_gettext.py",
line 55, in _gettext
if locale is None:locale = get_locale()
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/i18n/utils.py",
line 64, in get_locale
locale = get_locale_f()
File
"/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/i18n/utils.py",
line 77, in _get_locale
locale = cherrypy.session.get(locale_key)
File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/filters/sessionfilter.py",
line 413, in __getattr__
sess = cherrypy.request._session
File
"/usr/lib/python2.4/site-packages/CherryPy-2.2.0beta-py2.4.egg/cherrypy/__init__.py",
line 42, in __getattr__
childobject = getattr(serving, self.__attrname__)
AttributeError: 'thread._local' object has no attribute 'request'
================================================================================
Switching back to old widgets -- i.e. removing "widgets.use_new_widgets()" --
solves this.
I'm running SVN r662 here.
--
Jorge Godoy <[EMAIL PROTECTED]>