From 9ac6f3a2d512c7f9151fac1a68ef8c0c18d5aa30 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 5 Sep 2022 09:07:45 +0000 Subject: [PATCH 1/6] sync with cpython e13f49a0 --- library/logging.config.po | 82 +++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 34 deletions(-) diff --git a/library/logging.config.po b/library/logging.config.po index 6637496db4..2bf4214f62 100644 --- a/library/logging.config.po +++ b/library/logging.config.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-01-07 00:10+0000\n" +"POT-Creation-Date: 2022-09-05 09:06+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -666,11 +666,25 @@ msgid "" "corresponding value is a callable." msgstr "" -#: ../../library/logging.config.rst:531 +#: ../../library/logging.config.rst:527 +msgid "" +"You can also specify a special key ``'.'`` whose value is a dictionary is a " +"mapping of attribute names to values. If found, the specified attributes " +"will be set on the user-defined object before it is returned. Thus, with the " +"following configuration::" +msgstr "" + +#: ../../library/logging.config.rst:543 +msgid "" +"the returned formatter will have attribute ``foo`` set to ``'bar'`` and " +"attribute ``baz`` set to ``'bozz'``." +msgstr "" + +#: ../../library/logging.config.rst:550 msgid "Access to external objects" msgstr "" -#: ../../library/logging.config.rst:533 +#: ../../library/logging.config.rst:552 msgid "" "There are times where a configuration needs to refer to objects external to " "the configuration, for example ``sys.stderr``. If the configuration dict is " @@ -685,7 +699,7 @@ msgid "" "import mechanisms." msgstr "" -#: ../../library/logging.config.rst:546 +#: ../../library/logging.config.rst:565 msgid "" "The handling of such prefixes is done in a way analogous to protocol " "handling: there is a generic mechanism to look for prefixes which match the " @@ -695,11 +709,11 @@ msgid "" "prefix is not recognised, then the string value will be left as-is." msgstr "" -#: ../../library/logging.config.rst:558 +#: ../../library/logging.config.rst:577 msgid "Access to internal objects" msgstr "" -#: ../../library/logging.config.rst:560 +#: ../../library/logging.config.rst:579 msgid "" "As well as external objects, there is sometimes also a need to refer to " "objects in the configuration. This will be done implicitly by the " @@ -710,7 +724,7 @@ msgid "" "and resolve to the appropriate destination object." msgstr "" -#: ../../library/logging.config.rst:568 +#: ../../library/logging.config.rst:587 msgid "" "However, a more generic mechanism is needed for user-defined objects which " "are not known to the :mod:`logging` module. For example, consider :class:" @@ -724,7 +738,7 @@ msgid "" "resolution system allows the user to specify:" msgstr "" -#: ../../library/logging.config.rst:590 +#: ../../library/logging.config.rst:609 msgid "" "The literal string ``'cfg://handlers.file'`` will be resolved in an " "analogous way to strings with the ``ext://`` prefix, but looking in the " @@ -733,7 +747,7 @@ msgid "" "format``. Thus, given the following snippet:" msgstr "" -#: ../../library/logging.config.rst:608 +#: ../../library/logging.config.rst:627 msgid "" "in the configuration, the string ``'cfg://handlers'`` would resolve to the " "dict with key ``handlers``, the string ``'cfg://handlers.email`` would " @@ -749,7 +763,7 @@ msgid "" "to the string value if needed." msgstr "" -#: ../../library/logging.config.rst:622 +#: ../../library/logging.config.rst:641 msgid "" "Given a string ``cfg://handlers.myhandler.mykey.123``, this will resolve to " "``config_dict['handlers']['myhandler']['mykey']['123']``. If the string is " @@ -759,11 +773,11 @@ msgid "" "['mykey']['123']`` if that fails." msgstr "" -#: ../../library/logging.config.rst:634 +#: ../../library/logging.config.rst:653 msgid "Import resolution and custom importers" msgstr "" -#: ../../library/logging.config.rst:636 +#: ../../library/logging.config.rst:655 msgid "" "Import resolution, by default, uses the builtin :func:`__import__` function " "to do its importing. You may want to replace this with your own importing " @@ -775,17 +789,17 @@ msgid "" "instance level, you need to wrap it with :func:`staticmethod`. For example::" msgstr "" -#: ../../library/logging.config.rst:651 +#: ../../library/logging.config.rst:670 msgid "" "You don't need to wrap with :func:`staticmethod` if you're setting the " "import callable on a configurator *instance*." msgstr "" -#: ../../library/logging.config.rst:658 +#: ../../library/logging.config.rst:677 msgid "Configuration file format" msgstr "" -#: ../../library/logging.config.rst:660 +#: ../../library/logging.config.rst:679 msgid "" "The configuration file format understood by :func:`fileConfig` is based on :" "mod:`configparser` functionality. The file must contain sections called " @@ -802,7 +816,7 @@ msgid "" "specified in a section called ``[logger_root]``." msgstr "" -#: ../../library/logging.config.rst:675 +#: ../../library/logging.config.rst:694 msgid "" "The :func:`fileConfig` API is older than the :func:`dictConfig` API and does " "not provide functionality to cover certain aspects of logging. For example, " @@ -815,17 +829,17 @@ msgid "" "when it's convenient to do so." msgstr "" -#: ../../library/logging.config.rst:685 +#: ../../library/logging.config.rst:704 msgid "Examples of these sections in the file are given below." msgstr "" -#: ../../library/logging.config.rst:698 +#: ../../library/logging.config.rst:717 msgid "" "The root logger must specify a level and a list of handlers. An example of a " "root logger section is given below." msgstr "" -#: ../../library/logging.config.rst:707 +#: ../../library/logging.config.rst:726 msgid "" "The ``level`` entry can be one of ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` " "or ``NOTSET``. For the root logger only, ``NOTSET`` means that all messages " @@ -833,7 +847,7 @@ msgid "" "``logging`` package's namespace." msgstr "" -#: ../../library/logging.config.rst:712 +#: ../../library/logging.config.rst:731 msgid "" "The ``handlers`` entry is a comma-separated list of handler names, which " "must appear in the ``[handlers]`` section. These names must appear in the " @@ -841,13 +855,13 @@ msgid "" "file." msgstr "" -#: ../../library/logging.config.rst:717 +#: ../../library/logging.config.rst:736 msgid "" "For loggers other than the root logger, some additional information is " "required. This is illustrated by the following example." msgstr "" -#: ../../library/logging.config.rst:728 +#: ../../library/logging.config.rst:747 msgid "" "The ``level`` and ``handlers`` entries are interpreted as for the root " "logger, except that if a non-root logger's level is specified as ``NOTSET``, " @@ -860,20 +874,20 @@ msgid "" "application to get the logger." msgstr "" -#: ../../library/logging.config.rst:737 +#: ../../library/logging.config.rst:756 msgid "" "Sections which specify handler configuration are exemplified by the " "following." msgstr "" -#: ../../library/logging.config.rst:747 +#: ../../library/logging.config.rst:766 msgid "" "The ``class`` entry indicates the handler's class (as determined by :func:" "`eval` in the ``logging`` package's namespace). The ``level`` is interpreted " "as for loggers, and ``NOTSET`` is taken to mean 'log everything'." msgstr "" -#: ../../library/logging.config.rst:751 +#: ../../library/logging.config.rst:770 msgid "" "The ``formatter`` entry indicates the key name of the formatter for this " "handler. If blank, a default formatter (``logging._defaultFormatter``) is " @@ -881,7 +895,7 @@ msgid "" "and have a corresponding section in the configuration file." msgstr "" -#: ../../library/logging.config.rst:756 +#: ../../library/logging.config.rst:775 msgid "" "The ``args`` entry, when :func:`eval`\\ uated in the context of the " "``logging`` package's namespace, is the list of arguments to the constructor " @@ -890,26 +904,26 @@ msgid "" "provided, it defaults to ``()``." msgstr "" -#: ../../library/logging.config.rst:762 +#: ../../library/logging.config.rst:781 msgid "" "The optional ``kwargs`` entry, when :func:`eval`\\ uated in the context of " "the ``logging`` package's namespace, is the keyword argument dict to the " "constructor for the handler class. If not provided, it defaults to ``{}``." msgstr "" -#: ../../library/logging.config.rst:819 +#: ../../library/logging.config.rst:838 msgid "" "Sections which specify formatter configuration are typified by the following." msgstr "" -#: ../../library/logging.config.rst:830 +#: ../../library/logging.config.rst:849 msgid "" "The arguments for the formatter configuration are the same as the keys in " "the dictionary schema :ref:`formatters section `." msgstr "" -#: ../../library/logging.config.rst:836 +#: ../../library/logging.config.rst:855 msgid "" "Due to the use of :func:`eval` as described above, there are potential " "security risks which result from using the :func:`listen` to send and " @@ -918,18 +932,18 @@ msgid "" "`listen` documentation for more information." msgstr "" -#: ../../library/logging.config.rst:845 +#: ../../library/logging.config.rst:864 msgid "Module :mod:`logging`" msgstr ":mod:`logging` 模組" -#: ../../library/logging.config.rst:845 +#: ../../library/logging.config.rst:864 msgid "API reference for the logging module." msgstr "" -#: ../../library/logging.config.rst:847 +#: ../../library/logging.config.rst:866 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` 模組" -#: ../../library/logging.config.rst:848 +#: ../../library/logging.config.rst:867 msgid "Useful handlers included with the logging module." msgstr "" From c9409c05b4194b3e22c7309bf072e5a8bffaaad3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 Sep 2022 00:22:41 +0000 Subject: [PATCH 2/6] sync with cpython e5611617 --- library/traceback.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/traceback.po b/library/traceback.po index 92339ef833..83dbaf5e5f 100644 --- a/library/traceback.po +++ b/library/traceback.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-10-26 16:47+0000\n" +"POT-Creation-Date: 2022-09-08 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:13+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -432,16 +432,16 @@ msgid "" "the exception and traceback:" msgstr "" -#: ../../library/traceback.rst:435 +#: ../../library/traceback.rst:431 msgid "The output for the example would look similar to this:" msgstr "" -#: ../../library/traceback.rst:477 +#: ../../library/traceback.rst:473 msgid "" "The following example shows the different ways to print and format the " "stack::" msgstr "" -#: ../../library/traceback.rst:503 +#: ../../library/traceback.rst:499 msgid "This last example demonstrates the final few formatting functions:" msgstr "" From b3664ca179f3ffd774874cebc86ed9087e2b42a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 9 Sep 2022 00:22:00 +0000 Subject: [PATCH 3/6] sync with cpython f60bbf0a --- library/logging.po | 446 ++++++++++++++++++++++++--------------------- 1 file changed, 239 insertions(+), 207 deletions(-) diff --git a/library/logging.po b/library/logging.po index adae02fdd5..87d4a5179a 100644 --- a/library/logging.po +++ b/library/logging.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-08-03 00:18+0000\n" +"POT-Creation-Date: 2022-09-09 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:05+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -268,7 +268,7 @@ msgid "" "information." msgstr "" -#: ../../library/logging.rst:189 ../../library/logging.rst:1021 +#: ../../library/logging.rst:189 ../../library/logging.rst:1050 msgid "" "The second optional keyword argument is *stack_info*, which defaults to " "``False``. If true, stack information is added to the logging message, " @@ -280,14 +280,14 @@ msgid "" "handlers." msgstr "" -#: ../../library/logging.rst:198 ../../library/logging.rst:1030 +#: ../../library/logging.rst:198 ../../library/logging.rst:1059 msgid "" "You can specify *stack_info* independently of *exc_info*, e.g. to just show " "how you got to a certain point in your code, even when no exceptions were " "raised. The stack frames are printed following a header line which says:" msgstr "" -#: ../../library/logging.rst:206 ../../library/logging.rst:1038 +#: ../../library/logging.rst:206 ../../library/logging.rst:1067 msgid "" "This mimics the ``Traceback (most recent call last):`` which is used when " "displaying exception frames." @@ -336,7 +336,7 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:246 ../../library/logging.rst:1069 +#: ../../library/logging.rst:246 ../../library/logging.rst:1098 msgid "" "While this might be annoying, this feature is intended for use in " "specialized circumstances, such as multi-threaded servers where the same " @@ -354,7 +354,7 @@ msgid "" "will be sent to the handler set on :attr:`lastResort`." msgstr "" -#: ../../library/logging.rst:257 ../../library/logging.rst:1080 +#: ../../library/logging.rst:257 ../../library/logging.rst:1109 msgid "The *stack_info* parameter was added." msgstr "新增 *stack_info* 參數。" @@ -823,11 +823,43 @@ msgid "" "This default implementation just returns the input value." msgstr "" -#: ../../library/logging.rst:658 +#: ../../library/logging.rst:657 +msgid "" +"A base formatter class suitable for subclassing when you want to format a " +"number of records. You can pass a :class:`Formatter` instance which you want " +"to use to format each line (that corresponds to a single record). If not " +"specified, the default formatter (which just outputs the event message) is " +"used as the line formatter." +msgstr "" + +#: ../../library/logging.rst:665 +msgid "" +"Return a header for a list of *records*. The base implementation just " +"returns the empty string. You will need to override this method if you want " +"specific behaviour, e.g. to show the count of records, a title or a " +"separator line." +msgstr "" + +#: ../../library/logging.rst:672 +msgid "" +"Return a footer for a list of *records*. The base implementation just " +"returns the empty string. You will need to override this method if you want " +"specific behaviour, e.g. to show the count of records or a separator line." +msgstr "" + +#: ../../library/logging.rst:679 +msgid "" +"Return formatted text for a list of *records*. The base implementation just " +"returns the empty string if there are no records; otherwise, it returns the " +"concatenation of the header, each record formatted with the line formatter, " +"and the footer." +msgstr "" + +#: ../../library/logging.rst:687 msgid "Filter Objects" msgstr "" -#: ../../library/logging.rst:660 +#: ../../library/logging.rst:689 msgid "" "``Filters`` can be used by ``Handlers`` and ``Loggers`` for more " "sophisticated filtering than is provided by levels. The base filter class " @@ -837,7 +869,7 @@ msgid "" "If initialized with the empty string, all events are passed." msgstr "" -#: ../../library/logging.rst:670 +#: ../../library/logging.rst:699 msgid "" "Returns an instance of the :class:`Filter` class. If *name* is specified, it " "names a logger which, together with its children, will have its events " @@ -845,13 +877,13 @@ msgid "" "event." msgstr "" -#: ../../library/logging.rst:677 +#: ../../library/logging.rst:706 msgid "" "Is the specified record to be logged? Returns zero for no, nonzero for yes. " "If deemed appropriate, the record may be modified in-place by this method." msgstr "" -#: ../../library/logging.rst:681 +#: ../../library/logging.rst:710 msgid "" "Note that filters attached to handlers are consulted before an event is " "emitted by the handler, whereas filters attached to loggers are consulted " @@ -861,13 +893,13 @@ msgid "" "setting, unless the filter has also been applied to those descendant loggers." msgstr "" -#: ../../library/logging.rst:688 +#: ../../library/logging.rst:717 msgid "" "You don't actually need to subclass ``Filter``: you can pass any instance " "which has a ``filter`` method with the same semantics." msgstr "" -#: ../../library/logging.rst:691 +#: ../../library/logging.rst:720 msgid "" "You don't need to create specialized ``Filter`` classes, or use other " "classes with a ``filter`` method: you can use a function (or other callable) " @@ -878,7 +910,7 @@ msgid "" "value should conform to that returned by :meth:`~Filter.filter`." msgstr "" -#: ../../library/logging.rst:701 +#: ../../library/logging.rst:730 msgid "" "Although filters are used primarily to filter records based on more " "sophisticated criteria than levels, they get to see every record which is " @@ -890,11 +922,11 @@ msgid "" "contextual information into logs (see :ref:`filters-contextual`)." msgstr "" -#: ../../library/logging.rst:714 +#: ../../library/logging.rst:743 msgid "LogRecord Objects" msgstr "LogRecord 物件" -#: ../../library/logging.rst:716 +#: ../../library/logging.rst:745 msgid "" ":class:`LogRecord` instances are created automatically by the :class:" "`Logger` every time something is logged, and can be created manually via :" @@ -902,11 +934,11 @@ msgid "" "wire)." msgstr "" -#: ../../library/logging.rst:724 +#: ../../library/logging.rst:753 msgid "Contains all the information pertinent to the event being logged." msgstr "" -#: ../../library/logging.rst:726 +#: ../../library/logging.rst:755 msgid "" "The primary information is passed in *msg* and *args*, which are combined " "using ``msg % args`` to create the :attr:`!message` attribute of the record." @@ -916,7 +948,7 @@ msgstr "" msgid "Parameters" msgstr "" -#: ../../library/logging.rst:730 +#: ../../library/logging.rst:759 msgid "" "The name of the logger used to log the event represented by this :class:`!" "LogRecord`. Note that the logger name in the :class:`!LogRecord` will always " @@ -924,7 +956,7 @@ msgid "" "different (ancestor) logger." msgstr "" -#: ../../library/logging.rst:738 +#: ../../library/logging.rst:767 msgid "" "The :ref:`numeric level ` of the logging event (such as ``10`` for " "``DEBUG``, ``20`` for ``INFO``, etc). Note that this is converted to *two* " @@ -932,45 +964,45 @@ msgid "" "attr:`!levelname` for the corresponding level name." msgstr "" -#: ../../library/logging.rst:745 +#: ../../library/logging.rst:774 msgid "" "The full string path of the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:749 +#: ../../library/logging.rst:778 msgid "The line number in the source file where the logging call was made." msgstr "" -#: ../../library/logging.rst:753 +#: ../../library/logging.rst:782 msgid "" "The event description message, which can be a %-format string with " "placeholders for variable data." msgstr "" -#: ../../library/logging.rst:757 +#: ../../library/logging.rst:786 msgid "" "Variable data to merge into the *msg* argument to obtain the event " "description." msgstr "" -#: ../../library/logging.rst:761 +#: ../../library/logging.rst:790 msgid "" "An exception tuple with the current exception information, as returned by :" "func:`sys.exc_info`, or ``None`` if no exception information is available." msgstr "" -#: ../../library/logging.rst:766 +#: ../../library/logging.rst:795 msgid "" "The name of the function or method from which the logging call was invoked." msgstr "" -#: ../../library/logging.rst:770 +#: ../../library/logging.rst:799 msgid "" "A text string representing stack information from the base of the stack in " "the current thread, up to the logging call." msgstr "" -#: ../../library/logging.rst:777 +#: ../../library/logging.rst:806 msgid "" "Returns the message for this :class:`LogRecord` instance after merging any " "user-supplied arguments with the message. If the user-supplied message " @@ -979,7 +1011,7 @@ msgid "" "whose ``__str__`` method can return the actual format string to be used." msgstr "" -#: ../../library/logging.rst:784 +#: ../../library/logging.rst:813 msgid "" "The creation of a :class:`LogRecord` has been made more configurable by " "providing a factory which is used to create the record. The factory can be " @@ -987,24 +1019,24 @@ msgid "" "this for the factory's signature)." msgstr "" -#: ../../library/logging.rst:790 +#: ../../library/logging.rst:819 msgid "" "This functionality can be used to inject your own values into a :class:" "`LogRecord` at creation time. You can use the following pattern::" msgstr "" -#: ../../library/logging.rst:802 +#: ../../library/logging.rst:831 msgid "" "With this pattern, multiple factories could be chained, and as long as they " "don't overwrite each other's attributes or unintentionally overwrite the " "standard attributes listed above, there should be no surprises." msgstr "" -#: ../../library/logging.rst:811 +#: ../../library/logging.rst:840 msgid "LogRecord attributes" msgstr "" -#: ../../library/logging.rst:813 +#: ../../library/logging.rst:842 msgid "" "The LogRecord has a number of attributes, most of which are derived from the " "parameters to the constructor. (Note that the names do not always correspond " @@ -1015,7 +1047,7 @@ msgid "" "style format string." msgstr "" -#: ../../library/logging.rst:821 +#: ../../library/logging.rst:850 msgid "" "If you are using {}-formatting (:func:`str.format`), you can use ``{attrname}" "`` as the placeholder in the format string. If you are using $-formatting (:" @@ -1023,7 +1055,7 @@ msgid "" "course, replace ``attrname`` with the actual attribute name you want to use." msgstr "" -#: ../../library/logging.rst:827 +#: ../../library/logging.rst:856 msgid "" "In the case of {}-formatting, you can specify formatting flags by placing " "them after the attribute name, separated from it with a colon. For example: " @@ -1032,308 +1064,308 @@ msgid "" "on the options available to you." msgstr "" -#: ../../library/logging.rst:834 +#: ../../library/logging.rst:863 msgid "Attribute name" msgstr "" -#: ../../library/logging.rst:834 ../../library/logging.rst:1217 +#: ../../library/logging.rst:863 ../../library/logging.rst:1246 msgid "Format" msgstr "格式" -#: ../../library/logging.rst:834 ../../library/logging.rst:1217 +#: ../../library/logging.rst:863 ../../library/logging.rst:1246 msgid "Description" msgstr "描述" -#: ../../library/logging.rst:0 ../../library/logging.rst:836 +#: ../../library/logging.rst:0 ../../library/logging.rst:865 msgid "args" msgstr "" -#: ../../library/logging.rst:836 ../../library/logging.rst:850 -#: ../../library/logging.rst:878 ../../library/logging.rst:896 +#: ../../library/logging.rst:865 ../../library/logging.rst:879 +#: ../../library/logging.rst:907 ../../library/logging.rst:925 msgid "You shouldn't need to format this yourself." msgstr "" -#: ../../library/logging.rst:836 +#: ../../library/logging.rst:865 msgid "" "The tuple of arguments merged into ``msg`` to produce ``message``, or a dict " "whose values are used for the merge (when there is only one argument, and it " "is a dictionary)." msgstr "" -#: ../../library/logging.rst:841 +#: ../../library/logging.rst:870 msgid "asctime" msgstr "" -#: ../../library/logging.rst:841 +#: ../../library/logging.rst:870 msgid "``%(asctime)s``" msgstr "``%(asctime)s``" -#: ../../library/logging.rst:841 +#: ../../library/logging.rst:870 msgid "" "Human-readable time when the :class:`LogRecord` was created. By default " "this is of the form '2003-07-08 16:49:45,896' (the numbers after the comma " "are millisecond portion of the time)." msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:876 msgid "created" msgstr "" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:876 msgid "``%(created)f``" msgstr "``%(created)f``" -#: ../../library/logging.rst:847 +#: ../../library/logging.rst:876 msgid "" "Time when the :class:`LogRecord` was created (as returned by :func:`time." "time`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:850 +#: ../../library/logging.rst:0 ../../library/logging.rst:879 msgid "exc_info" msgstr "exc_info" -#: ../../library/logging.rst:850 +#: ../../library/logging.rst:879 msgid "" "Exception tuple (à la ``sys.exc_info``) or, if no exception has occurred, " "``None``." msgstr "" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:882 msgid "filename" msgstr "" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:882 msgid "``%(filename)s``" msgstr "``%(filename)s``" -#: ../../library/logging.rst:853 +#: ../../library/logging.rst:882 msgid "Filename portion of ``pathname``." msgstr "" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:884 msgid "funcName" msgstr "" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:884 msgid "``%(funcName)s``" msgstr "``%(funcName)s``" -#: ../../library/logging.rst:855 +#: ../../library/logging.rst:884 msgid "Name of function containing the logging call." msgstr "" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:886 msgid "levelname" msgstr "" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:886 msgid "``%(levelname)s``" msgstr "``%(levelname)s``" -#: ../../library/logging.rst:857 +#: ../../library/logging.rst:886 msgid "" "Text logging level for the message (``'DEBUG'``, ``'INFO'``, ``'WARNING'``, " "``'ERROR'``, ``'CRITICAL'``)." msgstr "" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:890 msgid "levelno" msgstr "" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:890 msgid "``%(levelno)s``" msgstr "``%(levelno)s``" -#: ../../library/logging.rst:861 +#: ../../library/logging.rst:890 msgid "" "Numeric logging level for the message (:const:`DEBUG`, :const:`INFO`, :const:" "`WARNING`, :const:`ERROR`, :const:`CRITICAL`)." msgstr "" -#: ../../library/logging.rst:866 +#: ../../library/logging.rst:895 msgid "lineno" msgstr "" -#: ../../library/logging.rst:866 +#: ../../library/logging.rst:895 msgid "``%(lineno)d``" msgstr "``%(lineno)d``" -#: ../../library/logging.rst:866 +#: ../../library/logging.rst:895 msgid "Source line number where the logging call was issued (if available)." msgstr "" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:898 msgid "message" msgstr "" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:898 msgid "``%(message)s``" msgstr "``%(message)s``" -#: ../../library/logging.rst:869 +#: ../../library/logging.rst:898 msgid "" "The logged message, computed as ``msg % args``. This is set when :meth:" "`Formatter.format` is invoked." msgstr "" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:902 msgid "module" msgstr "模組" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:902 msgid "``%(module)s``" msgstr "``%(module)s``" -#: ../../library/logging.rst:873 +#: ../../library/logging.rst:902 msgid "Module (name portion of ``filename``)." msgstr "" -#: ../../library/logging.rst:875 +#: ../../library/logging.rst:904 msgid "msecs" msgstr "" -#: ../../library/logging.rst:875 +#: ../../library/logging.rst:904 msgid "``%(msecs)d``" msgstr "``%(msecs)d``" -#: ../../library/logging.rst:875 +#: ../../library/logging.rst:904 msgid "" "Millisecond portion of the time when the :class:`LogRecord` was created." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:878 +#: ../../library/logging.rst:0 ../../library/logging.rst:907 msgid "msg" msgstr "" -#: ../../library/logging.rst:878 +#: ../../library/logging.rst:907 msgid "" "The format string passed in the original logging call. Merged with ``args`` " "to produce ``message``, or an arbitrary object (see :ref:`arbitrary-object-" "messages`)." msgstr "" -#: ../../library/logging.rst:0 ../../library/logging.rst:883 +#: ../../library/logging.rst:0 ../../library/logging.rst:912 msgid "name" msgstr "" -#: ../../library/logging.rst:883 +#: ../../library/logging.rst:912 msgid "``%(name)s``" msgstr "``%(name)s``" -#: ../../library/logging.rst:883 +#: ../../library/logging.rst:912 msgid "Name of the logger used to log the call." msgstr "" -#: ../../library/logging.rst:885 +#: ../../library/logging.rst:914 msgid "pathname" msgstr "" -#: ../../library/logging.rst:885 +#: ../../library/logging.rst:914 msgid "``%(pathname)s``" msgstr "``%(pathname)s``" -#: ../../library/logging.rst:885 +#: ../../library/logging.rst:914 msgid "" "Full pathname of the source file where the logging call was issued (if " "available)." msgstr "" -#: ../../library/logging.rst:888 +#: ../../library/logging.rst:917 msgid "process" msgstr "" -#: ../../library/logging.rst:888 +#: ../../library/logging.rst:917 msgid "``%(process)d``" msgstr "``%(process)d``" -#: ../../library/logging.rst:888 +#: ../../library/logging.rst:917 msgid "Process ID (if available)." msgstr "" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:919 msgid "processName" msgstr "" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:919 msgid "``%(processName)s``" msgstr "``%(processName)s``" -#: ../../library/logging.rst:890 +#: ../../library/logging.rst:919 msgid "Process name (if available)." msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:921 msgid "relativeCreated" msgstr "" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:921 msgid "``%(relativeCreated)d``" msgstr "``%(relativeCreated)d``" -#: ../../library/logging.rst:892 +#: ../../library/logging.rst:921 msgid "" "Time in milliseconds when the LogRecord was created, relative to the time " "the logging module was loaded." msgstr "" -#: ../../library/logging.rst:896 +#: ../../library/logging.rst:925 msgid "stack_info" msgstr "stack_info" -#: ../../library/logging.rst:896 +#: ../../library/logging.rst:925 msgid "" "Stack frame information (where available) from the bottom of the stack in " "the current thread, up to and including the stack frame of the logging call " "which resulted in the creation of this record." msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:931 msgid "thread" msgstr "" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:931 msgid "``%(thread)d``" msgstr "``%(thread)d``" -#: ../../library/logging.rst:902 +#: ../../library/logging.rst:931 msgid "Thread ID (if available)." msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:933 msgid "threadName" msgstr "" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:933 msgid "``%(threadName)s``" msgstr "``%(threadName)s``" -#: ../../library/logging.rst:904 +#: ../../library/logging.rst:933 msgid "Thread name (if available)." msgstr "" -#: ../../library/logging.rst:907 +#: ../../library/logging.rst:936 msgid "*processName* was added." msgstr "新增 *processName*\\ 。" -#: ../../library/logging.rst:914 +#: ../../library/logging.rst:943 msgid "LoggerAdapter Objects" msgstr "LoggerAdapter 物件" -#: ../../library/logging.rst:916 +#: ../../library/logging.rst:945 msgid "" ":class:`LoggerAdapter` instances are used to conveniently pass contextual " "information into logging calls. For a usage example, see the section on :ref:" "`adding contextual information to your logging output `." msgstr "" -#: ../../library/logging.rst:922 +#: ../../library/logging.rst:951 msgid "" "Returns an instance of :class:`LoggerAdapter` initialized with an " "underlying :class:`Logger` instance and a dict-like object." msgstr "" -#: ../../library/logging.rst:927 +#: ../../library/logging.rst:956 msgid "" "Modifies the message and/or keyword arguments passed to a logging call in " "order to insert contextual information. This implementation takes the object " @@ -1342,7 +1374,7 @@ msgid "" "(possibly modified) versions of the arguments passed in." msgstr "" -#: ../../library/logging.rst:933 +#: ../../library/logging.rst:962 msgid "" "In addition to the above, :class:`LoggerAdapter` supports the following " "methods of :class:`Logger`: :meth:`~Logger.debug`, :meth:`~Logger.info`, :" @@ -1354,24 +1386,24 @@ msgid "" "interchangeably." msgstr "" -#: ../../library/logging.rst:942 +#: ../../library/logging.rst:971 msgid "" "The :meth:`~Logger.isEnabledFor`, :meth:`~Logger.getEffectiveLevel`, :meth:" "`~Logger.setLevel` and :meth:`~Logger.hasHandlers` methods were added to :" "class:`LoggerAdapter`. These methods delegate to the underlying logger." msgstr "" -#: ../../library/logging.rst:947 +#: ../../library/logging.rst:976 msgid "" "Attribute :attr:`manager` and method :meth:`_log` were added, which delegate " "to the underlying logger and allow adapters to be nested." msgstr "" -#: ../../library/logging.rst:953 +#: ../../library/logging.rst:982 msgid "Thread Safety" msgstr "" -#: ../../library/logging.rst:955 +#: ../../library/logging.rst:984 msgid "" "The logging module is intended to be thread-safe without any special work " "needing to be done by its clients. It achieves this though using threading " @@ -1380,7 +1412,7 @@ msgid "" "O." msgstr "" -#: ../../library/logging.rst:960 +#: ../../library/logging.rst:989 msgid "" "If you are implementing asynchronous signal handlers using the :mod:`signal` " "module, you may not be able to use logging from within such handlers. This " @@ -1388,17 +1420,17 @@ msgid "" "always re-entrant, and so cannot be invoked from such signal handlers." msgstr "" -#: ../../library/logging.rst:967 +#: ../../library/logging.rst:996 msgid "Module-Level Functions" msgstr "" -#: ../../library/logging.rst:969 +#: ../../library/logging.rst:998 msgid "" "In addition to the classes described above, there are a number of module-" "level functions." msgstr "" -#: ../../library/logging.rst:975 +#: ../../library/logging.rst:1004 msgid "" "Return a logger with the specified name or, if name is ``None``, return a " "logger which is the root logger of the hierarchy. If specified, the name is " @@ -1407,14 +1439,14 @@ msgid "" "logging." msgstr "" -#: ../../library/logging.rst:980 +#: ../../library/logging.rst:1009 msgid "" "All calls to this function with a given name return the same logger " "instance. This means that logger instances never need to be passed between " "different parts of an application." msgstr "" -#: ../../library/logging.rst:987 +#: ../../library/logging.rst:1016 msgid "" "Return either the standard :class:`Logger` class, or the last class passed " "to :func:`setLoggerClass`. This function may be called from within a new " @@ -1423,24 +1455,24 @@ msgid "" "example::" msgstr "" -#: ../../library/logging.rst:998 +#: ../../library/logging.rst:1027 msgid "Return a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1000 +#: ../../library/logging.rst:1029 msgid "" "This function has been provided, along with :func:`setLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1005 +#: ../../library/logging.rst:1034 msgid "" "See :func:`setLogRecordFactory` for more information about the how the " "factory is called." msgstr "" -#: ../../library/logging.rst:1010 +#: ../../library/logging.rst:1039 msgid "" "Logs a message with level :const:`DEBUG` on the root logger. The *msg* is " "the message format string, and the *args* are the arguments which are merged " @@ -1449,7 +1481,7 @@ msgid "" "argument.)" msgstr "" -#: ../../library/logging.rst:1015 +#: ../../library/logging.rst:1044 msgid "" "There are three keyword arguments in *kwargs* which are inspected: " "*exc_info* which, if it does not evaluate as false, causes exception " @@ -1459,7 +1491,7 @@ msgid "" "exception information." msgstr "" -#: ../../library/logging.rst:1041 +#: ../../library/logging.rst:1070 msgid "" "The third optional keyword argument is *extra* which can be used to pass a " "dictionary which is used to populate the __dict__ of the LogRecord created " @@ -1468,18 +1500,18 @@ msgid "" "logged messages. For example::" msgstr "" -#: ../../library/logging.rst:1052 +#: ../../library/logging.rst:1081 msgid "would print something like:" msgstr "" -#: ../../library/logging.rst:1058 +#: ../../library/logging.rst:1087 msgid "" "The keys in the dictionary passed in *extra* should not clash with the keys " "used by the logging system. (See the :class:`Formatter` documentation for " "more information on which keys are used by the logging system.)" msgstr "" -#: ../../library/logging.rst:1062 +#: ../../library/logging.rst:1091 msgid "" "If you choose to use these attributes in logged messages, you need to " "exercise some care. In the above example, for instance, the :class:" @@ -1490,58 +1522,58 @@ msgid "" "dictionary with these keys." msgstr "" -#: ../../library/logging.rst:1076 +#: ../../library/logging.rst:1105 msgid "" "This function (as well as :func:`info`, :func:`warning`, :func:`error` and :" "func:`critical`) will call :func:`basicConfig` if the root logger doesn't " "have any handler attached." msgstr "" -#: ../../library/logging.rst:1085 +#: ../../library/logging.rst:1114 msgid "" "Logs a message with level :const:`INFO` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1091 +#: ../../library/logging.rst:1120 msgid "" "Logs a message with level :const:`WARNING` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1094 +#: ../../library/logging.rst:1123 msgid "" "There is an obsolete function ``warn`` which is functionally identical to " "``warning``. As ``warn`` is deprecated, please do not use it - use " "``warning`` instead." msgstr "" -#: ../../library/logging.rst:1101 +#: ../../library/logging.rst:1130 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1107 +#: ../../library/logging.rst:1136 msgid "" "Logs a message with level :const:`CRITICAL` on the root logger. The " "arguments are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1113 +#: ../../library/logging.rst:1142 msgid "" "Logs a message with level :const:`ERROR` on the root logger. The arguments " "are interpreted as for :func:`debug`. Exception info is added to the logging " "message. This function should only be called from an exception handler." msgstr "" -#: ../../library/logging.rst:1119 +#: ../../library/logging.rst:1148 msgid "" "Logs a message with level *level* on the root logger. The other arguments " "are interpreted as for :func:`debug`." msgstr "" -#: ../../library/logging.rst:1124 +#: ../../library/logging.rst:1153 msgid "" "Provides an overriding level *level* for all loggers which takes precedence " "over the logger's own level. When the need arises to temporarily throttle " @@ -1555,7 +1587,7 @@ msgid "" "individual loggers." msgstr "" -#: ../../library/logging.rst:1135 +#: ../../library/logging.rst:1164 msgid "" "Note that if you have defined any custom logging level higher than " "``CRITICAL`` (this is not recommended), you won't be able to rely on the " @@ -1563,13 +1595,13 @@ msgid "" "a suitable value." msgstr "" -#: ../../library/logging.rst:1140 +#: ../../library/logging.rst:1169 msgid "" "The *level* parameter was defaulted to level ``CRITICAL``. See :issue:" "`28524` for more information about this change." msgstr "" -#: ../../library/logging.rst:1146 +#: ../../library/logging.rst:1175 msgid "" "Associates level *level* with text *levelName* in an internal dictionary, " "which is used to map numeric levels to a textual representation, for example " @@ -1579,17 +1611,17 @@ msgid "" "and they should increase in increasing order of severity." msgstr "" -#: ../../library/logging.rst:1153 +#: ../../library/logging.rst:1182 msgid "" "If you are thinking of defining your own levels, please see the section on :" "ref:`custom-levels`." msgstr "" -#: ../../library/logging.rst:1158 +#: ../../library/logging.rst:1187 msgid "Returns the textual or numeric representation of logging level *level*." msgstr "" -#: ../../library/logging.rst:1160 +#: ../../library/logging.rst:1189 msgid "" "If *level* is one of the predefined levels :const:`CRITICAL`, :const:" "`ERROR`, :const:`WARNING`, :const:`INFO` or :const:`DEBUG` then you get the " @@ -1599,20 +1631,20 @@ msgid "" "the corresponding string representation is returned." msgstr "" -#: ../../library/logging.rst:1167 +#: ../../library/logging.rst:1196 msgid "" "The *level* parameter also accepts a string representation of the level such " "as 'INFO'. In such cases, this functions returns the corresponding numeric " "value of the level." msgstr "" -#: ../../library/logging.rst:1171 +#: ../../library/logging.rst:1200 msgid "" "If no matching numeric or string value is passed in, the string 'Level %s' % " "level is returned." msgstr "" -#: ../../library/logging.rst:1174 +#: ../../library/logging.rst:1203 msgid "" "Levels are internally integers (as they need to be compared in the logging " "logic). This function is used to convert between an integer level and the " @@ -1621,7 +1653,7 @@ msgid "" "versa." msgstr "" -#: ../../library/logging.rst:1180 +#: ../../library/logging.rst:1209 msgid "" "In Python versions earlier than 3.4, this function could also be passed a " "text level, and would return the corresponding numeric value of the level. " @@ -1629,7 +1661,7 @@ msgid "" "Python 3.4, but reinstated in 3.4.2 due to retain backward compatibility." msgstr "" -#: ../../library/logging.rst:1188 +#: ../../library/logging.rst:1217 msgid "" "Creates and returns a new :class:`LogRecord` instance whose attributes are " "defined by *attrdict*. This function is useful for taking a pickled :class:" @@ -1637,7 +1669,7 @@ msgid "" "as a :class:`LogRecord` instance at the receiving end." msgstr "" -#: ../../library/logging.rst:1196 +#: ../../library/logging.rst:1225 msgid "" "Does basic configuration for the logging system by creating a :class:" "`StreamHandler` with a default :class:`Formatter` and adding it to the root " @@ -1646,13 +1678,13 @@ msgid "" "no handlers are defined for the root logger." msgstr "" -#: ../../library/logging.rst:1202 +#: ../../library/logging.rst:1231 msgid "" "This function does nothing if the root logger already has handlers " "configured, unless the keyword argument *force* is set to ``True``." msgstr "" -#: ../../library/logging.rst:1205 +#: ../../library/logging.rst:1234 msgid "" "This function should be called from the main thread before other threads are " "started. In versions of Python prior to 2.7.1 and 3.2, if this function is " @@ -1661,54 +1693,54 @@ msgid "" "unexpected results such as messages being duplicated in the log." msgstr "" -#: ../../library/logging.rst:1212 +#: ../../library/logging.rst:1241 msgid "The following keyword arguments are supported." msgstr "" -#: ../../library/logging.rst:1219 +#: ../../library/logging.rst:1248 msgid "*filename*" msgstr "*filename*" -#: ../../library/logging.rst:1219 +#: ../../library/logging.rst:1248 msgid "" "Specifies that a :class:`FileHandler` be created, using the specified " "filename, rather than a :class:`StreamHandler`." msgstr "" -#: ../../library/logging.rst:1223 +#: ../../library/logging.rst:1252 msgid "*filemode*" msgstr "*filemode*" -#: ../../library/logging.rst:1223 +#: ../../library/logging.rst:1252 msgid "" "If *filename* is specified, open the file in this :ref:`mode `. " "Defaults to ``'a'``." msgstr "" -#: ../../library/logging.rst:1227 +#: ../../library/logging.rst:1256 msgid "*format*" msgstr "*format*" -#: ../../library/logging.rst:1227 +#: ../../library/logging.rst:1256 msgid "" "Use the specified format string for the handler. Defaults to attributes " "``levelname``, ``name`` and ``message`` separated by colons." msgstr "" -#: ../../library/logging.rst:1232 +#: ../../library/logging.rst:1261 msgid "*datefmt*" msgstr "*datefmt*" -#: ../../library/logging.rst:1232 +#: ../../library/logging.rst:1261 msgid "" "Use the specified date/time format, as accepted by :func:`time.strftime`." msgstr "" -#: ../../library/logging.rst:1235 +#: ../../library/logging.rst:1264 msgid "*style*" msgstr "*style*" -#: ../../library/logging.rst:1235 +#: ../../library/logging.rst:1264 msgid "" "If *format* is specified, use this style for the format string. One of " "``'%'``, ``'{'`` or ``'$'`` for :ref:`printf-style `." msgstr "" -#: ../../library/logging.rst:1246 +#: ../../library/logging.rst:1275 msgid "*stream*" msgstr "*stream*" -#: ../../library/logging.rst:1246 +#: ../../library/logging.rst:1275 msgid "" "Use the specified stream to initialize the :class:`StreamHandler`. Note that " "this argument is incompatible with *filename* - if both are present, a " "``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1252 +#: ../../library/logging.rst:1281 msgid "*handlers*" msgstr "*handlers*" -#: ../../library/logging.rst:1252 +#: ../../library/logging.rst:1281 msgid "" "If specified, this should be an iterable of already created handlers to add " "to the root logger. Any handlers which don't already have a formatter set " @@ -1748,33 +1780,33 @@ msgid "" "present, a ``ValueError`` is raised." msgstr "" -#: ../../library/logging.rst:1261 +#: ../../library/logging.rst:1290 msgid "*force*" msgstr "*force*" -#: ../../library/logging.rst:1261 +#: ../../library/logging.rst:1290 msgid "" "If this keyword argument is specified as true, any existing handlers " "attached to the root logger are removed and closed, before carrying out the " "configuration as specified by the other arguments." msgstr "" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1296 msgid "*encoding*" msgstr "*encoding*" -#: ../../library/logging.rst:1267 +#: ../../library/logging.rst:1296 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " "the output file." msgstr "" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1301 msgid "*errors*" msgstr "*errors*" -#: ../../library/logging.rst:1272 +#: ../../library/logging.rst:1301 msgid "" "If this keyword argument is specified along with *filename*, its value is " "used when the :class:`FileHandler` is created, and thus used when opening " @@ -1783,39 +1815,39 @@ msgid "" "`open`, which means that it will be treated the same as passing 'errors'." msgstr "" -#: ../../library/logging.rst:1283 +#: ../../library/logging.rst:1312 msgid "The *style* argument was added." msgstr "新增 *style* 引數。" -#: ../../library/logging.rst:1286 +#: ../../library/logging.rst:1315 msgid "" "The *handlers* argument was added. Additional checks were added to catch " "situations where incompatible arguments are specified (e.g. *handlers* " "together with *stream* or *filename*, or *stream* together with *filename*)." msgstr "" -#: ../../library/logging.rst:1292 +#: ../../library/logging.rst:1321 msgid "The *force* argument was added." msgstr "新增 *force* 引數。" -#: ../../library/logging.rst:1295 +#: ../../library/logging.rst:1324 msgid "The *encoding* and *errors* arguments were added." msgstr "新增 *encoding* 與 *errors* 引數。" -#: ../../library/logging.rst:1300 +#: ../../library/logging.rst:1329 msgid "" "Informs the logging system to perform an orderly shutdown by flushing and " "closing all handlers. This should be called at application exit and no " "further use of the logging system should be made after this call." msgstr "" -#: ../../library/logging.rst:1304 +#: ../../library/logging.rst:1333 msgid "" "When the logging module is imported, it registers this function as an exit " "handler (see :mod:`atexit`), so normally there's no need to do that manually." msgstr "" -#: ../../library/logging.rst:1311 +#: ../../library/logging.rst:1340 msgid "" "Tells the logging system to use the class *klass* when instantiating a " "logger. The class should define :meth:`__init__` such that only a name " @@ -1827,32 +1859,32 @@ msgid "" "loggers." msgstr "" -#: ../../library/logging.rst:1322 +#: ../../library/logging.rst:1351 msgid "Set a callable which is used to create a :class:`LogRecord`." msgstr "" -#: ../../library/logging.rst:1324 +#: ../../library/logging.rst:1353 msgid "The factory callable to be used to instantiate a log record." msgstr "" -#: ../../library/logging.rst:1326 +#: ../../library/logging.rst:1355 msgid "" "This function has been provided, along with :func:`getLogRecordFactory`, to " "allow developers more control over how the :class:`LogRecord` representing a " "logging event is constructed." msgstr "" -#: ../../library/logging.rst:1331 +#: ../../library/logging.rst:1360 msgid "The factory has the following signature:" msgstr "" -#: ../../library/logging.rst:1333 +#: ../../library/logging.rst:1362 msgid "" "``factory(name, level, fn, lno, msg, args, exc_info, func=None, sinfo=None, " "**kwargs)``" msgstr "" -#: ../../library/logging.rst:1335 +#: ../../library/logging.rst:1364 msgid "The logger name." msgstr "" @@ -1860,7 +1892,7 @@ msgstr "" msgid "level" msgstr "" -#: ../../library/logging.rst:1336 +#: ../../library/logging.rst:1365 msgid "The logging level (numeric)." msgstr "" @@ -1868,7 +1900,7 @@ msgstr "" msgid "fn" msgstr "fn" -#: ../../library/logging.rst:1337 +#: ../../library/logging.rst:1366 msgid "The full pathname of the file where the logging call was made." msgstr "" @@ -1876,19 +1908,19 @@ msgstr "" msgid "lno" msgstr "lno" -#: ../../library/logging.rst:1338 +#: ../../library/logging.rst:1367 msgid "The line number in the file where the logging call was made." msgstr "" -#: ../../library/logging.rst:1339 +#: ../../library/logging.rst:1368 msgid "The logging message." msgstr "" -#: ../../library/logging.rst:1340 +#: ../../library/logging.rst:1369 msgid "The arguments for the logging message." msgstr "" -#: ../../library/logging.rst:1341 +#: ../../library/logging.rst:1370 msgid "An exception tuple, or ``None``." msgstr "" @@ -1896,7 +1928,7 @@ msgstr "" msgid "func" msgstr "func" -#: ../../library/logging.rst:1342 +#: ../../library/logging.rst:1371 msgid "The name of the function or method which invoked the logging call." msgstr "" @@ -1904,7 +1936,7 @@ msgstr "" msgid "sinfo" msgstr "sinfo" -#: ../../library/logging.rst:1344 +#: ../../library/logging.rst:1373 msgid "" "A stack traceback such as is provided by :func:`traceback.print_stack`, " "showing the call hierarchy." @@ -1914,15 +1946,15 @@ msgstr "" msgid "kwargs" msgstr "kwargs" -#: ../../library/logging.rst:1346 +#: ../../library/logging.rst:1375 msgid "Additional keyword arguments." msgstr "額外的關鍵字引數。" -#: ../../library/logging.rst:1350 +#: ../../library/logging.rst:1379 msgid "Module-Level Attributes" msgstr "" -#: ../../library/logging.rst:1354 +#: ../../library/logging.rst:1383 msgid "" "A \"handler of last resort\" is available through this attribute. This is a :" "class:`StreamHandler` writing to ``sys.stderr`` with a level of ``WARNING``, " @@ -1933,22 +1965,22 @@ msgid "" "reason, ``lastResort`` can be set to ``None``." msgstr "" -#: ../../library/logging.rst:1365 +#: ../../library/logging.rst:1394 msgid "Integration with the warnings module" msgstr "" -#: ../../library/logging.rst:1367 +#: ../../library/logging.rst:1396 msgid "" "The :func:`captureWarnings` function can be used to integrate :mod:`logging` " "with the :mod:`warnings` module." msgstr "" -#: ../../library/logging.rst:1372 +#: ../../library/logging.rst:1401 msgid "" "This function is used to turn the capture of warnings by logging on and off." msgstr "" -#: ../../library/logging.rst:1375 +#: ../../library/logging.rst:1404 msgid "" "If *capture* is ``True``, warnings issued by the :mod:`warnings` module will " "be redirected to the logging system. Specifically, a warning will be " @@ -1957,46 +1989,46 @@ msgid "" "`WARNING`." msgstr "" -#: ../../library/logging.rst:1380 +#: ../../library/logging.rst:1409 msgid "" "If *capture* is ``False``, the redirection of warnings to the logging system " "will stop, and warnings will be redirected to their original destinations (i." "e. those in effect before ``captureWarnings(True)`` was called)." msgstr "" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1417 msgid "Module :mod:`logging.config`" msgstr "" -#: ../../library/logging.rst:1388 +#: ../../library/logging.rst:1417 msgid "Configuration API for the logging module." msgstr "" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1420 msgid "Module :mod:`logging.handlers`" msgstr "" -#: ../../library/logging.rst:1391 +#: ../../library/logging.rst:1420 msgid "Useful handlers included with the logging module." msgstr "" -#: ../../library/logging.rst:1395 +#: ../../library/logging.rst:1424 msgid ":pep:`282` - A Logging System" msgstr "" -#: ../../library/logging.rst:1394 +#: ../../library/logging.rst:1423 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "" -#: ../../library/logging.rst:1400 +#: ../../library/logging.rst:1429 msgid "" "`Original Python logging package `_" msgstr "" -#: ../../library/logging.rst:1398 +#: ../../library/logging.rst:1427 msgid "" "This is the original source for the :mod:`logging` package. The version of " "the package available from this site is suitable for use with Python 1.5.2, " From ccf8f0942084373432808e9db763e4a662d7f4aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 11 Sep 2022 00:19:49 +0000 Subject: [PATCH 4/6] sync with cpython 9b710581 --- library/asyncio-future.po | 5 +- library/asyncio-task.po | 258 ++++++++++++++++++++------------------ 2 files changed, 136 insertions(+), 127 deletions(-) diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 43896a87a5..0f735844e1 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-02-19 00:13+0000\n" +"POT-Creation-Date: 2022-09-11 00:18+0000\n" "PO-Revision-Date: 2022-01-25 01:29+0800\n" "Last-Translator: Matt Wang \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -99,9 +99,10 @@ msgid "" msgstr "請見 :func:`create_task` 函式,它是建立新 Task 的推薦方法。" #: ../../library/asyncio-future.rst:57 +#, fuzzy msgid "" "Save a reference to the result of this function, to avoid a task " -"disappearing mid execution." +"disappearing mid-execution." msgstr "將參照 (reference) 儲存至此函式的結果,用以防止任務在執行中消失。" #: ../../library/asyncio-future.rst:60 diff --git a/library/asyncio-task.po b/library/asyncio-task.po index c201323876..e4047220ee 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-06-08 00:14+0000\n" +"POT-Creation-Date: 2022-09-11 00:18+0000\n" "PO-Revision-Date: 2018-05-23 14:39+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -213,7 +213,7 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:374 -#: ../../library/asyncio-task.rst:507 ../../library/asyncio-task.rst:643 +#: ../../library/asyncio-task.rst:516 ../../library/asyncio-task.rst:652 msgid "Example::" msgstr "" "範例:\n" @@ -255,13 +255,13 @@ msgstr "" #: ../../library/asyncio-task.rst:264 msgid "" "Save a reference to the result of this function, to avoid a task " -"disappearing mid execution. The event loop only keeps weak references to " -"tasks. A task that isn't referenced elsewhere may get garbage-collected at " +"disappearing mid-execution. The event loop only keeps weak references to " +"tasks. A task that isn't referenced elsewhere may get garbage collected at " "any time, even before it's done. For reliable \"fire-and-forget\" background " "tasks, gather them in a collection::" msgstr "" -#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:832 +#: ../../library/asyncio-task.rst:286 ../../library/asyncio-task.rst:841 msgid "Added the *name* parameter." msgstr "新增 *name* 參數。" @@ -304,10 +304,10 @@ msgid "" msgstr "" #: ../../library/asyncio-task.rst:333 ../../library/asyncio-task.rst:369 -#: ../../library/asyncio-task.rst:423 ../../library/asyncio-task.rst:468 -#: ../../library/asyncio-task.rst:502 ../../library/asyncio-task.rst:532 -#: ../../library/asyncio-task.rst:591 ../../library/asyncio-task.rst:626 -#: ../../library/asyncio-task.rst:640 ../../library/asyncio-task.rst:649 +#: ../../library/asyncio-task.rst:423 ../../library/asyncio-task.rst:477 +#: ../../library/asyncio-task.rst:511 ../../library/asyncio-task.rst:541 +#: ../../library/asyncio-task.rst:600 ../../library/asyncio-task.rst:635 +#: ../../library/asyncio-task.rst:649 ../../library/asyncio-task.rst:658 msgid "Removed the *loop* parameter." msgstr "移除 *loop* 參數。" @@ -394,7 +394,7 @@ msgid "" "`cancelled `." msgstr "" -#: ../../library/asyncio-task.rst:440 ../../library/asyncio-task.rst:484 +#: ../../library/asyncio-task.rst:440 ../../library/asyncio-task.rst:493 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" @@ -402,11 +402,11 @@ msgstr "" msgid "The statement::" msgstr "" -#: ../../library/asyncio-task.rst:446 +#: ../../library/asyncio-task.rst:447 msgid "is equivalent to::" msgstr "" -#: ../../library/asyncio-task.rst:450 +#: ../../library/asyncio-task.rst:451 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -415,178 +415,186 @@ msgid "" "`CancelledError`." msgstr "" -#: ../../library/asyncio-task.rst:456 +#: ../../library/asyncio-task.rst:457 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." msgstr "" -#: ../../library/asyncio-task.rst:459 +#: ../../library/asyncio-task.rst:460 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " "follows::" msgstr "" -#: ../../library/asyncio-task.rst:471 +#: ../../library/asyncio-task.rst:472 +msgid "" +"Save a reference to tasks passed to this function, to avoid a task " +"disappearing mid-execution. The event loop only keeps weak references to " +"tasks. A task that isn't referenced elsewhere may get garbage collected at " +"any time, even before it's done." +msgstr "" + +#: ../../library/asyncio-task.rst:480 msgid "" "Deprecation warning is emitted if *aw* is not Future-like object and there " "is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:477 +#: ../../library/asyncio-task.rst:486 msgid "Timeouts" msgstr "" -#: ../../library/asyncio-task.rst:481 +#: ../../library/asyncio-task.rst:490 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." msgstr "" -#: ../../library/asyncio-task.rst:486 +#: ../../library/asyncio-task.rst:495 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." msgstr "" -#: ../../library/asyncio-task.rst:490 +#: ../../library/asyncio-task.rst:499 msgid "" "If a timeout occurs, it cancels the task and raises :exc:`asyncio." "TimeoutError`." msgstr "" -#: ../../library/asyncio-task.rst:493 +#: ../../library/asyncio-task.rst:502 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." msgstr "" -#: ../../library/asyncio-task.rst:496 +#: ../../library/asyncio-task.rst:505 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " "cancellation, it is propagated." msgstr "" -#: ../../library/asyncio-task.rst:500 +#: ../../library/asyncio-task.rst:509 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "" -#: ../../library/asyncio-task.rst:527 +#: ../../library/asyncio-task.rst:536 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " "cancelled. Previously, it raised :exc:`asyncio.TimeoutError` immediately." msgstr "" -#: ../../library/asyncio-task.rst:537 +#: ../../library/asyncio-task.rst:546 msgid "Waiting Primitives" msgstr "" -#: ../../library/asyncio-task.rst:541 +#: ../../library/asyncio-task.rst:550 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently and block until the condition specified by *return_when*." msgstr "" -#: ../../library/asyncio-task.rst:545 +#: ../../library/asyncio-task.rst:554 msgid "The *aws* iterable must not be empty." msgstr "" -#: ../../library/asyncio-task.rst:547 +#: ../../library/asyncio-task.rst:556 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "" -#: ../../library/asyncio-task.rst:549 +#: ../../library/asyncio-task.rst:558 msgid "Usage::" msgstr "" "用法:\n" "\n" "::" -#: ../../library/asyncio-task.rst:553 +#: ../../library/asyncio-task.rst:562 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." msgstr "" -#: ../../library/asyncio-task.rst:556 +#: ../../library/asyncio-task.rst:565 msgid "" "Note that this function does not raise :exc:`asyncio.TimeoutError`. Futures " "or Tasks that aren't done when the timeout occurs are simply returned in the " "second set." msgstr "" -#: ../../library/asyncio-task.rst:560 +#: ../../library/asyncio-task.rst:569 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" msgstr "" -#: ../../library/asyncio-task.rst:566 +#: ../../library/asyncio-task.rst:575 msgid "Constant" msgstr "常數" -#: ../../library/asyncio-task.rst:566 +#: ../../library/asyncio-task.rst:575 msgid "Description" msgstr "描述" -#: ../../library/asyncio-task.rst:568 +#: ../../library/asyncio-task.rst:577 msgid ":const:`FIRST_COMPLETED`" msgstr ":const:`FIRST_COMPLETED`" -#: ../../library/asyncio-task.rst:568 +#: ../../library/asyncio-task.rst:577 msgid "The function will return when any future finishes or is cancelled." msgstr "" -#: ../../library/asyncio-task.rst:571 +#: ../../library/asyncio-task.rst:580 msgid ":const:`FIRST_EXCEPTION`" msgstr ":const:`FIRST_EXCEPTION`" -#: ../../library/asyncio-task.rst:571 +#: ../../library/asyncio-task.rst:580 msgid "" "The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" -#: ../../library/asyncio-task.rst:577 +#: ../../library/asyncio-task.rst:586 msgid ":const:`ALL_COMPLETED`" msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:577 +#: ../../library/asyncio-task.rst:586 msgid "The function will return when all futures finish or are cancelled." msgstr "" -#: ../../library/asyncio-task.rst:581 +#: ../../library/asyncio-task.rst:590 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." msgstr "" -#: ../../library/asyncio-task.rst:586 +#: ../../library/asyncio-task.rst:595 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task. Passing coroutines objects to ``wait()`` directly is deprecated as it " "leads to :ref:`confusing behavior `." msgstr "" -#: ../../library/asyncio-task.rst:597 +#: ../../library/asyncio-task.rst:606 msgid "" "``wait()`` schedules coroutines as Tasks automatically and later returns " "those implicitly created Task objects in ``(done, pending)`` sets. " "Therefore the following code won't work as expected::" msgstr "" -#: ../../library/asyncio-task.rst:610 +#: ../../library/asyncio-task.rst:619 msgid "Here is how the above snippet can be fixed::" msgstr "" -#: ../../library/asyncio-task.rst:623 +#: ../../library/asyncio-task.rst:632 msgid "Passing coroutine objects to ``wait()`` directly is deprecated." msgstr "" -#: ../../library/asyncio-task.rst:632 +#: ../../library/asyncio-task.rst:641 msgid "" "Run :ref:`awaitable objects ` in the *aws* iterable " "concurrently. Return an iterator of coroutines. Each coroutine returned can " @@ -594,27 +602,27 @@ msgid "" "remaining awaitables." msgstr "" -#: ../../library/asyncio-task.rst:637 +#: ../../library/asyncio-task.rst:646 msgid "" "Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures " "are done." msgstr "" -#: ../../library/asyncio-task.rst:652 +#: ../../library/asyncio-task.rst:661 msgid "" "Deprecation warning is emitted if not all awaitable objects in the *aws* " "iterable are Future-like objects and there is no running event loop." msgstr "" -#: ../../library/asyncio-task.rst:658 +#: ../../library/asyncio-task.rst:667 msgid "Running in Threads" msgstr "" -#: ../../library/asyncio-task.rst:662 +#: ../../library/asyncio-task.rst:671 msgid "Asynchronously run function *func* in a separate thread." msgstr "" -#: ../../library/asyncio-task.rst:664 +#: ../../library/asyncio-task.rst:673 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -622,19 +630,19 @@ msgid "" "separate thread." msgstr "" -#: ../../library/asyncio-task.rst:669 +#: ../../library/asyncio-task.rst:678 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "" -#: ../../library/asyncio-task.rst:671 +#: ../../library/asyncio-task.rst:680 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " "were ran in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:701 +#: ../../library/asyncio-task.rst:710 msgid "" "Directly calling `blocking_io()` in any coroutine would block the event loop " "for its duration, resulting in an additional 1 second of run time. Instead, " @@ -642,7 +650,7 @@ msgid "" "blocking the event loop." msgstr "" -#: ../../library/asyncio-task.rst:708 +#: ../../library/asyncio-task.rst:717 msgid "" "Due to the :term:`GIL`, `asyncio.to_thread()` can typically only be used to " "make IO-bound functions non-blocking. However, for extension modules that " @@ -650,81 +658,81 @@ msgid "" "`asyncio.to_thread()` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:717 +#: ../../library/asyncio-task.rst:726 msgid "Scheduling From Other Threads" msgstr "" -#: ../../library/asyncio-task.rst:721 +#: ../../library/asyncio-task.rst:730 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:723 +#: ../../library/asyncio-task.rst:732 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." msgstr "" -#: ../../library/asyncio-task.rst:726 +#: ../../library/asyncio-task.rst:735 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" msgstr "" -#: ../../library/asyncio-task.rst:738 +#: ../../library/asyncio-task.rst:747 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" msgstr "" -#: ../../library/asyncio-task.rst:752 +#: ../../library/asyncio-task.rst:761 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" -#: ../../library/asyncio-task.rst:755 +#: ../../library/asyncio-task.rst:764 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." msgstr "" -#: ../../library/asyncio-task.rst:762 +#: ../../library/asyncio-task.rst:771 msgid "Introspection" msgstr "" -#: ../../library/asyncio-task.rst:767 +#: ../../library/asyncio-task.rst:776 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." msgstr "" -#: ../../library/asyncio-task.rst:770 +#: ../../library/asyncio-task.rst:779 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:778 +#: ../../library/asyncio-task.rst:787 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" -#: ../../library/asyncio-task.rst:781 +#: ../../library/asyncio-task.rst:790 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." msgstr "" -#: ../../library/asyncio-task.rst:788 +#: ../../library/asyncio-task.rst:797 msgid "Task Object" msgstr "" -#: ../../library/asyncio-task.rst:792 +#: ../../library/asyncio-task.rst:801 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." msgstr "" -#: ../../library/asyncio-task.rst:795 +#: ../../library/asyncio-task.rst:804 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -732,21 +740,21 @@ msgid "" "wrapped coroutine resumes." msgstr "" -#: ../../library/asyncio-task.rst:801 +#: ../../library/asyncio-task.rst:810 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " "runs other Tasks, callbacks, or performs IO operations." msgstr "" -#: ../../library/asyncio-task.rst:806 +#: ../../library/asyncio-task.rst:815 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " "Manual instantiation of Tasks is discouraged." msgstr "" -#: ../../library/asyncio-task.rst:811 +#: ../../library/asyncio-task.rst:820 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -754,47 +762,47 @@ msgid "" "cancellation, the Future object will be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:816 +#: ../../library/asyncio-task.rst:825 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" "`CancelledError` exception and was actually cancelled." msgstr "" -#: ../../library/asyncio-task.rst:821 +#: ../../library/asyncio-task.rst:830 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." msgstr "" -#: ../../library/asyncio-task.rst:825 +#: ../../library/asyncio-task.rst:834 msgid "" "Tasks support the :mod:`contextvars` module. When a Task is created it " "copies the current context and later runs its coroutine in the copied " "context." msgstr "" -#: ../../library/asyncio-task.rst:829 +#: ../../library/asyncio-task.rst:838 msgid "Added support for the :mod:`contextvars` module." msgstr "" -#: ../../library/asyncio-task.rst:835 +#: ../../library/asyncio-task.rst:844 msgid "" "Deprecation warning is emitted if *loop* is not specified and there is no " "running event loop." msgstr "" -#: ../../library/asyncio-task.rst:841 +#: ../../library/asyncio-task.rst:850 msgid "Request the Task to be cancelled." msgstr "" -#: ../../library/asyncio-task.rst:843 +#: ../../library/asyncio-task.rst:852 msgid "" "This arranges for a :exc:`CancelledError` exception to be thrown into the " "wrapped coroutine on the next cycle of the event loop." msgstr "" -#: ../../library/asyncio-task.rst:846 +#: ../../library/asyncio-task.rst:855 msgid "" "The coroutine then has a chance to clean up or even deny the request by " "suppressing the exception with a :keyword:`try` ... ... ``except " @@ -804,103 +812,103 @@ msgid "" "is actively discouraged." msgstr "" -#: ../../library/asyncio-task.rst:854 +#: ../../library/asyncio-task.rst:863 msgid "Added the *msg* parameter." msgstr "新增 *msg* 參數。" -#: ../../library/asyncio-task.rst:859 +#: ../../library/asyncio-task.rst:868 msgid "" "The following example illustrates how coroutines can intercept the " "cancellation request::" msgstr "" -#: ../../library/asyncio-task.rst:898 +#: ../../library/asyncio-task.rst:907 msgid "Return ``True`` if the Task is *cancelled*." msgstr "" -#: ../../library/asyncio-task.rst:900 +#: ../../library/asyncio-task.rst:909 msgid "" "The Task is *cancelled* when the cancellation was requested with :meth:" "`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " "exception thrown into it." msgstr "" -#: ../../library/asyncio-task.rst:906 +#: ../../library/asyncio-task.rst:915 msgid "Return ``True`` if the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:908 +#: ../../library/asyncio-task.rst:917 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." msgstr "" -#: ../../library/asyncio-task.rst:913 +#: ../../library/asyncio-task.rst:922 msgid "Return the result of the Task." msgstr "" -#: ../../library/asyncio-task.rst:915 +#: ../../library/asyncio-task.rst:924 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" msgstr "" -#: ../../library/asyncio-task.rst:919 ../../library/asyncio-task.rst:933 +#: ../../library/asyncio-task.rst:928 ../../library/asyncio-task.rst:942 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:922 +#: ../../library/asyncio-task.rst:931 msgid "" "If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" -#: ../../library/asyncio-task.rst:927 +#: ../../library/asyncio-task.rst:936 msgid "Return the exception of the Task." msgstr "" -#: ../../library/asyncio-task.rst:929 +#: ../../library/asyncio-task.rst:938 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." msgstr "" -#: ../../library/asyncio-task.rst:936 +#: ../../library/asyncio-task.rst:945 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." msgstr "" -#: ../../library/asyncio-task.rst:941 +#: ../../library/asyncio-task.rst:950 msgid "Add a callback to be run when the Task is *done*." msgstr "" -#: ../../library/asyncio-task.rst:943 ../../library/asyncio-task.rst:952 +#: ../../library/asyncio-task.rst:952 ../../library/asyncio-task.rst:961 msgid "This method should only be used in low-level callback-based code." msgstr "" -#: ../../library/asyncio-task.rst:945 +#: ../../library/asyncio-task.rst:954 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" -#: ../../library/asyncio-task.rst:950 +#: ../../library/asyncio-task.rst:959 msgid "Remove *callback* from the callbacks list." msgstr "" -#: ../../library/asyncio-task.rst:954 +#: ../../library/asyncio-task.rst:963 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." msgstr "" -#: ../../library/asyncio-task.rst:959 +#: ../../library/asyncio-task.rst:968 msgid "Return the list of stack frames for this Task." msgstr "" -#: ../../library/asyncio-task.rst:961 +#: ../../library/asyncio-task.rst:970 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -908,15 +916,15 @@ msgid "" "this returns the list of traceback frames." msgstr "" -#: ../../library/asyncio-task.rst:967 +#: ../../library/asyncio-task.rst:976 msgid "The frames are always ordered from oldest to newest." msgstr "" -#: ../../library/asyncio-task.rst:969 +#: ../../library/asyncio-task.rst:978 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" -#: ../../library/asyncio-task.rst:971 +#: ../../library/asyncio-task.rst:980 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -925,111 +933,111 @@ msgid "" "are returned. (This matches the behavior of the traceback module.)" msgstr "" -#: ../../library/asyncio-task.rst:980 +#: ../../library/asyncio-task.rst:989 msgid "Print the stack or traceback for this Task." msgstr "" -#: ../../library/asyncio-task.rst:982 +#: ../../library/asyncio-task.rst:991 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." msgstr "" -#: ../../library/asyncio-task.rst:985 +#: ../../library/asyncio-task.rst:994 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "" -#: ../../library/asyncio-task.rst:987 +#: ../../library/asyncio-task.rst:996 msgid "" "The *file* argument is an I/O stream to which the output is written; by " "default output is written to :data:`sys.stderr`." msgstr "" -#: ../../library/asyncio-task.rst:992 +#: ../../library/asyncio-task.rst:1001 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr "" -#: ../../library/asyncio-task.rst:998 +#: ../../library/asyncio-task.rst:1007 msgid "Return the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1000 +#: ../../library/asyncio-task.rst:1009 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." msgstr "" -#: ../../library/asyncio-task.rst:1008 +#: ../../library/asyncio-task.rst:1017 msgid "Set the name of the Task." msgstr "" -#: ../../library/asyncio-task.rst:1010 +#: ../../library/asyncio-task.rst:1019 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" -#: ../../library/asyncio-task.rst:1013 +#: ../../library/asyncio-task.rst:1022 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." msgstr "" -#: ../../library/asyncio-task.rst:1022 +#: ../../library/asyncio-task.rst:1031 msgid "Generator-based Coroutines" msgstr "" -#: ../../library/asyncio-task.rst:1026 +#: ../../library/asyncio-task.rst:1035 msgid "" "Support for generator-based coroutines is **deprecated** and is removed in " "Python 3.11." msgstr "" -#: ../../library/asyncio-task.rst:1029 +#: ../../library/asyncio-task.rst:1038 msgid "" "Generator-based coroutines predate async/await syntax. They are Python " "generators that use ``yield from`` expressions to await on Futures and other " "coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1033 +#: ../../library/asyncio-task.rst:1042 msgid "" "Generator-based coroutines should be decorated with :func:`@asyncio." "coroutine `, although this is not enforced." msgstr "" -#: ../../library/asyncio-task.rst:1040 +#: ../../library/asyncio-task.rst:1049 msgid "Decorator to mark generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1042 +#: ../../library/asyncio-task.rst:1051 msgid "" "This decorator enables legacy generator-based coroutines to be compatible " "with async/await code::" msgstr "" -#: ../../library/asyncio-task.rst:1052 +#: ../../library/asyncio-task.rst:1061 msgid "This decorator should not be used for :keyword:`async def` coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1057 +#: ../../library/asyncio-task.rst:1066 msgid "Use :keyword:`async def` instead." msgstr "" -#: ../../library/asyncio-task.rst:1061 +#: ../../library/asyncio-task.rst:1070 msgid "Return ``True`` if *obj* is a :ref:`coroutine object `." msgstr "" -#: ../../library/asyncio-task.rst:1063 +#: ../../library/asyncio-task.rst:1072 msgid "" "This method is different from :func:`inspect.iscoroutine` because it returns " "``True`` for generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1068 +#: ../../library/asyncio-task.rst:1077 msgid "Return ``True`` if *func* is a :ref:`coroutine function `." msgstr "" -#: ../../library/asyncio-task.rst:1071 +#: ../../library/asyncio-task.rst:1080 msgid "" "This method is different from :func:`inspect.iscoroutinefunction` because it " "returns ``True`` for generator-based coroutine functions decorated with :" From fc83d01684e4da340f3034b580a05f95a721adab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 14 Sep 2022 00:22:30 +0000 Subject: [PATCH 5/6] sync with cpython 7528e2c0 --- library/sqlite3.po | 470 ++++++++++++++++++++++----------------------- 1 file changed, 235 insertions(+), 235 deletions(-) diff --git a/library/sqlite3.po b/library/sqlite3.po index b23767bc97..2e3fc72503 100644 --- a/library/sqlite3.po +++ b/library/sqlite3.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.10\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-09-05 00:20+0000\n" +"POT-Creation-Date: 2022-09-14 00:20+0000\n" "PO-Revision-Date: 2018-05-23 16:10+0000\n" "Last-Translator: Adrian Liaw \n" "Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-" @@ -539,136 +539,70 @@ msgstr "" #: ../../library/sqlite3.rst:520 msgid "" -"This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " -"transactions are never implicitly opened. If set to one of ``\"DEFERRED\"``, " -"``\"IMMEDIATE\"``, or ``\"EXCLUSIVE\"``, corresponding to the underlying " -"`SQLite transaction behaviour`_, implicit :ref:`transaction management " -"` is performed." -msgstr "" - -#: ../../library/sqlite3.rst:528 -msgid "" -"If not overridden by the *isolation_level* parameter of :func:`connect`, the " -"default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." -msgstr "" - -#: ../../library/sqlite3.rst:533 -msgid "" -"This read-only attribute corresponds to the low-level SQLite `autocommit " -"mode`_." -msgstr "" - -#: ../../library/sqlite3.rst:536 -msgid "" -"``True`` if a transaction is active (there are uncommitted changes), " -"``False`` otherwise." -msgstr "" - -#: ../../library/sqlite3.rst:543 -msgid "" -"A callable that accepts two arguments, a :class:`Cursor` object and the raw " -"row results as a :class:`tuple`, and returns a custom object representing an " -"SQLite row." -msgstr "" - -#: ../../library/sqlite3.rst:547 ../../library/sqlite3.rst:577 -#: ../../library/sqlite3.rst:686 ../../library/sqlite3.rst:724 -#: ../../library/sqlite3.rst:943 ../../library/sqlite3.rst:1089 -#: ../../library/sqlite3.rst:1110 ../../library/sqlite3.rst:1247 -msgid "Example:" -msgstr "範例:" - -#: ../../library/sqlite3.rst:560 -msgid "" -"If returning a tuple doesn't suffice and you want name-based access to " -"columns, you should consider setting :attr:`row_factory` to the highly " -"optimized :class:`sqlite3.Row` type. :class:`Row` provides both index-based " -"and case-insensitive name-based access to columns with almost no memory " -"overhead. It will probably be better than your own custom dictionary-based " -"approach or even a db_row based solution." -msgstr "" - -#: ../../library/sqlite3.rst:571 -msgid "" -"A callable that accepts a :class:`bytes` parameter and returns a text " -"representation of it. The callable is invoked for SQLite values with the " -"``TEXT`` data type. By default, this attribute is set to :class:`str`. If " -"you want to return ``bytes`` instead, set *text_factory* to ``bytes``." -msgstr "" - -#: ../../library/sqlite3.rst:611 -msgid "" -"Return the total number of database rows that have been modified, inserted, " -"or deleted since the database connection was opened." -msgstr "" - -#: ../../library/sqlite3.rst:617 -msgid "" "Create and return a :class:`Cursor` object. The cursor method accepts a " "single optional parameter *factory*. If supplied, this must be a callable " "returning an instance of :class:`Cursor` or its subclasses." msgstr "" -#: ../../library/sqlite3.rst:624 +#: ../../library/sqlite3.rst:527 msgid "" "Commit any pending transaction to the database. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:629 +#: ../../library/sqlite3.rst:532 msgid "" "Roll back to the start of any pending transaction. If there is no open " "transaction, this method is a no-op." msgstr "" -#: ../../library/sqlite3.rst:634 +#: ../../library/sqlite3.rst:537 msgid "" "Close the database connection. Any pending transaction is not committed " "implicitly; make sure to :meth:`commit` before closing to avoid losing " "pending changes." msgstr "" -#: ../../library/sqlite3.rst:641 +#: ../../library/sqlite3.rst:544 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.execute` on it " "with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:647 +#: ../../library/sqlite3.rst:550 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executemany` on " "it with the given *sql* and *parameters*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:653 +#: ../../library/sqlite3.rst:556 msgid "" "Create a new :class:`Cursor` object and call :meth:`~Cursor.executescript` " "on it with the given *sql_script*. Return the new cursor object." msgstr "" -#: ../../library/sqlite3.rst:659 +#: ../../library/sqlite3.rst:562 msgid "Create or remove a user-defined SQL function." msgstr "" -#: ../../library/sqlite3.rst:661 +#: ../../library/sqlite3.rst:564 msgid "The name of the SQL function." msgstr "" -#: ../../library/sqlite3.rst:664 +#: ../../library/sqlite3.rst:567 msgid "" "The number of arguments the SQL function can accept. If ``-1``, it may take " "any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:668 +#: ../../library/sqlite3.rst:571 msgid "" "A callable that is called when the SQL function is invoked. The callable " "must return :ref:`a type natively supported by SQLite `. Set " "to ``None`` to remove an existing SQL function." msgstr "" -#: ../../library/sqlite3.rst:675 +#: ../../library/sqlite3.rst:578 msgid "" "If ``True``, the created SQL function is marked as `deterministic `_, which allows SQLite to perform additional " @@ -679,29 +613,36 @@ msgstr "" msgid "Raises" msgstr "" -#: ../../library/sqlite3.rst:680 +#: ../../library/sqlite3.rst:583 msgid "If *deterministic* is used with SQLite versions older than 3.8.3." msgstr "" -#: ../../library/sqlite3.rst:683 +#: ../../library/sqlite3.rst:586 msgid "The *deterministic* parameter." msgstr "新增 *deterministic* 參數。" -#: ../../library/sqlite3.rst:702 +#: ../../library/sqlite3.rst:589 ../../library/sqlite3.rst:627 +#: ../../library/sqlite3.rst:846 ../../library/sqlite3.rst:952 +#: ../../library/sqlite3.rst:982 ../../library/sqlite3.rst:1087 +#: ../../library/sqlite3.rst:1108 ../../library/sqlite3.rst:1245 +msgid "Example:" +msgstr "範例:" + +#: ../../library/sqlite3.rst:605 msgid "Create or remove a user-defined SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:704 +#: ../../library/sqlite3.rst:607 msgid "The name of the SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:707 +#: ../../library/sqlite3.rst:610 msgid "" "The number of arguments the SQL aggregate function can accept. If ``-1``, it " "may take any number of arguments." msgstr "" -#: ../../library/sqlite3.rst:711 +#: ../../library/sqlite3.rst:614 msgid "" "A class must implement the following methods: * ``step()``: Add a row to " "the aggregate. * ``finalize()``: Return the final result of the aggregate " @@ -710,64 +651,64 @@ msgid "" "*n_arg*. Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:712 +#: ../../library/sqlite3.rst:615 msgid "A class must implement the following methods:" msgstr "" -#: ../../library/sqlite3.rst:714 +#: ../../library/sqlite3.rst:617 msgid "``step()``: Add a row to the aggregate." msgstr "" -#: ../../library/sqlite3.rst:715 +#: ../../library/sqlite3.rst:618 msgid "" "``finalize()``: Return the final result of the aggregate as :ref:`a type " "natively supported by SQLite `." msgstr "" -#: ../../library/sqlite3.rst:718 +#: ../../library/sqlite3.rst:621 msgid "" "The number of arguments that the ``step()`` method must accept is controlled " "by *n_arg*." msgstr "" -#: ../../library/sqlite3.rst:721 +#: ../../library/sqlite3.rst:624 msgid "Set to ``None`` to remove an existing SQL aggregate function." msgstr "" -#: ../../library/sqlite3.rst:756 +#: ../../library/sqlite3.rst:659 msgid "" "Create a collation named *name* using the collating function *callable*. " "*callable* is passed two :class:`string ` arguments, and it should " "return an :class:`integer `:" msgstr "" -#: ../../library/sqlite3.rst:760 +#: ../../library/sqlite3.rst:663 msgid "``1`` if the first is ordered higher than the second" msgstr "" -#: ../../library/sqlite3.rst:761 +#: ../../library/sqlite3.rst:664 msgid "``-1`` if the first is ordered lower than the second" msgstr "" -#: ../../library/sqlite3.rst:762 +#: ../../library/sqlite3.rst:665 msgid "``0`` if they are ordered equal" msgstr "" -#: ../../library/sqlite3.rst:764 +#: ../../library/sqlite3.rst:667 msgid "The following example shows a reverse sorting collation:" msgstr "" -#: ../../library/sqlite3.rst:792 +#: ../../library/sqlite3.rst:695 msgid "Remove a collation function by setting *callable* to ``None``." msgstr "" -#: ../../library/sqlite3.rst:797 +#: ../../library/sqlite3.rst:700 msgid "" "Call this method from a different thread to abort any queries that might be " "executing on the connection. Aborted queries will raise an exception." msgstr "" -#: ../../library/sqlite3.rst:804 +#: ../../library/sqlite3.rst:707 msgid "" "Register callable *authorizer_callback* to be invoked for each attempt to " "access a column of a table in the database. The callback should return one " @@ -776,7 +717,7 @@ msgid "" "library." msgstr "" -#: ../../library/sqlite3.rst:810 +#: ../../library/sqlite3.rst:713 msgid "" "The first argument to the callback signifies what kind of operation is to be " "authorized. The second and third argument will be arguments or ``None`` " @@ -786,7 +727,7 @@ msgid "" "attempt or ``None`` if this access attempt is directly from input SQL code." msgstr "" -#: ../../library/sqlite3.rst:817 +#: ../../library/sqlite3.rst:720 msgid "" "Please consult the SQLite documentation about the possible values for the " "first argument and the meaning of the second and third argument depending on " @@ -794,7 +735,7 @@ msgid "" "module." msgstr "" -#: ../../library/sqlite3.rst:824 +#: ../../library/sqlite3.rst:727 msgid "" "Register callable *progress_handler* to be invoked for every *n* " "instructions of the SQLite virtual machine. This is useful if you want to " @@ -802,26 +743,26 @@ msgid "" "a GUI." msgstr "" -#: ../../library/sqlite3.rst:829 +#: ../../library/sqlite3.rst:732 msgid "" "If you want to clear any previously installed progress handler, call the " "method with ``None`` for *progress_handler*." msgstr "" -#: ../../library/sqlite3.rst:832 +#: ../../library/sqlite3.rst:735 msgid "" "Returning a non-zero value from the handler function will terminate the " "currently executing query and cause it to raise an :exc:`OperationalError` " "exception." msgstr "" -#: ../../library/sqlite3.rst:839 +#: ../../library/sqlite3.rst:742 msgid "" "Register callable *trace_callback* to be invoked for each SQL statement that " "is actually executed by the SQLite backend." msgstr "" -#: ../../library/sqlite3.rst:842 +#: ../../library/sqlite3.rst:745 msgid "" "The only argument passed to the callback is the statement (as :class:`str`) " "that is being executed. The return value of the callback is ignored. Note " @@ -831,18 +772,18 @@ msgid "" "execution of triggers defined in the current database." msgstr "" -#: ../../library/sqlite3.rst:850 +#: ../../library/sqlite3.rst:753 msgid "Passing ``None`` as *trace_callback* will disable the trace callback." msgstr "" -#: ../../library/sqlite3.rst:853 +#: ../../library/sqlite3.rst:756 msgid "" "Exceptions raised in the trace callback are not propagated. As a development " "and debugging aid, use :meth:`~sqlite3.enable_callback_tracebacks` to enable " "printing tracebacks from exceptions raised in the trace callback." msgstr "" -#: ../../library/sqlite3.rst:863 +#: ../../library/sqlite3.rst:766 msgid "" "Enable the SQLite engine to load SQLite extensions from shared libraries if " "*enabled* is ``True``; else, disallow loading SQLite extensions. SQLite " @@ -851,7 +792,7 @@ msgid "" "distributed with SQLite." msgstr "" -#: ../../library/sqlite3.rst:872 +#: ../../library/sqlite3.rst:775 msgid "" "The :mod:`!sqlite3` module is not built with loadable extension support by " "default, because some platforms (notably macOS) have SQLite libraries which " @@ -860,61 +801,61 @@ msgid "" "program:`configure`." msgstr "" -#: ../../library/sqlite3.rst:879 +#: ../../library/sqlite3.rst:782 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.enable_load_extension`` " "with arguments ``connection``, ``enabled``." msgstr "" -#: ../../library/sqlite3.rst:883 +#: ../../library/sqlite3.rst:786 msgid "Added the ``sqlite3.enable_load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:926 +#: ../../library/sqlite3.rst:829 msgid "" "Load an SQLite extension from a shared library located at *path*. Enable " "extension loading with :meth:`enable_load_extension` before calling this " "method." msgstr "" -#: ../../library/sqlite3.rst:930 +#: ../../library/sqlite3.rst:833 msgid "" "Raises an :ref:`auditing event ` ``sqlite3.load_extension`` with " "arguments ``connection``, ``path``." msgstr "" -#: ../../library/sqlite3.rst:934 +#: ../../library/sqlite3.rst:837 msgid "Added the ``sqlite3.load_extension`` auditing event." msgstr "" -#: ../../library/sqlite3.rst:939 +#: ../../library/sqlite3.rst:842 msgid "" "Return an :term:`iterator` to dump the database as SQL source code. Useful " "when saving an in-memory database for later restoration. Similar to the ``." "dump`` command in the :program:`sqlite3` shell." msgstr "" -#: ../../library/sqlite3.rst:957 +#: ../../library/sqlite3.rst:860 msgid "Create a backup of an SQLite database." msgstr "" -#: ../../library/sqlite3.rst:959 +#: ../../library/sqlite3.rst:862 msgid "" "Works even if the database is being accessed by other clients or " "concurrently by the same connection." msgstr "" -#: ../../library/sqlite3.rst:962 +#: ../../library/sqlite3.rst:865 msgid "The database connection to save the backup to." msgstr "" -#: ../../library/sqlite3.rst:965 +#: ../../library/sqlite3.rst:868 msgid "" "The number of pages to copy at a time. If equal to or less than ``0``, the " "entire database is copied in a single step. Defaults to ``-1``." msgstr "" -#: ../../library/sqlite3.rst:971 +#: ../../library/sqlite3.rst:874 msgid "" "If set to a callable, it is invoked with three integer arguments for every " "backup iteration: the *status* of the last iteration, the *remaining* number " @@ -922,32 +863,91 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:980 +#: ../../library/sqlite3.rst:883 msgid "" "The name of the database to back up. Either ``\"main\"`` (the default) for " "the main database, ``\"temp\"`` for the temporary database, or the name of a " "custom database as attached using the ``ATTACH DATABASE`` SQL statement." msgstr "" -#: ../../library/sqlite3.rst:987 +#: ../../library/sqlite3.rst:890 msgid "" "The number of seconds to sleep between successive attempts to back up " "remaining pages." msgstr "" -#: ../../library/sqlite3.rst:991 +#: ../../library/sqlite3.rst:894 msgid "Example 1, copy an existing database into another:" msgstr "" -#: ../../library/sqlite3.rst:1010 +#: ../../library/sqlite3.rst:913 msgid "Example 2, copy an existing database into a transient copy:" msgstr "" -#: ../../library/sqlite3.rst:1024 +#: ../../library/sqlite3.rst:925 +msgid "" +"This read-only attribute corresponds to the low-level SQLite `autocommit " +"mode`_." +msgstr "" + +#: ../../library/sqlite3.rst:928 +msgid "" +"``True`` if a transaction is active (there are uncommitted changes), " +"``False`` otherwise." +msgstr "" + +#: ../../library/sqlite3.rst:935 +msgid "" +"This attribute controls the :ref:`transaction handling ` performed by :mod:`!sqlite3`. If set to ``None``, " +"transactions are never implicitly opened. If set to one of ``\"DEFERRED\"``, " +"``\"IMMEDIATE\"``, or ``\"EXCLUSIVE\"``, corresponding to the underlying " +"`SQLite transaction behaviour`_, implicit :ref:`transaction management " +"` is performed." +msgstr "" + +#: ../../library/sqlite3.rst:943 +msgid "" +"If not overridden by the *isolation_level* parameter of :func:`connect`, the " +"default is ``\"\"``, which is an alias for ``\"DEFERRED\"``." +msgstr "" + +#: ../../library/sqlite3.rst:948 +msgid "" +"A callable that accepts two arguments, a :class:`Cursor` object and the raw " +"row results as a :class:`tuple`, and returns a custom object representing an " +"SQLite row." +msgstr "" + +#: ../../library/sqlite3.rst:965 +msgid "" +"If returning a tuple doesn't suffice and you want name-based access to " +"columns, you should consider setting :attr:`row_factory` to the highly " +"optimized :class:`sqlite3.Row` type. :class:`Row` provides both index-based " +"and case-insensitive name-based access to columns with almost no memory " +"overhead. It will probably be better than your own custom dictionary-based " +"approach or even a db_row based solution." +msgstr "" + +#: ../../library/sqlite3.rst:976 +msgid "" +"A callable that accepts a :class:`bytes` parameter and returns a text " +"representation of it. The callable is invoked for SQLite values with the " +"``TEXT`` data type. By default, this attribute is set to :class:`str`. If " +"you want to return ``bytes`` instead, set *text_factory* to ``bytes``." +msgstr "" + +#: ../../library/sqlite3.rst:1016 +msgid "" +"Return the total number of database rows that have been modified, inserted, " +"or deleted since the database connection was opened." +msgstr "" + +#: ../../library/sqlite3.rst:1022 msgid "Cursor objects" msgstr "" -#: ../../library/sqlite3.rst:1026 +#: ../../library/sqlite3.rst:1024 msgid "" "A ``Cursor`` object represents a `database cursor`_ which is used to execute " "SQL statements, and manage the context of a fetch operation. Cursors are " @@ -955,25 +955,25 @@ msgid "" "`connection shortcut methods `." msgstr "" -#: ../../library/sqlite3.rst:1033 +#: ../../library/sqlite3.rst:1031 msgid "" "Cursor objects are :term:`iterators `, meaning that if you :meth:" "`~Cursor.execute` a ``SELECT`` query, you can simply iterate over the cursor " "to fetch the resulting rows:" msgstr "" -#: ../../library/sqlite3.rst:1058 +#: ../../library/sqlite3.rst:1056 msgid "A :class:`Cursor` instance has the following attributes and methods." msgstr "" -#: ../../library/sqlite3.rst:1065 +#: ../../library/sqlite3.rst:1063 msgid "" "Execute SQL statement *sql*. Bind values to the statement using :ref:" "`placeholders ` that map to the :term:`sequence` or :" "class:`dict` *parameters*." msgstr "" -#: ../../library/sqlite3.rst:1070 +#: ../../library/sqlite3.rst:1068 msgid "" ":meth:`execute` will only execute a single SQL statement. If you try to " "execute more than one statement with it, it will raise a :exc:`Warning`. " @@ -981,7 +981,7 @@ msgid "" "with one call." msgstr "" -#: ../../library/sqlite3.rst:1075 +#: ../../library/sqlite3.rst:1073 msgid "" "If :attr:`~Connection.isolation_level` is not ``None``, *sql* is an " "``INSERT``, ``UPDATE``, ``DELETE``, or ``REPLACE`` statement, and there is " @@ -989,7 +989,7 @@ msgid "" "*sql*." msgstr "" -#: ../../library/sqlite3.rst:1083 +#: ../../library/sqlite3.rst:1081 msgid "" "Execute :ref:`parameterized ` SQL statement *sql* " "against all parameter sequences or mappings found in the sequence " @@ -998,7 +998,7 @@ msgid "" "handling as :meth:`~Cursor.execute`." msgstr "" -#: ../../library/sqlite3.rst:1102 +#: ../../library/sqlite3.rst:1100 msgid "" "Execute the SQL statements in *sql_script*. If there is a pending " "transaction, an implicit ``COMMIT`` statement is executed first. No other " @@ -1006,23 +1006,23 @@ msgid "" "added to *sql_script*." msgstr "" -#: ../../library/sqlite3.rst:1108 +#: ../../library/sqlite3.rst:1106 msgid "*sql_script* must be a :class:`string `." msgstr "" -#: ../../library/sqlite3.rst:1126 +#: ../../library/sqlite3.rst:1124 msgid "" "Return the next row of a query result set as a :class:`tuple`. Return " "``None`` if no more data is available." msgstr "" -#: ../../library/sqlite3.rst:1132 +#: ../../library/sqlite3.rst:1130 msgid "" "Return the next set of rows of a query result as a :class:`list`. Return an " "empty list if no more rows are available." msgstr "" -#: ../../library/sqlite3.rst:1135 +#: ../../library/sqlite3.rst:1133 msgid "" "The number of rows to fetch per call is specified by the *size* parameter. " "If *size* is not given, :attr:`arraysize` determines the number of rows to " @@ -1030,7 +1030,7 @@ msgid "" "available are returned." msgstr "" -#: ../../library/sqlite3.rst:1141 +#: ../../library/sqlite3.rst:1139 msgid "" "Note there are performance considerations involved with the *size* " "parameter. For optimal performance, it is usually best to use the arraysize " @@ -1038,36 +1038,36 @@ msgid "" "the same value from one :meth:`fetchmany` call to the next." msgstr "" -#: ../../library/sqlite3.rst:1148 +#: ../../library/sqlite3.rst:1146 msgid "" "Return all (remaining) rows of a query result as a :class:`list`. Return an " "empty list if no rows are available. Note that the :attr:`arraysize` " "attribute can affect the performance of this operation." msgstr "" -#: ../../library/sqlite3.rst:1155 +#: ../../library/sqlite3.rst:1153 msgid "Close the cursor now (rather than whenever ``__del__`` is called)." msgstr "" -#: ../../library/sqlite3.rst:1157 +#: ../../library/sqlite3.rst:1155 msgid "" "The cursor will be unusable from this point forward; a :exc:" "`ProgrammingError` exception will be raised if any operation is attempted " "with the cursor." msgstr "" -#: ../../library/sqlite3.rst:1162 ../../library/sqlite3.rst:1166 +#: ../../library/sqlite3.rst:1160 ../../library/sqlite3.rst:1164 msgid "Required by the DB-API. Does nothing in :mod:`!sqlite3`." msgstr "" -#: ../../library/sqlite3.rst:1170 +#: ../../library/sqlite3.rst:1168 msgid "" "Read/write attribute that controls the number of rows returned by :meth:" "`fetchmany`. The default value is 1 which means a single row would be " "fetched per call." msgstr "" -#: ../../library/sqlite3.rst:1175 +#: ../../library/sqlite3.rst:1173 msgid "" "Read-only attribute that provides the SQLite database :class:`Connection` " "belonging to the cursor. A :class:`Cursor` object created by calling :meth:" @@ -1075,18 +1075,18 @@ msgid "" "that refers to *con*:" msgstr "" -#: ../../library/sqlite3.rst:1189 +#: ../../library/sqlite3.rst:1187 msgid "" "Read-only attribute that provides the column names of the last query. To " "remain compatible with the Python DB API, it returns a 7-tuple for each " "column where the last six items of each tuple are ``None``." msgstr "" -#: ../../library/sqlite3.rst:1193 +#: ../../library/sqlite3.rst:1191 msgid "It is set for ``SELECT`` statements without any matching rows as well." msgstr "" -#: ../../library/sqlite3.rst:1197 +#: ../../library/sqlite3.rst:1195 msgid "" "Read-only attribute that provides the row id of the last inserted row. It is " "only updated after successful ``INSERT`` or ``REPLACE`` statements using " @@ -1096,15 +1096,15 @@ msgid "" "``None``." msgstr "" -#: ../../library/sqlite3.rst:1205 +#: ../../library/sqlite3.rst:1203 msgid "Inserts into ``WITHOUT ROWID`` tables are not recorded." msgstr "" -#: ../../library/sqlite3.rst:1207 +#: ../../library/sqlite3.rst:1205 msgid "Added support for the ``REPLACE`` statement." msgstr "新增 ``REPLACE`` 陳述式的支援。" -#: ../../library/sqlite3.rst:1212 +#: ../../library/sqlite3.rst:1210 msgid "" "Read-only attribute that provides the number of modified rows for " "``INSERT``, ``UPDATE``, ``DELETE``, and ``REPLACE`` statements; is ``-1`` " @@ -1113,11 +1113,11 @@ msgid "" "methods." msgstr "" -#: ../../library/sqlite3.rst:1227 +#: ../../library/sqlite3.rst:1225 msgid "Row objects" msgstr "" -#: ../../library/sqlite3.rst:1231 +#: ../../library/sqlite3.rst:1229 msgid "" "A :class:`!Row` instance serves as a highly optimized :attr:`~Connection." "row_factory` for :class:`Connection` objects. It supports iteration, " @@ -1125,41 +1125,41 @@ msgid "" "index." msgstr "" -#: ../../library/sqlite3.rst:1236 +#: ../../library/sqlite3.rst:1234 msgid "Two row objects compare equal if have equal columns and equal members." msgstr "" -#: ../../library/sqlite3.rst:1240 +#: ../../library/sqlite3.rst:1238 msgid "" "Return a :class:`list` of column names as :class:`strings `. " "Immediately after a query, it is the first member of each tuple in :attr:" "`Cursor.description`." msgstr "" -#: ../../library/sqlite3.rst:1244 +#: ../../library/sqlite3.rst:1242 msgid "Added support of slicing." msgstr "" -#: ../../library/sqlite3.rst:1264 +#: ../../library/sqlite3.rst:1262 msgid "PrepareProtocol objects" msgstr "" -#: ../../library/sqlite3.rst:1268 +#: ../../library/sqlite3.rst:1266 msgid "" "The PrepareProtocol type's single purpose is to act as a :pep:`246` style " "adaption protocol for objects that can :ref:`adapt themselves ` to :ref:`native SQLite types `." msgstr "" -#: ../../library/sqlite3.rst:1276 +#: ../../library/sqlite3.rst:1274 msgid "Exceptions" msgstr "例外" -#: ../../library/sqlite3.rst:1278 +#: ../../library/sqlite3.rst:1276 msgid "The exception hierarchy is defined by the DB-API 2.0 (:pep:`249`)." msgstr "" -#: ../../library/sqlite3.rst:1282 +#: ../../library/sqlite3.rst:1280 msgid "" "This exception is raised by :mod:`!sqlite3` if an SQL query is not a :class:" "`string `, or if multiple statements are passed to :meth:`~Cursor." @@ -1167,21 +1167,21 @@ msgid "" "`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1289 +#: ../../library/sqlite3.rst:1287 msgid "" "The base class of the other exceptions in this module. Use this to catch all " "errors with one single :keyword:`except` statement. ``Error`` is a subclass " "of :exc:`Exception`." msgstr "" -#: ../../library/sqlite3.rst:1295 +#: ../../library/sqlite3.rst:1293 msgid "" "This exception is raised by :mod:`!sqlite3` for fetch across rollback, or " "if :mod:`!sqlite3` is unable to bind parameters. ``InterfaceError`` is a " "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1301 +#: ../../library/sqlite3.rst:1299 msgid "" "Exception raised for errors that are related to the database. This serves as " "the base exception for several types of database errors. It is only raised " @@ -1189,14 +1189,14 @@ msgid "" "subclass of :exc:`Error`." msgstr "" -#: ../../library/sqlite3.rst:1308 +#: ../../library/sqlite3.rst:1306 msgid "" "Exception raised for errors caused by problems with the processed data, like " "numeric values out of range, and strings which are too long. ``DataError`` " "is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1314 +#: ../../library/sqlite3.rst:1312 msgid "" "Exception raised for errors that are related to the database's operation, " "and not necessarily under the control of the programmer. For example, the " @@ -1204,20 +1204,20 @@ msgid "" "``OperationalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1322 +#: ../../library/sqlite3.rst:1320 msgid "" "Exception raised when the relational integrity of the database is affected, " "e.g. a foreign key check fails. It is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1327 +#: ../../library/sqlite3.rst:1325 msgid "" "Exception raised when SQLite encounters an internal error. If this is " "raised, it may indicate that there is a problem with the runtime SQLite " "library. ``InternalError`` is a subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1334 +#: ../../library/sqlite3.rst:1332 msgid "" "Exception raised for :mod:`!sqlite3` API programming errors, for example " "trying to operate on a closed :class:`Connection`, or trying to execute non-" @@ -1225,7 +1225,7 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1341 +#: ../../library/sqlite3.rst:1339 msgid "" "Exception raised in case a method or database API is not supported by the " "underlying SQLite library. For example, setting *deterministic* to ``True`` " @@ -1234,78 +1234,78 @@ msgid "" "subclass of :exc:`DatabaseError`." msgstr "" -#: ../../library/sqlite3.rst:1351 +#: ../../library/sqlite3.rst:1349 msgid "SQLite and Python types" msgstr "" -#: ../../library/sqlite3.rst:1353 +#: ../../library/sqlite3.rst:1351 msgid "" "SQLite natively supports the following types: ``NULL``, ``INTEGER``, " "``REAL``, ``TEXT``, ``BLOB``." msgstr "" -#: ../../library/sqlite3.rst:1356 +#: ../../library/sqlite3.rst:1354 msgid "" "The following Python types can thus be sent to SQLite without any problem:" msgstr "" -#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 +#: ../../library/sqlite3.rst:1357 ../../library/sqlite3.rst:1374 msgid "Python type" msgstr "" -#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 +#: ../../library/sqlite3.rst:1357 ../../library/sqlite3.rst:1374 msgid "SQLite type" msgstr "" -#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 msgid "``None``" msgstr "" -#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 +#: ../../library/sqlite3.rst:1359 ../../library/sqlite3.rst:1376 msgid "``NULL``" msgstr "``NULL``" -#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 +#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 msgid ":class:`int`" msgstr ":class:`int`" -#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 +#: ../../library/sqlite3.rst:1361 ../../library/sqlite3.rst:1378 msgid "``INTEGER``" msgstr "``INTEGER``" -#: ../../library/sqlite3.rst:1365 ../../library/sqlite3.rst:1382 +#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 msgid ":class:`float`" msgstr ":class:`float`" -#: ../../library/sqlite3.rst:1365 ../../library/sqlite3.rst:1382 +#: ../../library/sqlite3.rst:1363 ../../library/sqlite3.rst:1380 msgid "``REAL``" msgstr "``REAL``" -#: ../../library/sqlite3.rst:1367 +#: ../../library/sqlite3.rst:1365 msgid ":class:`str`" msgstr ":class:`str`" -#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1384 +#: ../../library/sqlite3.rst:1365 ../../library/sqlite3.rst:1382 msgid "``TEXT``" msgstr "``TEXT``" -#: ../../library/sqlite3.rst:1369 ../../library/sqlite3.rst:1387 +#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1385 msgid ":class:`bytes`" msgstr ":class:`bytes`" -#: ../../library/sqlite3.rst:1369 ../../library/sqlite3.rst:1387 +#: ../../library/sqlite3.rst:1367 ../../library/sqlite3.rst:1385 msgid "``BLOB``" msgstr "``BLOB``" -#: ../../library/sqlite3.rst:1373 +#: ../../library/sqlite3.rst:1371 msgid "This is how SQLite types are converted to Python types by default:" msgstr "" -#: ../../library/sqlite3.rst:1384 +#: ../../library/sqlite3.rst:1382 msgid "depends on :attr:`~Connection.text_factory`, :class:`str` by default" msgstr "" -#: ../../library/sqlite3.rst:1390 +#: ../../library/sqlite3.rst:1388 msgid "" "The type system of the :mod:`!sqlite3` module is extensible in two ways: you " "can store additional Python types in an SQLite database via :ref:`object " @@ -1314,42 +1314,42 @@ msgid "" "converters>`." msgstr "" -#: ../../library/sqlite3.rst:1400 +#: ../../library/sqlite3.rst:1398 msgid "Default adapters and converters" msgstr "" -#: ../../library/sqlite3.rst:1402 +#: ../../library/sqlite3.rst:1400 msgid "" "There are default adapters for the date and datetime types in the datetime " "module. They will be sent as ISO dates/ISO timestamps to SQLite." msgstr "" -#: ../../library/sqlite3.rst:1405 +#: ../../library/sqlite3.rst:1403 msgid "" "The default converters are registered under the name \"date\" for :class:" "`datetime.date` and under the name \"timestamp\" for :class:`datetime." "datetime`." msgstr "" -#: ../../library/sqlite3.rst:1409 +#: ../../library/sqlite3.rst:1407 msgid "" "This way, you can use date/timestamps from Python without any additional " "fiddling in most cases. The format of the adapters is also compatible with " "the experimental SQLite date/time functions." msgstr "" -#: ../../library/sqlite3.rst:1413 +#: ../../library/sqlite3.rst:1411 msgid "The following example demonstrates this." msgstr "" -#: ../../library/sqlite3.rst:1417 +#: ../../library/sqlite3.rst:1415 msgid "" "If a timestamp stored in SQLite has a fractional part longer than 6 numbers, " "its value will be truncated to microsecond precision by the timestamp " "converter." msgstr "" -#: ../../library/sqlite3.rst:1423 +#: ../../library/sqlite3.rst:1421 msgid "" "The default \"timestamp\" converter ignores UTC offsets in the database and " "always returns a naive :class:`datetime.datetime` object. To preserve UTC " @@ -1357,15 +1357,15 @@ msgid "" "offset-aware converter with :func:`register_converter`." msgstr "" -#: ../../library/sqlite3.rst:1432 +#: ../../library/sqlite3.rst:1430 msgid "How-to guides" msgstr "" -#: ../../library/sqlite3.rst:1437 +#: ../../library/sqlite3.rst:1435 msgid "How to use placeholders to bind values in SQL queries" msgstr "" -#: ../../library/sqlite3.rst:1439 +#: ../../library/sqlite3.rst:1437 msgid "" "SQL operations usually need to use values from Python variables. However, " "beware of using Python's string operations to assemble queries, as they are " @@ -1373,7 +1373,7 @@ msgid "" "com/327/>`_ for a humorous example of what can go wrong)::" msgstr "" -#: ../../library/sqlite3.rst:1448 +#: ../../library/sqlite3.rst:1446 msgid "" "Instead, use the DB-API's parameter substitution. To insert a variable into " "a query string, use a placeholder in the string, and substitute the actual " @@ -1389,18 +1389,18 @@ msgid "" "ignored. Here's an example of both styles:" msgstr "" -#: ../../library/sqlite3.rst:1490 +#: ../../library/sqlite3.rst:1488 msgid "How to adapt custom Python types to SQLite values" msgstr "" -#: ../../library/sqlite3.rst:1492 +#: ../../library/sqlite3.rst:1490 msgid "" "SQLite supports only a limited set of data types natively. To store custom " "Python types in SQLite databases, *adapt* them to one of the :ref:`Python " "types SQLite natively understands `." msgstr "" -#: ../../library/sqlite3.rst:1496 +#: ../../library/sqlite3.rst:1494 msgid "" "There are two ways to adapt Python objects to SQLite types: letting your " "object adapt itself, or using an *adapter callable*. The latter will take " @@ -1410,11 +1410,11 @@ msgid "" "custom adapter functions." msgstr "" -#: ../../library/sqlite3.rst:1508 +#: ../../library/sqlite3.rst:1506 msgid "How to write adaptable objects" msgstr "" -#: ../../library/sqlite3.rst:1510 +#: ../../library/sqlite3.rst:1508 msgid "" "Suppose we have a :class:`!Point` class that represents a pair of " "coordinates, ``x`` and ``y``, in a Cartesian coordinate system. The " @@ -1424,84 +1424,84 @@ msgid "" "object passed to *protocol* will be of type :class:`PrepareProtocol`." msgstr "" -#: ../../library/sqlite3.rst:1541 +#: ../../library/sqlite3.rst:1539 msgid "How to register adapter callables" msgstr "" -#: ../../library/sqlite3.rst:1543 +#: ../../library/sqlite3.rst:1541 msgid "" "The other possibility is to create a function that converts the Python " "object to an SQLite-compatible type. This function can then be registered " "using :func:`register_adapter`." msgstr "" -#: ../../library/sqlite3.rst:1573 +#: ../../library/sqlite3.rst:1571 msgid "How to convert SQLite values to custom Python types" msgstr "" -#: ../../library/sqlite3.rst:1575 +#: ../../library/sqlite3.rst:1573 msgid "" "Writing an adapter lets you convert *from* custom Python types *to* SQLite " "values. To be able to convert *from* SQLite values *to* custom Python types, " "we use *converters*." msgstr "" -#: ../../library/sqlite3.rst:1580 +#: ../../library/sqlite3.rst:1578 msgid "" "Let's go back to the :class:`!Point` class. We stored the x and y " "coordinates separated via semicolons as strings in SQLite." msgstr "" -#: ../../library/sqlite3.rst:1583 +#: ../../library/sqlite3.rst:1581 msgid "" "First, we'll define a converter function that accepts the string as a " "parameter and constructs a :class:`!Point` object from it." msgstr "" -#: ../../library/sqlite3.rst:1588 +#: ../../library/sqlite3.rst:1586 msgid "" "Converter functions are **always** passed a :class:`bytes` object, no matter " "the underlying SQLite data type." msgstr "" -#: ../../library/sqlite3.rst:1597 +#: ../../library/sqlite3.rst:1595 msgid "" "We now need to tell :mod:`!sqlite3` when it should convert a given SQLite " "value. This is done when connecting to a database, using the *detect_types* " "parameter of :func:`connect`. There are three options:" msgstr "" -#: ../../library/sqlite3.rst:1601 +#: ../../library/sqlite3.rst:1599 msgid "Implicit: set *detect_types* to :const:`PARSE_DECLTYPES`" msgstr "" -#: ../../library/sqlite3.rst:1602 +#: ../../library/sqlite3.rst:1600 msgid "Explicit: set *detect_types* to :const:`PARSE_COLNAMES`" msgstr "" -#: ../../library/sqlite3.rst:1603 +#: ../../library/sqlite3.rst:1601 msgid "" "Both: set *detect_types* to ``sqlite3.PARSE_DECLTYPES | sqlite3." "PARSE_COLNAMES``. Column names take precedence over declared types." msgstr "" -#: ../../library/sqlite3.rst:1607 +#: ../../library/sqlite3.rst:1605 msgid "The following example illustrates the implicit and explicit approaches:" msgstr "" -#: ../../library/sqlite3.rst:1658 +#: ../../library/sqlite3.rst:1656 msgid "Adapter and converter recipes" msgstr "" -#: ../../library/sqlite3.rst:1660 +#: ../../library/sqlite3.rst:1658 msgid "This section shows recipes for common adapters and converters." msgstr "" -#: ../../library/sqlite3.rst:1703 +#: ../../library/sqlite3.rst:1701 msgid "How to use connection shortcut methods" msgstr "" -#: ../../library/sqlite3.rst:1705 +#: ../../library/sqlite3.rst:1703 msgid "" "Using the :meth:`~Connection.execute`, :meth:`~Connection.executemany`, and :" "meth:`~Connection.executescript` methods of the :class:`Connection` class, " @@ -1513,11 +1513,11 @@ msgid "" "object." msgstr "" -#: ../../library/sqlite3.rst:1746 +#: ../../library/sqlite3.rst:1744 msgid "How to use the connection context manager" msgstr "" -#: ../../library/sqlite3.rst:1748 +#: ../../library/sqlite3.rst:1746 msgid "" "A :class:`Connection` object can be used as a context manager that " "automatically commits or rolls back open transactions when leaving the body " @@ -1527,61 +1527,61 @@ msgid "" "exception, the transaction is rolled back." msgstr "" -#: ../../library/sqlite3.rst:1757 +#: ../../library/sqlite3.rst:1755 msgid "" "If there is no open transaction upon leaving the body of the ``with`` " "statement, the context manager is a no-op." msgstr "" -#: ../../library/sqlite3.rst:1762 +#: ../../library/sqlite3.rst:1760 msgid "" "The context manager neither implicitly opens a new transaction nor closes " "the connection." msgstr "" -#: ../../library/sqlite3.rst:1795 +#: ../../library/sqlite3.rst:1793 msgid "How to work with SQLite URIs" msgstr "" -#: ../../library/sqlite3.rst:1797 +#: ../../library/sqlite3.rst:1795 msgid "Some useful URI tricks include:" msgstr "" -#: ../../library/sqlite3.rst:1799 +#: ../../library/sqlite3.rst:1797 msgid "Open a database in read-only mode:" msgstr "" -#: ../../library/sqlite3.rst:1808 +#: ../../library/sqlite3.rst:1806 msgid "" "Do not implicitly create a new database file if it does not already exist; " "will raise :exc:`~sqlite3.OperationalError` if unable to create a new file:" msgstr "" -#: ../../library/sqlite3.rst:1818 +#: ../../library/sqlite3.rst:1816 msgid "Create a shared named in-memory database:" msgstr "" -#: ../../library/sqlite3.rst:1832 +#: ../../library/sqlite3.rst:1830 msgid "" "More information about this feature, including a list of parameters, can be " "found in the `SQLite URI documentation`_." msgstr "" -#: ../../library/sqlite3.rst:1841 +#: ../../library/sqlite3.rst:1839 msgid "Explanation" msgstr "解釋" -#: ../../library/sqlite3.rst:1846 +#: ../../library/sqlite3.rst:1844 msgid "Transaction control" msgstr "" -#: ../../library/sqlite3.rst:1848 +#: ../../library/sqlite3.rst:1846 msgid "" "The :mod:`!sqlite3` module does not adhere to the transaction handling " "recommended by :pep:`249`." msgstr "" -#: ../../library/sqlite3.rst:1851 +#: ../../library/sqlite3.rst:1849 msgid "" "If the connection attribute :attr:`~Connection.isolation_level` is not " "``None``, new transactions are implicitly opened before :meth:`~Cursor." @@ -1594,7 +1594,7 @@ msgid "" "attribute." msgstr "" -#: ../../library/sqlite3.rst:1863 +#: ../../library/sqlite3.rst:1861 msgid "" "If :attr:`~Connection.isolation_level` is set to ``None``, no transactions " "are implicitly opened at all. This leaves the underlying SQLite library in " @@ -1604,14 +1604,14 @@ msgid "" "in_transaction` attribute." msgstr "" -#: ../../library/sqlite3.rst:1871 +#: ../../library/sqlite3.rst:1869 msgid "" "The :meth:`~Cursor.executescript` method implicitly commits any pending " "transaction before execution of the given SQL script, regardless of the " "value of :attr:`~Connection.isolation_level`." msgstr "" -#: ../../library/sqlite3.rst:1875 +#: ../../library/sqlite3.rst:1873 msgid "" ":mod:`!sqlite3` used to implicitly commit an open transaction before DDL " "statements. This is no longer the case." From 97d529b1ff40ad9192ba7486bddb6d7a9175370b Mon Sep 17 00:00:00 2001 From: "Wei-Hsiang (Matt) Wang" Date: Wed, 14 Sep 2022 18:29:58 +0800 Subject: [PATCH 6/6] fix(library/asyncio-future): resolve fuzzy entry --- library/asyncio-future.po | 1 - 1 file changed, 1 deletion(-) diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 0f735844e1..1c6def3cb2 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -99,7 +99,6 @@ msgid "" msgstr "請見 :func:`create_task` 函式,它是建立新 Task 的推薦方法。" #: ../../library/asyncio-future.rst:57 -#, fuzzy msgid "" "Save a reference to the result of this function, to avoid a task " "disappearing mid-execution."