From 48bd7f3a71c05dafec820dbbf76e611add7a9849 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 29 Aug 2004 22:38:38 +0000 Subject: Whitespace normalization. test_difflib passes again. --- Lib/difflib.py | 62 +++++++++++----------- Lib/test/test_difflib.py | 32 +++++------ Lib/test/test_difflib_expect.html | 108 +++++++++++++++++++------------------- 3 files changed, 101 insertions(+), 101 deletions(-) diff --git a/Lib/difflib.py b/Lib/difflib.py index aa205f7..f855d46 100644 --- a/Lib/difflib.py +++ b/Lib/difflib.py @@ -1289,7 +1289,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None, if None, all from/to text lines will be generated. linejunk -- passed on to ndiff (see ndiff documentation) charjunk -- passed on to ndiff (see ndiff documentation) - + This function returns an interator which returns a tuple: (from line tuple, to line tuple, boolean flag) @@ -1300,7 +1300,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None, '\0-' -- marks start of deleted text '\0^' -- marks start of changed text '\1' -- marks end of added/deleted/changed text - + boolean flag -- None indicates context separation, True indicates either "from" or "to" line contains a change, otherwise False. @@ -1310,13 +1310,13 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None, Note, this function utilizes the ndiff function to generate the side by side difference markup. Optional ndiff arguments may be passed to this - function and they in turn will be passed to ndiff. + function and they in turn will be passed to ndiff. """ - import re + import re # regular expression for finding intraline change indices change_re = re.compile('(\++|\-+|\^+)') - + # create the difference iterator to generate the differences diff_lines_iterator = ndiff(fromlines,tolines,linejunk,charjunk) @@ -1375,7 +1375,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None, # thing (such as adding the line number) then replace the special # marks with what the user's change markup. return (num_lines[side],text) - + def _line_iterator(): """Yields from/to lines of text with a change indication. @@ -1392,7 +1392,7 @@ def _mdiff(fromlines, tolines, context=None, linejunk=None, """ lines = [] num_blanks_pending, num_blanks_to_yield = 0, 0 - while True: + while True: # Load up next 4 lines so we can look ahead, create strings which # are a concatenation of the first character of each of the 4 lines # so we can do some very readable comparisons. @@ -1550,7 +1550,7 @@ _file_template = """ -