Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how-to use readline.set_completion_display_matches_hook()?

Reply
Thread Tools

how-to use readline.set_completion_display_matches_hook()?

 
 
Jean-Pierre Miceli
Guest
Posts: n/a
 
      11-07-2012
Hi all,

I'm working on a tool which enable support of tab completion using the
readline modul.
And I have a problem with set_completion_display_matches_hook function

I've created a display hook function and registered it. It is called
and it prints the desire messages. But once it has completed,
readline/python does not display the prompt.
I've got to press the 'return' key to see the prompt again.
What should the display hook function do to return correctly and let
the prompt be displayed?

Example:
def completerHook(self, substitution, matches, longest_match_length):
print ""
print "Test of the display hook function"
for i in range(len(matches)):
print matches[i],

I use Python 2.7.3 and done some tests on Mac OS 10.7 (Lion) and
Ubuntu. I got the same issue on both system.

Thanks for your help
J-P
 
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
Could not use ''; file already in use. M K ASP .Net 11 04-09-2008 11:35 AM
where to use CPLD & where to use FPGA? kulkarku@math.net VHDL 6 03-06-2006 07:27 AM
How do I know when to use the Viewstate and when to use the posted data? :-) Simon ASP .Net 1 11-09-2004 02:32 AM
Can I use XPath or something to a remote Mac or Linux box and just query an xml file, not using web services and use encyrption? jake ASP .Net 0 07-06-2004 02:16 PM
Cannot use the profile "default" because it is in use, not. please.post@yur.re.ply Firefox 1 07-04-2004 03:41 AM



Advertisments