Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add yet another KeyboardInterrupt case: if the interrupt happens

early in the feedparser.parse() call (feedparser can sometimes just
hang while trying to open the RSS url), give the user a chance to
skip the current feed without aborting the run.
  • Loading branch information...
commit 147a5453acd949aecd318a7f4c7b2d59445e43b8 1 parent 737114b
@akkana authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 feedme
View
14 feedme
@@ -837,7 +837,19 @@ Copyright 2011 by Akkana Peck; share and enjoy under the GPL v2 or later."
try :
if len(args) == 0 :
for feedname in sections :
- get_feed(feedname, config, cache, cachefile, last_time, msglog)
+ # This can hang if feedparser hangs parsing the initial RSS.
+ # So give the user a chance to ^C out of one feed
+ # without stopping the whole run:
+ try :
+ get_feed(feedname, config, cache, cachefile,
+ last_time, msglog)
+ except KeyboardInterrupt :
+ print >>sys.stderr, "Interrupt! Skipping feed", feedname
+ handleKeyboardInterrupt("Type q to quit, anything else to skip to next feed: ")
+ # We don't actually have to check the return value;
+ # handleKeyboardInterrupt will quit if the user types q.
+
+ #sys.exit(1)
else :
for arg in args :
print >>sys.stderr, 'Getting feed for', arg
Please sign in to comment.
Something went wrong with that request. Please try again.