Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52383

Reading from stdin first, then use curses

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <timo.schmiade@gmx.de>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.045
X-Spam-Evidence '*H*': 0.91; '*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; 'all,': 0.19; 'properly': 0.19; 'input': 0.22; 'header:User-Agent:1': 0.23; 'question': 0.24; 'draft': 0.30; "skip:' 10": 0.31; 'extract': 0.31; 'file': 0.32; 'subject:from': 0.34; 'problem': 0.35; 'but': 0.35; '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; 'reads': 0.68; 'received:212.227.17': 0.68; 'obvious': 0.74; 'emails.': 0.78
Date Sun, 11 Aug 2013 14:05:11 +0200
From Timo Schmiade <the_isz@gmx.de>
To python-list@python.org
Subject Reading from stdin first, then use curses
Mail-Followup-To python-list@python.org
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Disposition inline
User-Agent Mutt/1.5.21 (2010-09-15)
Sender timo.schmiade@gmx.de
X-Provags-ID V03:K0:NOswFGQXQm95ABdnmCjmR5iW5G+fbzctmji3r3AGZ7xjOc4JKkD oNCLbPLICMbU/wgxqy9uWK+Uk1rYmBzCVVYAh+nanVGxeYwnyKgv4MYK68sZfoZorp8c8ok d7lV+mZWg3RO3pXGk6W5mFwoXsn20NIHsrQd5YWk94ihBT2OHS5Ihk9JMNXs5O24nxTjN7s MuKGxFX6PqoyZSCYmH6Bg==
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.481.1376222719.1251.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1376222719 news.xs4all.nl 16005 [2001:888:2000:d::a6]:34225
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52383

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Reading from stdin first, then use curses Timo Schmiade <the_isz@gmx.de> - 2013-08-11 14:05 +0200

csiph-web