TAB completion

Dave Cinege dcinege at psychosis.com
Mon Jul 29 10:24:21 EDT 2002


On Monday 29 July 2002 10:10, Stefan Heimann wrote:
>
> Ah, ok thanks! I am developing with python 2.1 and this feature of the
> cmd class is not available in that version.

Hmmm...I don't know. I've only been playing with cmd the last few days, and
only with Python2.2. Ahh yes...I'm looking at both now and as of 2.2:

7. If completion is enabled, completing commands will be done automatically,
   and completing of commands args is done by calling complete_foo() with
   arguments text, line, begidx, endidx.  text is string we are matching
   against, all returned matches must begin with it.  line is the current
   input line (lstripped), begidx and endidx are the beginning and end
   indexes of the text being matched, which could be used to provide
   different completion depending upon which position the argument is in.

> Is it corrrect, that readline's default filename completion is applied
> when the function set with set_completer(completionFun) returns
> `None'?

You got me. Wrapping readline in python, then in a another class (cmd)
is a bit confusing, especially if you're not readline savy (I'm not and
don't want to be  : >)

I'd say get a hold of Python 2.2 and begin reviewing the cmd module
itself.

-- 
The time is now 22:48 (Totalitarian)  -  http://www.ccops.org/





More information about the Python-list mailing list