zs

Zeitungsschau rss to email converter
git clone git://r-36.net/zs
Log | Files | Refs | LICENSE

commit 0626d417d52845d03223244faa8238210ff87229
parent de38800ce7a8ad243771b74cf84e36a84aebc0d1
Author: Christoph Lohmann <20h@r-36.net>
Date:   Tue, 18 Mar 2014 06:38:41 +0100

Fix some feed issue and resolve incomplete reads.

Diffstat:
feeddb.py | 12+++++++-----
zs.py | 4++++
2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/feeddb.py b/feeddb.py @@ -110,18 +110,20 @@ class feeddb(object): feed = self.readfeed(uri) if feed == None: return None + if key not in feed: + return None return feed[key] def setretry(self, uri, retries): self.setfeedval(uri, "retry", retries) - - def incretry(self, uri): + + def getretry(self, uri): retries = self.getfeedval(uri, "retry") if retries == None: - self.setfeedval(uri, "retry", 1) + return 0 else: - self.setfeedval(uri, "retry", retries+1) - + return retries + def pause(self, uri): self.setfeedval(uri, "pause", True) diff --git a/zs.py b/zs.py @@ -13,6 +13,7 @@ import opml import feedemail import urllib.error import socket +import http.client def run(db, selfeed=None, dryrun=False): feeduris = db.listfeeds() @@ -41,6 +42,9 @@ def run(db, selfeed=None, dryrun=False): except ConnectionResetError: estr = "connreset" retries += 1 + except http.client.IncompleteRead: + estr = "incompleteread" + continue # retry handling if estr != None: