[IPython-dev] autoload and making %pydb be more ipythonic (was: Extensions/pydb_ipy.py added)

Ville M. Vainio vivainio at gmail.com
Sun Nov 26 02:43:13 CST 2006


On 11/26/06, R. Bernstein <rocky at panix.com> wrote:

>  > I think a good first line of action would be to add an ipapi function
>  > that permanently registers a magic name / completer trigger (or
>  > whatever)  with ipython.
>
> So this ipapi function doesn't exist yet, right?

Right.

>  > Here's what one could do e.g. in setup.py for pydb:
>  >
>  > import IPython.ipapi
>  > ip = IPython.ipapi.get()
>  >
>  > ip.register_autoload("%pydb", "pydb.ipy_pydb")
>
> I'm guessing from the above that the ipapi function that needs to get
> added is called "register_autoload", correct? (Right now I don't see
> "register_autoload" in ipython sources.)

Yes. register_autoload doesn't exist yet, I'm still merely
branistroming some ideas.

> indicates what to import. It doesn't make sense to do anything when
> installing pydb. And the goal here was to be able to run "%pydb"

Why doesn't it make sense to do this when installing pydb? Isn't
installation the exact time when things like this should be done?

> The two natural places then would be in ipy_user_conf.py or
> ipy_system_conf.py. And it looks like all of the other extensions in

These are imported every time ipython starts. register_autoload would
be a persistent operation, i.e. it should only be run only once and
ipython stores the autoload map to somewhere in the ".ipython"
directory which it reads on startup.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


More information about the IPython-dev mailing list