[zopeorg-checkins] CVS: Products/ZWiki - Diff.py:1.2

Ken Manheimer klm at zope.com
Mon Jan 14 14:56:07 EST 2002


Update of /cvs-zopeorg/Products/ZWiki
In directory cvs.zope.org:/tmp/cvs-serv19618

Modified Files:
	Diff.py 
Log Message:
.textDiff(): Comment out application of TextFormatter to wrap long
lines.  This had the effect of removing all leading whitespace -
particularly undesirable in the structured-text context of wiki pages!
(I don't see a lot of point to this in the first place, but i didn't
actually know why it was there in the first place - i just left it in
when adopting simon's stuff.  I hope i'm not missing some way it's
key...)

I also increased the threshold for abbreviated lines to 500 (from 50).

._abbreviateDiffLines(): Changed the default maxlines to 50 (from 5).


=== Products/ZWiki/Diff.py 1.1 => 1.2 ===
         b = b or self.lasttext(versionsBack=revB)
 
-        # wrap (but don't fill or pad) long lines
-        formatter = TextFormatter.TextFormatter((
-            {'width':70, 'fill':0, 'pad':0},
-            ))
-        a=formatter.compose((a,))
-        b=formatter.compose((b,))
+##        # wrap (but don't fill or pad) long lines
+##        formatter = TextFormatter.TextFormatter((
+##            {'width':70, 'fill':0, 'pad':0},
+##            ))
+##        a=formatter.compose((a,))
+##        b=formatter.compose((b,))
             
         a = split(a,'\n')
         b = split(b,'\n')
@@ -87,7 +87,7 @@
                 r.append('')
             elif tag == 'insert':
                 r.append('++added:')
-                r = r + self._abbreviateDiffLines(b[blo:bhi],'',50)
+                r = r + self._abbreviateDiffLines(b[blo:bhi],'',500)
                 r.append('')
             elif tag == 'equal':
                 pass
@@ -96,7 +96,7 @@
 
         return join(r, '\n')+'\n'
 
-    def _abbreviateDiffLines(self,lines,prefix,maxlines=5):
+    def _abbreviateDiffLines(self,lines,prefix,maxlines=50):
         output = []
         if maxlines and len(lines) > maxlines:
             extra = len(lines) - maxlines





More information about the zopeorg-checkins mailing list