Hello.
I've quite standard Pylons project that I'm working on for last few
months. Recently I've cleaned up the code and created
project.lib.helperslib subdir where I have created multiple python
modules with corresponding functions e.g. date.py, buttons.py, links.py,
etc. When functions were under project.lib.helpers everything worked
fine. However when I moved those functions to different modules under
helperslib subdir I cannot use pylons variables anymore. For example.
When I'm importing config like this:
from pylons import config
or trying to get _() function like this:
from pylons.i18n import _
I'm getting errors like:
File
"/usr/lib/python2.5/site-packages/Pylons-0.9.7rc4-py2.5.egg/pylons/i18n/translation.py",
line 106, in ugettext
return
pylons.translator.ugettext(value)
File
"/usr/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/registry.py",
line 137, in __getattr__
return getattr(self._current_obj(),
attr)
File
"/usr/lib/python2.5/site-packages/Paste-1.7.2-py2.5.egg/paste/registry.py",
line 194, in _current_obj
'thread' %
self.____name__)
TypeError: No object (name: translator) has been registered for this
thread
Also. When I'm trying to use config.get('value') I'm getting null
values. It worked fine with Pylons 0.9.6.1, but after updating to Pylons
0.9.7rc-4 it's not working anymore. Unfortunatelly I can't revert back
to older version of Pylons, so I'm stuck. I thought maybe importing
load_environment would do the trick, but unfortunatelly no.
When I'm importing it like this:
from project.config.environment import load_environment
I'm getting this error:
File
"/home/wolverine/development/project/project/lib/helperslib/date.py",
line 6, in <module>
from project.config.environment import load_environment
ImportError: cannot import name load_environment
Honestly. I'm stuck. I was looking for the answer on google and google
groups, but I'm out of luck.
Could someone shed some light on this issue?
I would greatly appreciate your help.
Best regards,
Karol Tomala
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---