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