Warning output from --update now goes to stderr instead of stdout.
+Made the socket timeout configurable (which also means the included copy
+of feedparser isn't modified any more).
+
- rawdog 1.2
Updated feedparser to 2.5.2, which fixes a bug that was making rawdog
# Whether to show the list of active feeds in the generated HTML.
showfeeds 1
+# The time in seconds that rawdog will wait before considering a feed
+# unreachable when trying to connect. If you're getting lots of timeout
+# errors and are on a slow connection, increase this.
+timeout 30
+
# The feeds you want to watch, in the format "feed period url".
# The period is the minimum time in minutes between updates; if less
# than period minutes have passed, "rawdog update" will skip that feed.
from StringIO import StringIO
import timeoutsocket
-# Override the timeout set by feedparser.
-timeoutsocket.setDefaultSocketTimeout(30)
-
def format_time(secs, config):
"""Format a time and date nicely."""
t = time.localtime(secs)
"timeformat" : "%I:%M %p",
"userefresh" : 0,
"showfeeds" : 1,
+ "timeout" : 30,
}
def __getitem__(self, key): return self.config[key]
self["userefresh"] = int(l[1])
elif l[0] == "showfeeds":
self["showfeeds"] = int(l[1])
+ elif l[0] == "timeout":
+ self["timeout"] = int(l[1])
else:
raise ConfigError("Unknown config command: " + l[0])
def update(self, config, feedurl = None):
now = time.time()
+ timeoutsocket.setDefaultSocketTimeout(config["timeout"])
+
seenfeeds = {}
for (url, period) in config["feedslist"]:
seenfeeds[url] = 1