Use standard option syntax (i.e. "--update --write" instead of "update
write"). The old syntax will be supported until 2.0.
-Warning output from --update now goes to stderr instead of stdout.
+Error output from reading the config file and 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).
+Added --config option to read an additional config file; this lets you
+have multiple output files with different options.
+
- rawdog 1.2
Updated feedparser to 2.5.2, which fixes a bug that was making rawdog
elapsed since it was last updated. This is useful if you're trying to
debug your own feed.
+"--config FILE" (or "-c FILE"), where FILE is an absolute path or a path
+relative to your .rawdog directory: Read FILE as an additional config
+file; any options provided in FILE will override those set in the
+default config (with the exception of "feed", which is cumulative).
+This is useful if you want rawdog to write two different output files
+with different sets of options ("rawdog -u -w -c config2 -w" will first
+update and write with the default config, then read config2, then write
+again).
+
You will want to run "rawdog -uw" periodically to fetch data and write
the output file. The easiest way to do this is to add a crontab entry
that looks something like this:
-l, --list List feeds known at time of last update
-w, --write Write out HTML output
-f|--update-feed URL Force an update on the single feed URL
+-c|--config FILE Read additional config file FILE
--help Display this help and exit
+Actions are taken in the order they are given on the command line.
+
Report bugs to <azz@us-lot.org>."""
def main(argv):
"""The command-line interface to the aggregator."""
try:
- (optlist, args) = getopt.getopt(argv, "ulwf:", ["update", "list", "write", "update-feed=", "help"])
+ (optlist, args) = getopt.getopt(argv, "ulwf:c:", ["update", "list", "write", "update-feed=", "help", "config="])
except getopt.GetoptError, s:
print s
usage()
try:
config.load("config")
except ConfigError, err:
- print err
+ print >>sys.stderr, "In config:"
+ print >>sys.stderr, err
return 1
persister = Persister("state", Rawdog)
rawdog.write(config)
elif o in ("-f", "--update-feed"):
rawdog.update(config, a)
+ elif o in ("-c", "--config"):
+ try:
+ config.load(a)
+ except ConfigError, err:
+ print >>sys.stderr, "In " + a + ":"
+ print >>sys.stderr, err
+ return 1
persister.save()