durusmail: quixote-users: [patch] _q_import
[patch] _q_import
[patch] _q_import
2002-12-02
2002-12-03
2002-12-03
2002-12-04
2002-12-07
2002-12-07
2002-12-09
2002-12-09
2002-12-05
[patch] _q_import
Neil Schemenauer
2002-12-05
On Thu, Dec 05, 2002 at 02:16:38PM -0700, Jonathan Corbet wrote:
> > An example lazy importing _q_getname would be:
> >
> >     def _g_getname(request, component):
> >         global something
> >         if component == 'something':
> >             from somewhere import something
>
> How does Quixote know that _q_getname did an import in this case?  It seems
> that, at least, _q_getname would need to return the resulting module.

The code should have been:

    def _g_getname(request, component):
        global something
        if component == 'something':
            from somewhere import something
            return something

> Gee, a Quixote release that broke something?  I've never heard of that
> before...:)

There's a reason the version is less than 1.  Your pain is noted
however. :-)

> Is anybody even using the automatic importing now?  It's not a
> documented feature, you have to dig fairly deep into the publisher to
> even know that it's possible.

We use it extensively.

  Neil

reply