[Zope-Checkins] CVS: Zope3/lib/python/Zope/PageTemplate/tests - util.py:1.1.2.9

Guido van Rossum guido@python.org
Thu, 25 Apr 2002 23:36:44 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/PageTemplate/tests
In directory cvs.zope.org:/tmp/cvs-serv17950

Modified Files:
      Tag: Zope-3x-branch
	util.py 
Log Message:
There is no OFS.ndiff.  Use difflib instead.  (difflib probably has a
way to produce a nice diff with less code, but it's not obvious from
the examples in the docs.  (The docs are geared towards showing how to
produce ndiff-style output, which prints the entire file instead of
only the changes like classic diff style.)


=== Zope3/lib/python/Zope/PageTemplate/tests/util.py 1.1.2.8 => 1.1.2.9 ===
         return "%d,%d" % (lo+1, hi)
 
+def dump(tag, x, lo, hi):
+    for i in xrange(lo, hi):
+        print '%s %s' % (tag, x[i]),
+
 def check_html(s1, s2):
     s1 = normalize_html(s1)
     s2 = normalize_html(s2)
     if s1!=s2:
         print
-        from OFS.ndiff import SequenceMatcher, dump, IS_LINE_JUNK
+        from difflib import SequenceMatcher, IS_LINE_JUNK
         a = s1.split('\n')
         b = s2.split('\n')
         def add_nl(s):