- rawdog 2.23
+When automatically updating the config file in response to an HTTP
+redirect fails, produce a more sensible error message (including the URL
+of the feed in question).
+
- rawdog 2.22
When handling an HTTP 301 redirect response, check whether the new
errors.append("New URL: " + location)
errors.append("The feed has moved permanently to a new URL.")
if config["changeconfig"]:
- rawdog.change_feed_url(self.url, location, config)
- errors.append("The config file has been updated automatically.")
+ rawdog.change_feed_url(self.url, location, config, errors.append)
else:
errors.append("You should update its entry in your config file.")
errors.append("")
version = 1
return version == STATE_VERSION
- def change_feed_url(self, oldurl, newurl, config):
+ def change_feed_url(self, oldurl, newurl, config, error_fn):
"""Change the URL of a feed."""
assert self.feeds.has_key(oldurl)
if self.feeds.has_key(newurl):
- print >>sys.stderr, "Error: New feed URL is already subscribed; please remove the old one"
- print >>sys.stderr, "from the config file by hand."
+ error_fn("Error: New feed URL is already subscribed; please remove the old one")
+ error_fn("from the config file by hand.")
return
edit_file("config", ChangeFeedEditor(oldurl, newurl).edit)
if article.feed == oldurl:
article.feed = newurl
- print >>sys.stderr, "Feed URL automatically changed."
+ error_fn("The config file has been updated automatically.")
def list(self, config):
"""List the configured feeds."""