[IPython-user] Hierarchical TAB completion?

Pierre Bielmann pierre.bielmann@gmail....
Tue Apr 3 17:01:48 CDT 2007


On 4/3/07, Ville M. Vainio <vivainio@gmail.com> wrote:
>
> On 4/3/07, Pierre Bielmann <pierre.bielmann@gmail.com> wrote:
>
> > Hi all,
> >
> > Is it possible to implement (with iPython) a shell which behaves like a
> > classical
> > Router Command Line Shell (e.g. Cisco IOS shell, etc.)? I'd like to
> "enter"
> > objects in a hierachical
> > fashion and execute commands/methods and also have command line
> completion
> > only in that context
> > (and not globally). Here is a simple example of what I have in mind:
>
> http://ipython.scipy.org/moin/Cookbook/CustomCompleters
>
> Perhaps you could hook a completer method of your state-aware object
> as a re_key = '.*' (match all), so it would be "tried" for every
> command line. It would just see that it's currently in state 'user',
> and return appropriate completions.
>
> I.e. you have only one completer function, which just behaves
> differently depending on the state. Granted that it's not the most
> elegant solution.
>
> --
> Ville M. Vainio - vivainio.googlepages.com
> blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'
>


Hi,
thanks for the input. I was thinking along the same line but hoping for some
other idea. :-)
I'll take a look at it and see if this works out.

Pierre

-- 
Pierre Bielmann <pierre.bielmann@gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ipython.scipy.org/pipermail/ipython-user/attachments/20070404/acf15310/attachment.html 


More information about the IPython-user mailing list