Allow Dates to be absent.

bzr-import-20160707
Colin Watson 11 years ago
parent 0a2b1fd4b0
commit 0a4f948e3a

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

Loading…
Cancel
Save