[IPython-user] Custom command completers implemented in SVN

Ville M. Vainio vivainio at gmail.com
Tue Oct 31 13:02:47 CST 2006


On 10/30/06, Ville M. Vainio <vivainio at gmail.com> wrote:

> I have a preliminary (but functional, and probably final)
> implementation of custom completer hooks implemented in SVN. Now it's
> quite easy to add your own completers.

I renamed the file to ipy_stock_completers.py and added two extra (and
probably more useful) completers - "import" and "svn" command
completers.

Here's how easy it is to create a completer for a program like svn
(str_key is the
"program" name, i.e. first word in the entry line, i.e. 'svn' in this example):

-----------------------

svn_commands = """\
add blame praise annotate ann cat checkout co cleanup commit ci copy
cp delete del remove rm diff di export help ? h import info list ls
lock log merge mkdir move mv rename ren propdel pdel pd propedit pedit
pe propget pget pg proplist plist pl propset pset ps resolved revert
status stat st switch sw unlock
"""

def svn_completer(self,even):
    return svn_commands.split()

ip.set_hook('complete_command', svn_completer, str_key = 'svn')


More information about the IPython-user mailing list