Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Confusion regarding the readline module

Reply
Thread Tools

Confusion regarding the readline module

 
 
Siddhant
Guest
Posts: n/a
 
      05-06-2008
Hi!
I am having some doubts related to the readline module. I hope someone
could clear them.
1. What exactly does the readline.get_line_buffer() function do? Does
it return whatever is the current input by the user? If yes, then can
I use it to check the current inputs of the user and base the next-
word completion against whatever the user has entered so far? There
wasn't much documentation on it, and a lot of googling couldn't help
much.
2. Related to the completer function, what is meant by returning the
"state"th completion for "text"? Is the completer function called
everytime (for all possible values of "state") when I press the Tab
key? When/How is it called?

Basically, I need to define a completer function, that should take
into consideration whatever the user has entered so far, and complete
the next word accordingly. The same way as a "cd /some/file" is
meaningless.
 
Reply With Quote
 
 
 
 
Diez B. Roggisch
Guest
Posts: n/a
 
      05-06-2008
Siddhant wrote:

> Hi!
> I am having some doubts related to the readline module. I hope someone
> could clear them.
> 1. What exactly does the readline.get_line_buffer() function do? Does
> it return whatever is the current input by the user? If yes, then can
> I use it to check the current inputs of the user and base the next-
> word completion against whatever the user has entered so far? There
> wasn't much documentation on it, and a lot of googling couldn't help
> much.
> 2. Related to the completer function, what is meant by returning the
> "state"th completion for "text"? Is the completer function called
> everytime (for all possible values of "state") when I press the Tab
> key? When/How is it called?
>
> Basically, I need to define a completer function, that should take
> into consideration whatever the user has entered so far, and complete
> the next word accordingly. The same way as a "cd /some/file" is
> meaningless.


I don't know anything about readline (beyond it's existence of course) - but
I do know & use the rlcompleter2 module. Go download it and look into it's
source, it should give you an idea how to proceed.

Diez
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
compiling python 3.1.2 with local readline fails to get readline - help! gavino Python 4 09-20-2010 05:17 AM
Getting application ReadLine and Perl debugger ReadLine to cooperate Andrew DeFaria Perl Misc 1 01-30-2008 11:46 PM
Readline::readline() blocking all other threads Jean-Michel Ruby 0 12-22-2007 01:00 AM
readline module and white-space MackS Python 1 05-20-2005 06:46 AM
Readline module Jonathan Daugherty Python 1 08-25-2004 11:01 AM



Advertisments