Permalink
Browse files

Move Debian feedparser into the tree

Also add -s flag to canto-fetch to optionally use the system's feedparser
instead.

Signed-off-by: Jack Miller <jack@codezen.org>
  • Loading branch information...
themoken committed May 17, 2010
1 parent 48cb5b2 commit d0be7a380987786492c38566ed451e1593bbffe5
Showing with 2,879 additions and 3 deletions.
  1. +10 −3 canto/canto_fetch.py
  2. +2,869 −0 canto/feedparser_builtin.py
View
@@ -23,7 +23,6 @@
import args
from threading import Thread
-import feedparser
import traceback
import commands
import urlparse
@@ -40,8 +39,8 @@
def main(enc):
conf_dir, log_file, conf_file, feed_dir, script_dir, optlist =\
args.parse_common_args(enc,
- "hvVfdbi:", ["help","version","verbose","force","daemon",\
- "background", "interval="], "canto-fetch")
+ "hvVfdbi:s", ["help","version","verbose","force","daemon",\
+ "background", "interval=", "sysfp"], "canto-fetch")
try :
cfg = get_cfg(conf_file, log_file, feed_dir, script_dir)
@@ -85,11 +84,19 @@ def log_func(x):
cfg.log("%s isn't a valid interval" % arg)
else:
cfg.log("interval = %d seconds" % updateInterval)
+ if opt in ["-s","--sysfp"]:
+ log_func("Using system feedparser")
+ import feedparser
if opt in ["-V","--verbose"]:
verbose = True
elif opt in ["-f","--force"]:
force = True
+ if "feedparser" not in locals():
+ log_func("Using built-in feedparser")
+ import feedparser_builtin as feedparser
+ globals()["feedparser"] = feedparser
+
# Remove any crap out of the directory. This is mostly for
# cleaning up when the user has removed a feed from the configuration.
Oops, something went wrong.

0 comments on commit d0be7a3

Please sign in to comment.