Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.054 X-Spam-Evidence: '*H*': 0.89; '*S*': 0.00; 'advance': 0.07; 'already.': 0.09; 'received:gmx.net': 0.09; 'url:github': 0.09; 'runs': 0.10; 'wrote': 0.14; 'afterwards': 0.16; 'argument,': 0.16; 'from:addr:gmx.de': 0.16; 'subject:Reading': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'properly': 0.19; 'input': 0.22; 'aug': 0.22; 'header:User-Agent:1': 0.23; 'question': 0.24; 'header:In-Reply- To:1': 0.27; 'draft': 0.30; "skip:' 10": 0.31; 'extract': 0.31; 'file': 0.32; 'subject:from': 0.34; 'problem': 0.35; 'but': 0.35; 'there': 0.35; 'really': 0.36; '+0200,': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'to:addr:python-list': 0.38; 'rather': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'skip:u 10': 0.60; 'read': 0.60; 'easy': 0.60; 'first': 0.61; 'here:': 0.62; 'content-disposition:inline': 0.62; 'kind': 0.63; 'mail,': 0.68; 'reads': 0.68; 'obvious': 0.74; 'received:178': 0.74; 'emails.': 0.78; '2013': 0.98 Date: Sat, 31 Aug 2013 10:31:03 +0200 From: Timo Schmiade To: python-list@python.org Subject: Re: Reading from stdin first, then use curses Mail-Followup-To: python-list@python.org References: <20130811120511.GA8223@Discworld.fritz.box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130811120511.GA8223@Discworld.fritz.box> User-Agent: Mutt/1.5.21 (2010-09-15) X-Provags-ID: V03:K0:kpfL0HnG4/OcEvtfMkWv4E5vPaXHmpulfRq0+HCUk76hQ0bHvma A6SzfYKD93w2l4QnnfR0xI8+U5FpAvdegxKnY1bjpn0ozev8XHOa0QdKh2ahATkOuq2jxL7 N2dspTjUYd/i1bFgTdsX+cC4zTqNGniS7iM9RNmYvBRj3jX75JGuuvTvZvLaj31LKzCfv+W qKDS4z/eZNVP8Eo7nEgKw== X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1377937872 news.xs4all.nl 15898 [2001:888:2000:d::a6]:60175 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:53337 Hi again, sorry for replying to my own mail, but is there really no solution? Can curses really not be used in this situation? Thanks again, Timo On Sun, Aug 11, 2013 at 02:05:11PM +0200, Timo Schmiade wrote: > 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 'pyurlview.py' '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