X-Git-Url: http://git.ozo.com/?a=blobdiff_plain;f=rawdoglib%2Frawdog.py;h=9982fbb570009c65f05c73859b8d71ff318dd61b;hb=978d4e3f231b60394bde2233f6e8417df35c55f8;hp=c5b7e45cafcd01c7338676eb1015f5b393955d16;hpb=dc91b92a36ce80ae4e1106125816ffef776db95d;p=rawdog%2F.git diff --git a/rawdoglib/rawdog.py b/rawdoglib/rawdog.py index c5b7e45..9982fbb 100644 --- a/rawdoglib/rawdog.py +++ b/rawdoglib/rawdog.py @@ -23,9 +23,6 @@ import os, time, sha, getopt, sys 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) @@ -254,6 +251,7 @@ class Config: "timeformat" : "%I:%M %p", "userefresh" : 0, "showfeeds" : 1, + "timeout" : 30, } def __getitem__(self, key): return self.config[key] @@ -297,6 +295,8 @@ class Config: 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]) @@ -317,6 +317,8 @@ class Rawdog(Persistable): def update(self, config, feedurl = None): now = time.time() + timeoutsocket.setDefaultSocketTimeout(config["timeout"]) + seenfeeds = {} for (url, period) in config["feedslist"]: seenfeeds[url] = 1