Re: Reworking diffutil.Differ
- From: Vincent Legoll <vincent legoll gmail com>
- To: Kai Willadsen <kai willadsen gmail com>
- Cc: meld-list <meld-list gnome org>
- Subject: Re: Reworking diffutil.Differ
- Date: Sun, 8 Mar 2009 14:19:09 +0100
def set_sequences_iter(self, *sequences):
assert 0 <= len(sequences) <= 3
self.diffs = [[], []]
self.num_sequences = len(sequences)
self.seqlength = [len(s) for s in sequences]
if self.num_sequences >1:
for i in range(self.num_sequences - 1):
matcher = IncrementalSequenceMatcher(None,
sequences[1], sequences[i*2])
work = matcher.initialise()
while work.next() == None:
yield None
self.diffs[i] = matcher.get_difference_opcodes()
yield 1
Looks even shorter to me
--
Vincent Legoll
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]