Home | History | Annotate | Download | only in python2.7

Lines Matching refs:lines

25     For producing human-readable deltas from sequences of lines of text.
67 to synching up on blocks of "junk lines", though (like blank lines in
68 ordinary text files, or maybe "<P>" lines in HTML files). That may be
110 uses SequenceMatcher both to compare sequences of lines, and to compare
111 sequences of characters within similar (near-matching) lines.
162 if you're comparing lines as sequences of characters, and don't
589 Return a generator of groups with upto n lines of context.
768 Differ is a class for comparing sequences of lines of text, and
770 SequenceMatcher both to compare sequences of lines, and to compare
771 sequences of characters within similar (near-matching) lines.
780 Lines beginning with '? ' attempt to guide the eye to intraline
781 differences, and were not present in either input sequence. These lines
857 Compare two sequences of lines; generate the resulting delta.
868 `IS_LINE_JUNK` may be used to filter out lines without visible
871 SequenceMatcher class has grown an adaptive notion of "noise" lines
886 Compare two sequences of lines; generate the resulting delta.
947 When replacing one block of lines with another, search the blocks
948 for *similar* lines; the best-matching pair (if any) is used as a
964 # don't synch up unless the lines have a similarity score of at
968 eqi, eqj = None, None # 1st indices of equal lines (if any)
971 # (identical lines must be junk lines, & we don't want to synch up
1016 # pump out a '-', '?', '+', '?' quad for the synched lines
1150 beginning = start + 1 # lines start numbering with one
1161 Compare two sequences of lines; generate the delta as a unified diff.
1164 lines of context. The number of context lines is set by 'n' which
1167 By default, the diff control lines (those with ---, +++, or @@) are
1233 beginning = start + 1 # lines start numbering with one
1245 Compare two sequences of lines; generate the delta as a context diff.
1248 lines of context. The number of context lines is set by 'n' which
1251 By default, the diff control lines (those with *** or ---) are
1325 recommended; as of Python 2.3, an adaptive notion of "noise" lines is
1357 fromlines -- list of text lines to compared to tolines
1358 tolines -- list of text lines to be compared to fromlines
1359 context -- number of context lines to display on each side of difference,
1360 if None, all from/to text lines will be generated.
1394 def _make_line(lines, format_key, side, num_lines=[0,0]):
1397 lines -- list of lines from the ndiff generator to produce a line of
1399 lines used are removed from this list.
1421 return (num_lines[side],lines.pop(0)[2:])
1424 text, markers = lines.pop(0), lines.pop(0)
1438 text = lines.pop(0)[2:]
1451 """Yields from/to lines of text with a change indication.
1453 This function is an iterator. It itself pulls lines from a
1456 or the other. In addition to yielding the lines of from/to text, a
1464 lines = []
1467 # Load up next 4 lines so we can look ahead, create strings which
1468 # are a concatenation of the first character of each of the 4 lines
1470 while len(lines) < 4:
1472 lines.append(diff_lines_iterator.next())
1474 lines.append('X')
1475 s = ''.join([line[0] for line in lines])
1477 # When no more lines, pump out any remaining blank lines so the
1478 # corresponding add/delete lines get a matching blank line so
1483 yield _make_line(lines,'?',0), _make_line(lines,'?',1), True
1487 # caught up on blank lines yet, just process the delete line
1489 yield _make_line(lines,'-',0), None, True
1494 from_line,to_line = _make_line(lines,'-',0), None
1498 yield _make_line(lines,None,0), _make_line(lines,'?',1), True
1502 yield _make_line(lines,'?',0), _make_line(lines,None,1), True
1507 yield _make_line(lines,'-',0), None, True
1511 # caught up on blank lines yet, just process the add line
1513 yield None, _make_line(lines,'+',1), True
1517 from_line, to_line = None, _make_line(lines,'+',1)
1522 yield None, _make_line(lines,'+',1), True
1526 yield _make_line(lines[:],None,0),_make_line(lines,None,1),False
1528 # Catch up on the blank lines so when we yield the next from/to
1542 """Yields from/to lines of text with a change indication.
1544 This function is an iterator. It itself pulls lines from the line
1546 always yields a pair of from/to text lines (with the change
1547 indication). If necessary it will collect single from/to lines
1557 # Collecting lines of text until we have a from/to pair
1576 # storage of lines until we know for sure that they are to be yielded.
1581 # Store lines up until we find a difference, note use of a
1591 # Yield lines that we have collected so far, but first yield
1604 # Now yield the context lines after the change
1700 wrapcolumn -- column number where lines are broken and wrapped,
1701 defaults to None where lines are not wrapped.
1716 fromlines -- list of "from" lines
1717 tolines -- list of "to" lines
1722 numlines -- number of context lines. When context is set True,
1723 controls number of lines displayed before and after the change.
1724 When context is False, controls the number of lines to place
1759 """Builds list of text lines by splitting text lines at wrap point
1762 wrapped (split) into separate lines. If so, the first wrap point
1796 # wrap point is inside text, break it up into separate lines
1814 """Returns iterator that splits (wraps) mdiff text lines"""
1824 # list of text lines.
1828 # yield from/to line in pairs inserting blank lines as
1829 # necessary when one side has more wrapped lines
1852 # store HTML markup of the lines into the lists
1856 # exceptions occur for lines where context separators go
1863 """Returns HTML markup of "from" / "to" text lines
1874 # handle blank lines where linenum is '>' or ''
1912 # at the beginning of a change, drop an anchor a few lines
1913 # (the context lines) before the change for the previous
1948 fromlines -- list of "from" lines
1949 tolines -- list of "to" lines
1954 numlines -- number of context lines. When context is set True,
1955 controls number of lines displayed before and after the change.
1956 When context is False, controls the number of lines to place
1977 # set up iterator to wrap lines that exceed desired width
1981 # collect up from/to lines and flags into lists (also format the lines)
1993 # mdiff yields None on separator lines skip the bogus ones
2027 lines originating from file 1 or 2 (parameter `which`), stripping off line