2.0 (and external programs that manipulate rawdog state files will also
be broken).
+rawdog now keeps track of a version number in the state file, and will
+complain if you use a state file from an incompatible version.
+
The old option syntax ("rawdog update write") is no longer supported.
- rawdog 1.13
# MA 02111-1307 USA, or see http://www.gnu.org/.
VERSION = "2.0rc1"
+STATE_VERSION = 2
import feedparser
from persister import Persistable, Persister
import os, time, sha, getopt, sys, re, urlparse, cgi, socket, urllib2
def __init__(self):
self.feeds = {}
self.articles = {}
+ self.state_version = STATE_VERSION
+
+ def check_state_version(self):
+ """Check the version of the state file."""
+ try:
+ version = self.state_version
+ except AttributeError:
+ # rawdog 1.x didn't keep track of this.
+ version = 1
+ return version == STATE_VERSION
def list(self):
for url in self.feeds.keys():
print "This usually means the file is corrupt, and removing it will fix the problem."
return 1
+ if not rawdog.check_state_version():
+ print "The state file " + statedir + "/state was created by an older"
+ print "version of rawdog, and cannot be read by this version."
+ print "Removing the state file will fix it."
+ return 1
+
for o, a in optlist:
if o in ("-u", "--update"):
rawdog.update(config)