for assignment in properties.split(", "):
(property, value) = assignment.split("=")
self.trees[tree][property.strip()] = int(value)
- # Now read the common-segment stuff
self.cliques = []
+ # Reading the clique data is slow, so we only do it
+ # on demand.
+
+ def read_matches(self):
+ # Now read the common-segment stuff
self.files = {}
locations = []
while 1:
def extract_text(self, clique):
"Return text corresponding to the given clique."
+ if self.matches and not self.cliques:
+ self.read_matches()
text = None
if self.dir:
olddir = os.getcwd()
def filter_by_size(self, minsize):
"Throw out all common segments below a specified size."
+ if self.matches and not self.cliques:
+ self.read_matches()
filtered = []
for clique in self.cliques:
for (file, start, end) in clique:
rep += " %s=%s," % (key, value)
sys.stdout.write(rep[:-1] + "\n")
print 75 * '-'
+ state.read_matches()
for clique in state.cliques:
(file, start, end, text) = state.extract_text(clique)
if start == 1 and end == state.files[file]: