Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

Reading from stdin first, then use curses

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


the_isz at gmx

Aug 11, 2013, 5:05 AM

Post #1 of 1 (12 views)
Permalink
Reading from stdin first, then use curses

Hi all,

I wrote a replacement for urlview to properly extract URLs from emails.
You can find the first draft here:

https://github.com/the-isz/pyurlview

When I call it with an email file passed to the '-f' argument, it does
pretty much what I want already. However, I intend to use it in mutt,
which pipes the message to the program like so:

macro pager \cu <pipe-entry>'pyurlview.py'<enter> 'Follow links with pyurlview'

The problem is rather obvious but - unfortunately - not so easy to solve:

* The program reads the mail from stdin
* The terminal in which it runs is a pseudo-terminal (pipe)
* curses is not able to accept user input from the pseudo-terminal

The question is:

How do I read from stdin first and afterwards allow curses to read user
input?

Thanks in advance and kind regards,

Timo
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.