proposal to decouple colander from translationstring

72 views
Skip to first unread message

Alexey Luchko

unread,
Jun 27, 2012, 12:34:54 PM6/27/12
to pylons-devel
Hi!

I've found colander translates error messages of exceptions :) It is
cool and rather surprising, but is not always required.

I'd like to use colander, but translationstring adds one extra
dependency, that is useless for me. Please, could you remove colander
dependency on translationstring in future releases?

translationstring import could be rewritten like """
try:
import translationstring
except ImportError:
_ = lamba x: x
else:
_ = translationstring.TranslationStringFactory('colander')
""",
isn't it?

--
Regards,
Alex.

Chris McDonough

unread,
Jun 27, 2012, 12:39:42 PM6/27/12
to pylons...@googlegroups.com
On 06/27/2012 12:34 PM, Alexey Luchko wrote:
> Hi!
>
> I've found colander translates error messages of exceptions :) It is
> cool and rather surprising, but is not always required.
>
> I'd like to use colander, but translationstring adds one extra
> dependency, that is useless for me. Please, could you remove colander
> dependency on translationstring in future releases?

No, sorry. I'd just rather not think about the implications of doing
this for the non-universal benefit of one less dependency.

- C

Alexey Luchko

unread,
Jun 27, 2012, 2:01:02 PM6/27/12
to pylons...@googlegroups.com
On 27.06.2012 19:39, Chris McDonough wrote:
> On 06/27/2012 12:34 PM, Alexey Luchko wrote:
>> I've found colander translates error messages of exceptions :) It is
>> cool and rather surprising, but is not always required.
>>
>> I'd like to use colander, but translationstring adds one extra
>> dependency, that is useless for me. Please, could you remove colander
>> dependency on translationstring in future releases?
>
> No, sorry. I'd just rather not think about the implications of doing this
> for the non-universal benefit of one less dependency.

Sorry, I haven't meant to remove use of translationstring from the
colander. Just adding conditional import instead of strict requirement. A
change like the following one does not seem intrusive.


>> translationstring import could be rewritten like """
>> try:
>> import translationstring
>> except ImportError:
>> _ = lamba x: x
>> else:
>> _ = translationstring.TranslationStringFactory('colander')
>> """,
>> isn't it?


Colander is good enough to be used alone, without plone. However, it has
non-universal dependency on translationstring.


--
Regards,
Alex

Daniel Holth

unread,
Jun 27, 2012, 2:04:40 PM6/27/12
to pylons...@googlegroups.com
translationstring installs these files, and it has no dependencies on
Plone or any other package outside the standand library.

cat translationstring-1.1-py2.7.egg-info/installed-files.txt
../translationstring/__init__.py
../translationstring/compat.py
../translationstring/tests/__init__.py
../translationstring/tests/test__init__.py
../translationstring/tests/test_integration.py
../translationstring/tests/translations.py
../translationstring/tests/fixtures/locales/de/LC_MESSAGES/messages.mo
../translationstring/tests/fixtures/locales/de/LC_MESSAGES/messages.po
../translationstring/__init__.pyc
../translationstring/compat.pyc
../translationstring/tests/__init__.pyc
../translationstring/tests/test__init__.pyc
../translationstring/tests/test_integration.pyc
../translationstring/tests/translations.pyc
./
SOURCES.txt
dependency_links.txt
PKG-INFO
top_level.txt
not-zip-safe

Alexey Luchko

unread,
Jun 27, 2012, 2:15:27 PM6/27/12
to pylons...@googlegroups.com
On 27.06.2012 21:01, Alexey Luchko wrote:
>>> translationstring import could be rewritten like """
>>> try:
>>> import translationstring
>>> except ImportError:
>>> _ = lamba x: x
>>> else:
>>> _ = translationstring.TranslationStringFactory('colander')
>>> """,
>>> isn't it?

Sorry, (lambda x: x) won't work. It could be (lambda *a, **k: (a, k)) but
it is not good.

--
Alex

Chris McDonough

unread,
Jun 27, 2012, 3:21:39 PM6/27/12
to pylons...@googlegroups.com
I understood the question and the answer is still "sorry, no".

- C
Reply all
Reply to author
Forward
0 new messages