Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 33051fd

Browse files
[po] auto sync
1 parent 43e6b1c commit 33051fd

4 files changed

Lines changed: 69 additions & 29 deletions

File tree

library/contextlib.po

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ msgid ""
158158
"Similar to :func:`~contextlib.contextmanager`, but creates an "
159159
":ref:`asynchronous context manager <async-context-managers>`."
160160
msgstr ""
161+
"与 :func:`~contextlib.contextmanager` 类似,但创建的是一个 :ref:`异步上下文管理器 <async-"
162+
"context-managers>`。"
161163

162164
#: ../../library/contextlib.rst:105
163165
msgid ""
@@ -167,26 +169,31 @@ msgid ""
167169
":meth:`__aexit__` methods. It must be applied to an :term:`asynchronous "
168170
"generator` function."
169171
msgstr ""
172+
"这个函数是一个 :term:`decorator` ,它可以定义一个支持 :keyword:`async with` 语句的异步上下文管理器的工厂函数,"
173+
" 而不需要创建一个类或区分 :meth:`__aenter__` 与 :meth:`__aexit__` 方法。它必须被作用在一个 "
174+
":term:`asynchronous generator` 函数上"
170175

171176
#: ../../library/contextlib.rst:111
172177
msgid "A simple example::"
173-
msgstr ""
178+
msgstr "一个简单的示例:"
174179

175180
#: ../../library/contextlib.rst:132
176181
msgid ""
177182
"Return a context manager that closes *thing* upon completion of the block. "
178183
"This is basically equivalent to::"
179-
msgstr ""
184+
msgstr "返回一个在语句块执行完成时关闭 *things* 的上下文管理器。这基本上等价于 ::"
180185

181186
#: ../../library/contextlib.rst:144
182187
msgid "And lets you write code like this::"
183-
msgstr ""
188+
msgstr "并允许你编写这样的代码 ::"
184189

185190
#: ../../library/contextlib.rst:153
186191
msgid ""
187192
"without needing to explicitly close ``page``. Even if an error occurs, "
188193
"``page.close()`` will be called when the :keyword:`with` block is exited."
189194
msgstr ""
195+
"而无需显式地关闭 ``page`` 。 即使发生错误,在退出 :keyword:`with` 语句块时, ``page.close()`` "
196+
"也同样会被调用。"
190197

191198
#: ../../library/contextlib.rst:161
192199
msgid ""

library/contextvars.po

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Translators:
77
# ww song <[email protected]>, 2018
88
# zeroswan <[email protected]>, 2020
9+
# Freesand Leo <[email protected]>, 2020
910
#
1011
#, fuzzy
1112
msgid ""
@@ -14,7 +15,7 @@ msgstr ""
1415
"Report-Msgid-Bugs-To: \n"
1516
"POT-Creation-Date: 2020-05-31 09:25+0000\n"
1617
"PO-Revision-Date: 2018-06-29 21:06+0000\n"
17-
"Last-Translator: zeroswan <weditor@163.com>, 2020\n"
18+
"Last-Translator: Freesand Leo <yuqinju@163.com>, 2020\n"
1819
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
1920
"MIME-Version: 1.0\n"
2021
"Content-Type: text/plain; charset=UTF-8\n"
@@ -24,7 +25,7 @@ msgstr ""
2425

2526
#: ../../library/contextvars.rst:2
2627
msgid ":mod:`contextvars` --- Context Variables"
27-
msgstr ":mod:`contextvars` 上下文变量"
28+
msgstr ":mod:`contextvars` --- 上下文变量"
2829

2930
#: ../../library/contextvars.rst:11
3031
msgid ""
@@ -124,12 +125,14 @@ msgid ""
124125
"Returns a :class:`~contextvars.Token` object that can be used to restore the"
125126
" variable to its previous value via the :meth:`ContextVar.reset` method."
126127
msgstr ""
128+
"返回一个 :class:`~contextvars.Token`  对象,可通过 :meth:`ContextVar.reset` "
129+
"方法将上下文变量还原为之前某个状态。"
127130

128131
#: ../../library/contextvars.rst:82
129132
msgid ""
130133
"Reset the context variable to the value it had before the "
131134
":meth:`ContextVar.set` that created the *token* was used."
132-
msgstr ""
135+
msgstr "将上下文变量重置为调用 :meth:`ContextVar.set` 之前、创建 *token* 时候的状态。"
133136

134137
#: ../../library/contextvars.rst:85
135138
msgid "For example::"
@@ -141,124 +144,135 @@ msgid ""
141144
"be passed to the :meth:`ContextVar.reset` method to revert the value of the "
142145
"variable to what it was before the corresponding *set*."
143146
msgstr ""
147+
":meth:`ContextVar.set` 方法返回 *Token* 对象。此对象可以传递给 :meth:`ContextVar.reset` "
148+
"方法用于将上下文变量还原为调用 *set* 前的状态。"
144149

145150
#: ../../library/contextvars.rst:106
146151
msgid ""
147152
"A read-only property. Points to the :class:`ContextVar` object that created"
148153
" the token."
149-
msgstr ""
154+
msgstr "只读属性。指向创建此 token 的 :class:`ContextVar` 对象。"
150155

151156
#: ../../library/contextvars.rst:111
152157
msgid ""
153158
"A read-only property. Set to the value the variable had before the "
154159
":meth:`ContextVar.set` method call that created the token. It points to "
155160
":attr:`Token.MISSING` is the variable was not set before the call."
156161
msgstr ""
162+
"一个只读属性。 会被设为在创建此令牌的 :meth:`ContextVar.set` 方法调用之前该变量所具有的值。 它指向的 "
163+
":attr:`Token.MISSING` 是在调用之前未设置的变量。"
157164

158165
#: ../../library/contextvars.rst:118
159166
msgid "A marker object used by :attr:`Token.old_value`."
160-
msgstr ""
167+
msgstr ":attr:`Token.old_value` 会用到的一个标记对象。"
161168

162169
#: ../../library/contextvars.rst:122
163170
msgid "Manual Context Management"
164-
msgstr ""
171+
msgstr "手动上下文管理"
165172

166173
#: ../../library/contextvars.rst:126
167174
msgid "Returns a copy of the current :class:`~contextvars.Context` object."
168-
msgstr ""
175+
msgstr "返回当前上下文中 :class:`~contextvars.Context` 对象的拷贝。"
169176

170177
#: ../../library/contextvars.rst:128
171178
msgid ""
172179
"The following snippet gets a copy of the current context and prints all "
173180
"variables and their values that are set in it::"
174-
msgstr ""
181+
msgstr "以下代码片段会获取当前上下文的拷贝并打印设置到其中的所有变量及其值::"
175182

176183
#: ../../library/contextvars.rst:134
177184
msgid ""
178185
"The function has an O(1) complexity, i.e. works equally fast for contexts "
179186
"with a few context variables and for contexts that have a lot of them."
180-
msgstr ""
187+
msgstr "此函数复杂度为 O(1) ,也就是说对于只包含几个上下文变量和很多上下文变量的情况,他们是一样快的。"
181188

182189
#: ../../library/contextvars.rst:141
183190
msgid "A mapping of :class:`ContextVars <ContextVar>` to their values."
184-
msgstr ""
191+
msgstr ":class:`ContextVars <ContextVar>` 中所有值的映射。"
185192

186193
#: ../../library/contextvars.rst:143
187194
msgid ""
188195
"``Context()`` creates an empty context with no values in it. To get a copy "
189196
"of the current context use the :func:`~contextvars.copy_context` function."
190197
msgstr ""
198+
"``Context()`` 创建一个不包含任何值的空上下文。如果要获取当前上下文的拷贝,使用 "
199+
":func:`~contextvars.copy_context` 函数。"
191200

192201
#: ../../library/contextvars.rst:147
193202
msgid "Context implements the :class:`collections.abc.Mapping` interface."
194-
msgstr ""
203+
msgstr "Context 实现了 :class:`collections.abc.Mapping` 接口。"
195204

196205
#: ../../library/contextvars.rst:151
197206
msgid ""
198207
"Execute ``callable(*args, **kwargs)`` code in the context object the *run* "
199208
"method is called on. Return the result of the execution or propagate an "
200209
"exception if one occurred."
201210
msgstr ""
211+
"按照 *run* 方法中的参数在上下文对象中执行 ``callable(*args, **kwargs)`` "
212+
"代码。返回执行结果,如果发生异常,则将异常透传出来。"
202213

203214
#: ../../library/contextvars.rst:155
204215
msgid ""
205216
"Any changes to any context variables that *callable* makes will be contained"
206217
" in the context object::"
207-
msgstr ""
218+
msgstr "*callable* 中队上下文变量做出的任何修改会保留在上下文对象中::"
208219

209220
#: ../../library/contextvars.rst:184
210221
msgid ""
211222
"The method raises a :exc:`RuntimeError` when called on the same context "
212223
"object from more than one OS thread, or when called recursively."
213-
msgstr ""
224+
msgstr "当在多个系统线程或者递归调用同一个上下文对象的此方法,抛出 :exc:`RuntimeError` 异常。"
214225

215226
#: ../../library/contextvars.rst:190
216227
msgid "Return a shallow copy of the context object."
217-
msgstr ""
228+
msgstr "返回此上下文对象的浅拷贝。"
218229

219230
#: ../../library/contextvars.rst:194
220231
msgid ""
221232
"Return ``True`` if the *context* has a value for *var* set; return ``False``"
222233
" otherwise."
223-
msgstr ""
234+
msgstr "如果*context* 中含有名称为 *var* 的变量,返回 ``True`` , 否则返回 ``False`` 。"
224235

225236
#: ../../library/contextvars.rst:199
226237
msgid ""
227238
"Return the value of the *var* :class:`ContextVar` variable. If the variable "
228239
"is not set in the context object, a :exc:`KeyError` is raised."
229240
msgstr ""
241+
"返回名称为 *var* 的 :class:`ContextVar` 变量。如果上下文对象中不包含这个变量,则抛出 :exc:`KeyError` 异常。"
230242

231243
#: ../../library/contextvars.rst:205
232244
msgid ""
233245
"Return the value for *var* if *var* has the value in the context object. "
234246
"Return *default* otherwise. If *default* is not given, return ``None``."
235247
msgstr ""
248+
"如果 *var* 在上下文对象中具有值则返回 *var* 的值。 在其他情况下返回 *default*。 如果未给出 *default* 则返回 "
249+
"``None``。"
236250

237251
#: ../../library/contextvars.rst:211
238252
msgid "Return an iterator over the variables stored in the context object."
239-
msgstr ""
253+
msgstr "返回一个存储在上下文对象中的变量的迭代器。"
240254

241255
#: ../../library/contextvars.rst:216
242256
msgid "Return the number of variables set in the context object."
243-
msgstr ""
257+
msgstr "返回上下文对象中所设的变量的数量。"
244258

245259
#: ../../library/contextvars.rst:220
246260
msgid "Return a list of all variables in the context object."
247-
msgstr ""
261+
msgstr "返回上下文对象中的所有变量的列表。"
248262

249263
#: ../../library/contextvars.rst:224
250264
msgid "Return a list of all variables' values in the context object."
251-
msgstr ""
265+
msgstr "返回上下文对象中所有变量值的列表。"
252266

253267
#: ../../library/contextvars.rst:229
254268
msgid ""
255269
"Return a list of 2-tuples containing all variables and their values in the "
256270
"context object."
257-
msgstr ""
271+
msgstr "返回包含上下文对象中所有变量及其值的 2 元组的列表。"
258272

259273
#: ../../library/contextvars.rst:234
260274
msgid "asyncio support"
261-
msgstr ""
275+
msgstr "asyncio 支持"
262276

263277
#: ../../library/contextvars.rst:236
264278
msgid ""
@@ -267,3 +281,5 @@ msgid ""
267281
" server, that uses a context variable to make the address of a remote client"
268282
" available in the Task that handles that client::"
269283
msgstr ""
284+
"上下文变量在 :mod:`asyncio` 中有原生的支持并且无需任何额外配置即可被使用。 "
285+
"例如,以下是一个简单的回显服务器,它使用上下文变量来让远程客户端的地址在处理该客户端的 Task 中可用::"

library/logging.config.po

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -882,6 +882,13 @@ msgid ""
882882
"called ``[formatter_form01]``. The root logger configuration must be "
883883
"specified in a section called ``[logger_root]``."
884884
msgstr ""
885+
":func:`fileConfig` 所能理解的配置文件格式是基于 :mod:`configparser` 功能的。 该文件必须包含 "
886+
"``[loggers]``, ``[handlers]`` 和 ``[formatters]`` 等小节,它们通过名称来标识文件中定义的每种类型的实体。"
887+
" 对于每个这样的实体,都有单独的小节来标识实体的配置方式。 因此,对于 ``[loggers]`` 小节中名为 ``log01`` "
888+
"的日志记录器,相应的配置详情保存在 ``[logger_log01]`` 小节中。 类似地,对于 ``[handlers]`` 小节中名为 "
889+
"``hand01`` 的处理程序,其配置将保存在名为 ``[handler_hand01]`` 的小节中,而对于 ``[formatters]`` "
890+
"小节中名为 ``form01`` 的格式化器,其配置将在名为 ``[formatter_form01]`` 的小节中指定。 根日志记录器的配置必须在名为"
891+
" ``[logger_root]`` 的小节中指定。"
885892

886893
#: ../../library/logging.config.rst:643
887894
msgid ""
@@ -895,16 +902,21 @@ msgid ""
895902
"functionality will be added to :func:`dictConfig`, so it's worth considering"
896903
" transitioning to this newer API when it's convenient to do so."
897904
msgstr ""
905+
":func:`fileConfig` API 比 :func:`dictConfig` API 更旧因而没有提供涵盖日志记录特定方面的功能。 "
906+
"例如,你无法配置 :class:`~logging.Filter` 对象,该对象使用 :func:`fileConfig` "
907+
"提供超出简单整数级别的消息过滤功能。 如果你想要在你的日志记录配置中包含 :class:`~logging.Filter` 的实例,你将必须使用 "
908+
":func:`dictConfig`。 请注意未来还将向 :func:`dictConfig` "
909+
"添加对配置功能的强化,因此值得考虑在方便的时候转换到这个新 API。"
898910

899911
#: ../../library/logging.config.rst:653
900912
msgid "Examples of these sections in the file are given below."
901-
msgstr ""
913+
msgstr "在文件中这些小节的例子如下所示。"
902914

903915
#: ../../library/logging.config.rst:666
904916
msgid ""
905917
"The root logger must specify a level and a list of handlers. An example of a"
906918
" root logger section is given below."
907-
msgstr ""
919+
msgstr "根日志记录器必须指定一个级别和一个处理程序列表。 根日志小节的例子如下所示。"
908920

909921
#: ../../library/logging.config.rst:675
910922
msgid ""
@@ -913,6 +925,9 @@ msgid ""
913925
"will be logged. Level values are :func:`eval`\\ uated in the context of the "
914926
"``logging`` package's namespace."
915927
msgstr ""
928+
"``level`` 条目可以为 ``DEBUG, INFO, WARNING, ERROR, CRITICAL`` 或 ``NOTSET`` 之一。 "
929+
"其中 ``NOTSET`` 仅适用于根日志记录器,表示将会记录所有消息。 级别值会在 ``logging`` 包命名空间的上下文中通过 "
930+
":func:`eval` 来得出。"
916931

917932
#: ../../library/logging.config.rst:680
918933
msgid ""
@@ -921,12 +936,13 @@ msgid ""
921936
"``[handlers]`` section and have corresponding sections in the configuration "
922937
"file."
923938
msgstr ""
939+
"``handlers`` 条目是以逗号分隔的处理程序名称列表,它必须出现于 ``[handlers]`` 小节并且在配置文件中有相应的小节。"
924940

925941
#: ../../library/logging.config.rst:685
926942
msgid ""
927943
"For loggers other than the root logger, some additional information is "
928944
"required. This is illustrated by the following example."
929-
msgstr ""
945+
msgstr "对于根日志记录器以外的日志记录器,还需要某些附加信息。 下面的例子演示了这些信息。"
930946

931947
#: ../../library/logging.config.rst:696
932948
msgid ""

library/resource.po

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# 钢 彭 <[email protected]>, 2019
1010
# Zombie110year <[email protected]>, 2019
1111
# ppcfish <[email protected]>, 2019
12+
# Heyi Tang <[email protected]>, 2020
1213
#
1314
#, fuzzy
1415
msgid ""
@@ -17,7 +18,7 @@ msgstr ""
1718
"Report-Msgid-Bugs-To: \n"
1819
"POT-Creation-Date: 2020-05-31 09:25+0000\n"
1920
"PO-Revision-Date: 2017-02-16 23:24+0000\n"
20-
"Last-Translator: ppcfish <ppcfish@gmail.com>, 2019\n"
21+
"Last-Translator: Heyi Tang <tangheyi.09@gmail.com>, 2020\n"
2122
"Language-Team: Chinese (China) (https://www.transifex.com/python-doc/teams/5390/zh_CN/)\n"
2223
"MIME-Version: 1.0\n"
2324
"Content-Type: text/plain; charset=UTF-8\n"
@@ -312,7 +313,7 @@ msgstr ""
312313

313314
#: ../../library/resource.rst:271
314315
msgid "A simple example::"
315-
msgstr ""
316+
msgstr "一个简单的示例:"
316317

317318
#: ../../library/resource.rst:285
318319
msgid ""

0 commit comments

Comments
 (0)