[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/python/python-docs-pl/3.15/library/difflib.po [Back]  [Original]

# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR , YEAR.
#
# Translators:
# python-doc bot, 2026
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-08-25 14:37+0000\n"
"PO-Revision-Date: 2025-09-16 00:01+0000\n"
"Last-Translator: python-doc bot, 2026\n"
"Language-Team: Polish (https://app.transifex.com/python-doc/teams/5390/pl/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pl\n"
"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10=0 && n%10=5 && "
"n%10=12 && n%100 b[{}:{}] {!r:>8} --> {!r}'.format(\n"
"...         tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2]))\n"
"delete    a[0:1] --> b[0:0]      'q' --> ''\n"
"equal     a[1:3] --> b[0:2]     'ab' --> 'ab'\n"
"replace   a[3:4] --> b[2:3]      'x' --> 'y'\n"
"equal     a[4:6] --> b[3:5]     'cd' --> 'cd'\n"
"insert    a[6:6] --> b[5:6]       '' --> 'f'"
msgstr ""

msgid "Return a :term:`generator` of groups with up to *n* lines of context."
msgstr ""

msgid ""
"Starting with the groups returned by :meth:`get_opcodes`, this method splits "
"out smaller change clusters and eliminates intervening ranges which have no "
"changes."
msgstr ""

msgid "The groups are returned in the same format as :meth:`get_opcodes`."
msgstr ""

msgid ""
"Return a measure of the sequences' similarity as a float in the range [0, 1]."
msgstr ""

msgid ""
"Where T is the total number of elements in both sequences, and M is the "
"number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the "
"sequences are identical, and ``0.0`` if they have nothing in common."
msgstr ""

msgid ""
"This is expensive to compute if :meth:`get_matching_blocks` or :meth:"
"`get_opcodes` hasn't already been called, in which case you may want to try :"
"meth:`quick_ratio` or :meth:`real_quick_ratio` first to get an upper bound."
msgstr ""

msgid "Return an upper bound on :meth:`ratio` relatively quickly."
msgstr ""

msgid "Return an upper bound on :meth:`ratio` very quickly."
msgstr ""

msgid ""
"The three methods that return the ratio of matching to total characters can "
"give different results due to differing levels of approximation, although :"
"meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher."
"real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher."
"ratio`:"
msgstr ""

msgid "Examples"
msgstr "Przykady"

msgid "SequenceMatcher examples"
msgstr ""

msgid "This example compares two strings, considering blanks to be \"junk\":"
msgstr ""

msgid ""
":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the "
"similarity of the sequences.  As a rule of thumb, a :meth:`~SequenceMatcher."
"ratio` value over 0.6 means the sequences are close matches:"
msgstr ""

msgid ""
"If you're only interested in where the sequences match, :meth:"
"`~SequenceMatcher.get_matching_blocks` is handy:"
msgstr ""

msgid ""
"Note that the last tuple returned by :meth:`~SequenceMatcher."
"get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is "
"the only case in which the last tuple element (number of elements matched) "
"is ``0``."
msgstr ""

msgid ""
"If you want to know how to change the first sequence into the second, use :"
"meth:`~SequenceMatcher.get_opcodes`:"
msgstr ""

msgid ""
"The :func:`get_close_matches` function in this module which shows how simple "
"code building on :class:`SequenceMatcher` can be used to do useful work."
msgstr ""

msgid ""
"`Simple version control recipe `_ for a small application built with :class:"
"`SequenceMatcher`."
msgstr ""

msgid "Differ example"
msgstr ""

msgid ""
"This example compares two texts. First we set up the texts, sequences of "
"individual single-line strings ending with newlines (such sequences can also "
"be obtained from the :meth:`~io.IOBase.readlines` method of file-like "
"objects):"
msgstr ""

msgid "Next we instantiate a Differ object:"
msgstr ""

msgid ""
"Note that when instantiating a :class:`Differ` object we may pass functions "
"to filter out line and character \"junk.\"  See the :meth:`Differ` "
"constructor for details."
msgstr ""

msgid "Finally, we compare the two:"
msgstr ""

msgid "``result`` is a list of strings, so let's pretty-print it:"
msgstr ""

msgid "As a single multi-line string it looks like this:"
msgstr ""

msgid "A command-line interface to difflib"
msgstr ""

msgid ""
"This example shows how to use difflib to create a ``diff``-like utility."
msgstr ""

msgid ""
"\"\"\" Command-line interface to difflib.py providing diffs in four "
"formats:\n"
"\n"
"* ndiff:    lists every line and highlights interline changes.\n"
"* context:  highlights clusters of changes in a before/after format.\n"
"* unified:  highlights clusters of changes in an inline format.\n"
"* html:     generates side by side comparison with change highlights.\n"
"\n"
"\"\"\"\n"
"\n"
"import sys, os, difflib, argparse\n"
"import datetime as dt\n"
"\n"
"def file_mtime(path):\n"
"    t = dt.datetime.fromtimestamp(os.stat(path).st_mtime,\n"
"                                  dt.timezone.utc)\n"
"    return t.astimezone().isoformat()\n"
"\n"
"def main():\n"
"\n"
"    parser = argparse.ArgumentParser()\n"
"    parser.add_argument('-c', action='store_true', default=False,\n"
"                        help='Produce a context format diff (default)')\n"
"    parser.add_argument('-u', action='store_true', default=False,\n"
"                        help='Produce a unified format diff')\n"
"    parser.add_argument('-m', action='store_true', default=False,\n"
"                        help='Produce HTML side by side diff '\n"
"                             '(can use -c and -l in conjunction)')\n"
"    parser.add_argument('-n', action='store_true', default=False,\n"
"                        help='Produce a ndiff format diff')\n"
"    parser.add_argument('-l', '--lines', type=int, default=3,\n"
"                        help='Set number of context lines (default 3)')\n"
"    parser.add_argument('fromfile')\n"
"    parser.add_argument('tofile')\n"
"    options = parser.parse_args()\n"
"\n"
"    n = options.lines\n"
"    fromfile = options.fromfile\n"
"    tofile = options.tofile\n"
"\n"
"    fromdate = file_mtime(fromfile)\n"
"    todate = file_mtime(tofile)\n"
"    with open(fromfile) as ff:\n"
"        fromlines = ff.readlines()\n"
"    with open(tofile) as tf:\n"
"        tolines = tf.readlines()\n"
"\n"
"    if options.u:\n"
"        diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, "
"fromdate, todate, n=n)\n"
"    elif options.n:\n"
"        diff = difflib.ndiff(fromlines, tolines)\n"
"    elif options.m:\n"
"        diff = difflib.HtmlDiff().make_file(fromlines,tolines,fromfile,"
"tofile,context=options.c,numlines=n)\n"
"    else:\n"
"        diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, "
"fromdate, todate, n=n)\n"
"\n"
"    sys.stdout.writelines(diff)\n"
"\n"
"if __name__ == '__main__':\n"
"    main()\n"
msgstr ""

msgid "ndiff example"
msgstr ""

msgid "This example shows how to use :func:`difflib.ndiff`."
msgstr ""

msgid ""
"\"\"\"ndiff [-q] file1 file2\n"
"    or\n"
"ndiff (-r1 | -r2) < ndiff_output > file1_or_file2\n"
"\n"
"Print a human-friendly file difference report to stdout.  Both inter-\n"
"and intra-line differences are noted.  In the second form, recreate file1\n"
"(-r1) or file2 (-r2) on stdout, from an ndiff report on stdin.\n"
"\n"
"In the first form, if -q (\"quiet\") is not specified, the first two lines\n"
"of output are\n"
"\n"
"-: file1\n"
"+: file2\n"
"\n"
"Each remaining line begins with a two-letter code:\n"
"\n"
"    \"- \"    line unique to file1\n"
"    \"+ \"    line unique to file2\n"
"    \"  \"    line common to both files\n"
"    \"? \"    line not present in either input file\n"
"\n"
"Lines beginning with \"? \" attempt to guide the eye to intraline\n"
"differences, and were not present in either input file.  These lines can be\n"
"confusing if the source files contain tab characters.\n"
"\n"
"The first file can be recovered by retaining only lines that begin with\n"
"\"  \" or \"- \", and deleting those 2-character prefixes; use ndiff with -"
"r1.\n"
"\n"
"The second file can be recovered similarly, but by retaining only \"  \" "
"and\n"
"\"+ \" lines; use ndiff with -r2; or, on Unix, the second file can be\n"
"recovered by piping the output through\n"
"\n"
"    sed -n '/^[+ ] /s/^..//p'\n"
"\"\"\"\n"
"\n"
"__version__ = 1, 7, 0\n"
"\n"
"import difflib, sys\n"
"\n"
"def fail(msg):\n"
"    out = sys.stderr.write\n"
"    out(msg + \"\\n\\n\")\n"
"    out(__doc__)\n"
"    return 0\n"
"\n"
"# open a file & return the file object; gripe and return 0 if it\n"
"# couldn't be opened\n"
"def fopen(fname):\n"
"    try:\n"
"        return open(fname)\n"
"    except IOError as detail:\n"
"        return fail(\"couldn't open \" + fname + \": \" + str(detail))\n"
"\n"
"# open two files & spray the diff to stdout; return false iff a problem\n"
"def fcompare(f1name, f2name):\n"
"    f1 = fopen(f1name)\n"
"    f2 = fopen(f2name)\n"
"    if not f1 or not f2:\n"
"        return 0\n"
"\n"
"    a = f1.readlines(); f1.close()\n"
"    b = f2.readlines(); f2.close()\n"
"    for line in difflib.ndiff(a, b):\n"
"        print(line, end=' ')\n"
"\n"
"    return 1\n"
"\n"
"# crack args (sys.argv[1:] is normal) & compare;\n"
"# return false iff a problem\n"
"\n"
"def main(args):\n"
"    import getopt\n"
"    try:\n"
"        opts, args = getopt.getopt(args, \"qr:\")\n"
"    except getopt.error as detail:\n"
"        return fail(str(detail))\n"
"    noisy = 1\n"
"    qseen = rseen = 0\n"
"    for opt, val in opts:\n"
"        if opt == \"-q\":\n"
"            qseen = 1\n"
"            noisy = 0\n"
"        elif opt == \"-r\":\n"
"            rseen = 1\n"
"            whichfile = val\n"
"    if qseen and rseen:\n"
"        return fail(\"can't specify both -q and -r\")\n"
"    if rseen:\n"
"        if args:\n"
"            return fail(\"no args allowed with -r option\")\n"
"        if whichfile in (\"1\", \"2\"):\n"
"            restore(whichfile)\n"
"            return 1\n"
"        return fail(\"-r value must be 1 or 2\")\n"
"    if len(args) != 2:\n"
"        return fail(\"need 2 filename args\")\n"
"    f1name, f2name = args\n"
"    if noisy:\n"
"        print('-:', f1name)\n"
"        print('+:', f2name)\n"
"    return fcompare(f1name, f2name)\n"
"\n"
"# read ndiff output from stdin, and print file1 (which=='1') or\n"
"# file2 (which=='2') to stdout\n"
"\n"
"def restore(which):\n"
"    restored = difflib.restore(sys.stdin.readlines(), which)\n"
"    sys.stdout.writelines(restored)\n"
"\n"
"if __name__ == '__main__':\n"
"    main(sys.argv[1:])\n"
msgstr ""

Web Proxy Viewer  |  New URL  |  Original Page