Make rawdog work with Python 2.6 (reported by Roy Lanek).
+If feedfinder (which now needs Python 2.4 or later) can't be imported,
+just disable it.
+
Several changes as a result of profiling that significantly speed up
writing output files:
VERSION = "2.12rc3"
STATE_VERSION = 2
-import feedparser, feedfinder, plugins
+import feedparser, plugins
from persister import Persistable, Persister
import os, time, getopt, sys, re, cgi, socket, urllib2, calendar
import string, locale
hashlib = None
import sha
+try:
+ import feedfinder
+except:
+ feedfinder = None
+
def new_sha1(s = ""):
"""Return a new SHA1 hash object."""
if hashlib is None:
def add_feed(filename, url, rawdog, config):
"""Try to add a feed to the config file."""
- feeds = feedfinder.feeds(url)
+ if feedfinder is None:
+ feeds = [url]
+ else:
+ feeds = feedfinder.feeds(url)
if feeds == []:
print >>sys.stderr, "Cannot find any feeds in " + url
else: