[Mailman-Developers] i18n imports
mats@laplaza.org
mats@laplaza.org
Tue, 20 Feb 2001 13:38:52 -0000
Ron Jarrell <jarrell@vt.edu> said:
> At 11:26 AM 2/17/01 +0100, you wrote:
> >On Fri, Feb 16, 2001 at 09:19:00PM -0500, Ron Jarrell wrote:
> >> At 11:00 PM 2/16/01 +0100, Thomas Wouters wrote:
> >> >A quick grep through a fresh tree gives me this handy (for Barry and for
> >> >those that run pre-alpha Mailmans on production machines :-) list:
> >
> >> Ok, I went in and put in the appropriate import in all those modules
except
> >> pipermail, which has it's own internal definition of _, and one other
> >> which was importing all of the i18n module anyway.
> >
> >Note that that isn't enough. 'from module import *' doesn't import names
> >starting with a _, and _ does start with a _. I can't find which module
> >you're talking about, though, so maybe you mean that it does 'from module
> >import spam, parrot, ham, creosote, voom, _, bucket', which would work.
>
> Errors.py just says "import Mailman.i18n" So that means it's not importing
> _? Can it use it explicitly? Because what it does is a
"rejection=Mailman.i18n._('text')"
Not a problem. The _ restriction only applies to
from module import *
since that form brings in everything from the module
into the /current/ namespace. Using
import module
there's no namespace pollution, so no need to restrict
what's brought in.
Mats