3 class ISerializedSet(object):
5 raise NotImplementedError
7 class SerializedSet(ISerializedSet):
8 def __init__(self, file):
10 if os.path.isfile(file):
11 for line in open(file, "r"):
12 self.set.add(line.rstrip())
13 self.file = open(file, "a")
14 def __contains__(self, name):
15 return name in self.set
18 self.file.write(name + "\n")
21 class DummySerializedSet(ISerializedSet):
22 """Dummy object that doesn't actually cache anything and
23 claims that everything needs to be done"""
24 def __contains__(self, name):