Re: Re: enable_ptl/easy_install problem

"Mike Orr" <[email protected]> Tue, 1 May 2007 13:25:53 -0700
Newsgroups gmane.comp.web.quixote.user
Message-ID <[email protected]>
On 5/1/07, Michael Watkins <[email protected]> wrote:
> * Michael Watkins wrote on [2007-05-01 13:14:38 -0700]:
>
> > * Mike Orr wrote on [2007-05-01 12:48:03 -0700]:
> > >  You can make a utility script like this:
> > -- snip --
> > >  Import hooks are fragile in Python, and often break when combined with
> > >  import hooks from other packages.
> >
> > Can't speak for the developers of QP but no doubt this was one of
> > the reasons behind dropping the import hook in Quixote's cousin QP
> > in favour of putting two lines in one or more of a package's
> > __init__.py:
> >
> >     from qpy.compile import compile_qpy_files
> >     compile_qpy_files(__path__[0])
>
> forgot to add... taking Mike's proposed script and using the
> __init__.py approach of QP could likely be cooked up into a workable
> solution for Quixote PTL files too.

You could also run it in a separate process at the beginning of your
production application (see Python's subprocess module).  That would
prevent any import hooks from leaking into the main application
process.

-- 
Mike Orr <[email protected]>