From 9533f1c0e05014e6b579b316080030cd90b5d09f 2008-02-24 10:54:17 From: Ville M. Vainio Date: 2008-02-24 10:54:17 Subject: [PATCH] ipy_leo: %mb magic and relevant completer for leo minibuffer commands --- diff --git a/IPython/Extensions/ipy_leo.py b/IPython/Extensions/ipy_leo.py index cbefae7..089fac3 100644 --- a/IPython/Extensions/ipy_leo.py +++ b/IPython/Extensions/ipy_leo.py @@ -411,6 +411,25 @@ def leoref_f(self,s): ) ip.expose_magic('leoref',leoref_f) +from ipy_leo import * + +ip = IPython.ipapi.get() + +def mb_f(self, arg): + """ Execute leo minibuffer commands """ + c.executeMinibufferCommand(arg) + +def mb_completer(self,event): + """ Custom completer for minibuffer """ + cmds = c.commandsDict.keys() + cmds.sort() + return cmds + + pass +ip.set_hook('complete_command', mb_completer, str_key = 'mb') +ip.expose_magic('mb',mb_f) + + def show_welcome(): print "------------------" print "Welcome to Leo-enabled IPython session!"