Allow Dates to be absent.

This commit is contained in:
Colin Watson 2014-07-24 17:35:47 +01:00
parent 0a2b1fd4b0
commit 0a4f948e3a

View File

@ -751,13 +751,16 @@ class Britney(object):
dates = {}
filename = os.path.join(basedir, "Dates")
self.__log("Loading upload data from %s" % filename)
for line in open(filename):
l = line.split()
if len(l) != 3: continue
try:
dates[l[0]] = (l[1], int(l[2]))
except ValueError:
self.__log("Dates, unable to parse \"%s\"" % line, type="E")
try:
for line in open(filename):
l = line.split()
if len(l) != 3: continue
try:
dates[l[0]] = (l[1], int(l[2]))
except ValueError:
self.__log("Dates, unable to parse \"%s\"" % line, type="E")
except IOError:
self.__log("%s missing; initialising upload data from scratch")
return dates
def write_dates(self, basedir, dates):