@@ -30,23 +30,23 @@ msgstr "**源码:** :source:`Lib/asyncio/events.py`"
3030msgid ""
3131"The event loop is the central execution device provided by :mod:`asyncio`. "
3232"It provides multiple facilities, including:"
33- msgstr "事件循环是的核心调度器,由 :mod: `asyncio` 提供。它提供了多种设施,包括:"
33+ msgstr "事件循环是的核心调度器,由 :mod: `asyncio` 提供。它提供了多种设施,包括:"
3434
3535#: ../../library/asyncio-eventloop.rst:13
3636msgid "Registering, executing and cancelling delayed calls (timeouts)."
37- msgstr "注册,执行和取消(超时)需要延后执行的Future/Callback 。"
37+ msgstr "注册,执行和取消(超时)需要延后执行的futures/callbacks 。"
3838
3939#: ../../library/asyncio-eventloop.rst:15
4040msgid ""
4141"Creating client and server :ref:`transports <asyncio-transport>` for various"
4242" kinds of communication."
43- msgstr "关于创建各种类型的客户端和服务端,参见 :ref:`transports` <asyncio-transport>的文档。"
43+ msgstr "关于创建各种类型的客户端和服务端,参见 :ref:`transports <asyncio-transport>` 的文档。"
4444
4545#: ../../library/asyncio-eventloop.rst:18
4646msgid ""
4747"Launching subprocesses and the associated :ref:`transports <asyncio-"
4848"transport>` for communication with an external program."
49- msgstr ""
49+ msgstr "启动子进程和相关 :ref:`transports <asyncio-transport>` 以与外部程序进行通信。 "
5050
5151#: ../../library/asyncio-eventloop.rst:21
5252msgid "Delegating costly function calls to a pool of threads."
@@ -60,21 +60,21 @@ msgid ""
6060"use :class:`AbstractEventLoop` instead. ``BaseEventLoop`` should not be "
6161"subclassed by third-party code; the internal interface is not stable."
6262msgstr ""
63- "这个类是一个实现类。它是 :class:`AbstractEventLoop`的一个子类,也可能是 "
64- ":mod:`asyncio` 中某个具体事件循环实现的基类。它不能被直接使用 ;使用 :class:`AbstractEventLoop` 代替。 "
65- "``BaseEventLoop`` 不应由第三方直接作为基类使用;它内部的接口还不稳定。"
63+ "这个类是一个实现类。它是 :class:`AbstractEventLoop` 的一个子类,也可能是 :mod:`asyncio` "
64+ "中某个具体事件循环实现的基类。它不应被直接使用 ;使用 :class:`AbstractEventLoop` 代替。 ``BaseEventLoop`` "
65+ "不应由第三方直接作为基类使用;它内部的接口还不稳定。"
6666
6767#: ../../library/asyncio-eventloop.rst:34
6868msgid "Abstract base class of event loops."
6969msgstr "事件循环的抽象基类。"
7070
7171#: ../../library/asyncio-eventloop.rst:36
7272msgid "This class is :ref:`not thread safe <asyncio-multithreading>`."
73- msgstr "这个类 :ref:`not thread safe `。"
73+ msgstr "这个类 :ref:`不是线程安全的 <asyncio-multithreading> `。"
7474
7575#: ../../library/asyncio-eventloop.rst:39
7676msgid "Run an event loop"
77- msgstr "运行一个事件循环 。"
77+ msgstr "启动一个事件循环 。"
7878
7979#: ../../library/asyncio-eventloop.rst:43
8080msgid ""
@@ -87,20 +87,21 @@ msgid ""
8787"will not run in that case; they will run the next time :meth:`run_forever` "
8888"is called."
8989msgstr ""
90- " :meth:`stop` 执行前会一直运行。如果 :meth:`stop` 在 :meth:`run_forever()` 之前被执行,将轮询I/O"
91- " selector一次并且超时为0,执行所有回调以响应I/O事件(如果这些是已经被调度过的),然后退出。如果在 :meth:`run_forever` "
92- "运行时调用 :meth:`stop` ,将会运行当前批次的回调并退出。注意在在这种情况下回调内新增的需要执行的回调是不会执行的;它们会在下次运行 "
93- ":meth:`run_forever` 时执行。"
90+ "一直运行直到 :meth:`stop` 被调用。如果 :meth:`stop` 在 :meth:`run_forever()` "
91+ "之前被执行,将轮询I/O selector一次并且超时为0,执行所有回调以响应I/O事件(如果这些是已经被调度过的),然后退出。如果在 "
92+ ":meth:`run_forever` 运行时调用 :meth:`stop` "
93+ ",将会运行当前批次的回调并退出。注意在在这种情况下回调内新增的需要执行的回调是不会执行的;它们会在下次运行 :meth:`run_forever` "
94+ "时执行。"
9495
9596#: ../../library/asyncio-eventloop.rst:56
9697msgid "Run until the :class:`Future` is done."
97- msgstr "直到 :class:`Future` 完成前,一直执行 。"
98+ msgstr "一直运行直到 :class:`Future` 完成 。"
9899
99100#: ../../library/asyncio-eventloop.rst:58
100101msgid ""
101102"If the argument is a :ref:`coroutine object <coroutine>`, it is wrapped by "
102103":func:`ensure_future`."
103- msgstr "如果参数是一个 :ref:`coroutine object ` ,它会被 :func:`ensure_future` 包装。"
104+ msgstr "如果参数是一个 :ref:`协程对象< coroutine>` ,它会被 :func:`ensure_future` 包装。"
104105
105106#: ../../library/asyncio-eventloop.rst:61
106107msgid "Return the Future's result, or raise its exception."
@@ -128,7 +129,7 @@ msgstr "如果事件循环关闭,返回 ``True`` 。"
128129msgid ""
129130"Close the event loop. The loop must not be running. Pending callbacks will "
130131"be lost."
131- msgstr ""
132+ msgstr "关掉事件循环。循环不应该正在运行。Pending状态的回调会丢失。 "
132133
133134#: ../../library/asyncio-eventloop.rst:87
134135msgid ""
@@ -153,7 +154,7 @@ msgstr ""
153154
154155#: ../../library/asyncio-eventloop.rst:114
155156msgid "Calls"
156- msgstr "调用 "
157+ msgstr "注册回调 "
157158
158159#: ../../library/asyncio-eventloop.rst:116
159160msgid ""
@@ -162,9 +163,9 @@ msgid ""
162163"``loop.call_soon(functools.partial(print, \" Hello\" , flush=True))`` will "
163164"call ``print(\" Hello\" , flush=True)``."
164165msgstr ""
165- "大多 :mod:`asyncio` 函数不支持关键字参数。如果你想给回调传递关键字参数,使用 "
166- ":func:`functools.partial`。比如, ``loop.call_soon(functools.partial(print, "
167- "\" Hello \" , flush=True))`` 将会调用 ``print(\" Hello\" , flush=True)`` 。"
166+ "大多 :mod:`asyncio` 函数不支持关键字参数。如果你想给回调传递关键字参数,使用 :func:`functools.partial`。比如, "
167+ " ``loop.call_soon(functools.partial(print, \" Hello \" , flush=True))`` 将会调用 "
168+ "``print(\" Hello\" , flush=True)`` 。"
168169
169170#: ../../library/asyncio-eventloop.rst:122
170171msgid ""
@@ -174,7 +175,7 @@ msgid ""
174175"representation."
175176msgstr ""
176177":func:`functools.partial` 要好于 ``lambda`` 函数,因为在调试模式, :mod:`asyncio` 可以检查 "
177- ":func:`functools.partial` 对象并显示它的参数,而 ``lambda`` 函数的表示性很查 。"
178+ ":func:`functools.partial` 对象并显示它的参数,而 ``lambda`` 函数的表示性很差 。"
178179
179180#: ../../library/asyncio-eventloop.rst:129
180181msgid ""
@@ -213,21 +214,21 @@ msgstr "返回一个可以用来取消回调的 :class:`asyncio.Handle` 类的
213214msgid ""
214215":ref:`Use functools.partial to pass keywords to the callback <asyncio-pass-"
215216"keywords>`."
216- msgstr ":ref:`Use functools.partial to pass keywords to the callback `。"
217+ msgstr ":ref:`使用functools.partial给回调传递关键字参数<asyncio- pass- keywords> `。"
217218
218219#: ../../library/asyncio-eventloop.rst:148
219220msgid "Like :meth:`call_soon`, but thread safe."
220- msgstr "类似 :meth:`call_soon`,但是该函数是线程安全 。"
221+ msgstr "类似 :meth:`call_soon`,但是该函数是线程安全的 。"
221222
222223#: ../../library/asyncio-eventloop.rst:150
223224msgid ""
224225"See the :ref:`concurrency and multithreading <asyncio-multithreading>` "
225226"section of the documentation."
226- msgstr "查看 :ref:`concurrency and multithreading ` 章节的文档。"
227+ msgstr "查看 :ref:`并发和多进程<asyncio- multithreading> ` 章节的文档。"
227228
228229#: ../../library/asyncio-eventloop.rst:157
229230msgid "Delayed calls"
230- msgstr "延后的调用。 "
231+ msgstr "延后的回调 "
231232
232233#: ../../library/asyncio-eventloop.rst:159
233234msgid ""
@@ -242,37 +243,39 @@ msgstr ""
242243#: ../../library/asyncio-eventloop.rst:166
243244msgid ""
244245"Timeouts (relative *delay* or absolute *when*) should not exceed one day."
245- msgstr "超时(相对*延迟 * 或者 绝对*时间* )不能超过一天。"
246+ msgstr "超时(相对 *delay * 或者 绝对 *when* )不能超过一天。"
246247
247248#: ../../library/asyncio-eventloop.rst:171
248249msgid ""
249250"Arrange for the *callback* to be called after the given *delay* seconds "
250251"(either an int or float)."
251- msgstr "安排*回调* 在给定的*延迟*秒(无论是int还是float)之后被调用 。"
252+ msgstr "在给定的 *delay* 秒(可以是int或者float)之后执行 *callback* 。"
252253
253254#: ../../library/asyncio-eventloop.rst:177
254255msgid ""
255256"*callback* will be called exactly once per call to :meth:`call_later`. If "
256257"two callbacks are scheduled for exactly the same time, it is undefined which"
257258" will be called first."
258259msgstr ""
259- "*callback* 只在每次执行 :meth:`call_later` 后调用一次 。如果两个回调在相同的时间被调度,并没有定义哪个会先调用 。"
260+ "*callback* 只在每次执行 :meth:`call_later` 后执行一次 。如果两个回调在相同的时间被调度,并没有定义哪个会先执行 。"
260261
261262#: ../../library/asyncio-eventloop.rst:181
262263msgid ""
263264"The optional positional *args* will be passed to the callback when it is "
264265"called. If you want the callback to be called with some named arguments, use"
265266" a closure or :func:`functools.partial`."
266267msgstr ""
267- "可选的位置参数会在回调函数被调用时传递给回调 。如果你想要传递给回调函数一下命名参数,需要使用闭包或者 "
268+ "可选的位置参数 *args* 会在回调函数被调用时传递给回调 。如果你想要传递给回调函数一下命名参数,需要使用闭包或者 "
268269":func:`functools.partial`。"
269270
270271#: ../../library/asyncio-eventloop.rst:190
271272msgid ""
272273"Arrange for the *callback* to be called at the given absolute timestamp "
273274"*when* (an int or float), using the same time reference as "
274275":meth:`AbstractEventLoop.time`."
275- msgstr "使用与 :meth:`AbstractEventLoop.time`相同的时间引用,安排回调函数在给定的绝对*时间*(整数或浮点)调用。"
276+ msgstr ""
277+ "使用与 :meth:`AbstractEventLoop.time` 相同的时间,在给定的绝对时间戳 *when* (整数或浮点)执行 "
278+ "*callback* 。"
276279
277280#: ../../library/asyncio-eventloop.rst:194
278281msgid "This method's behavior is the same as :meth:`call_later`."
@@ -286,15 +289,15 @@ msgstr "根据事件循环的内部时钟,将当前时间返回为 :class:`flo
286289
287290#: ../../library/asyncio-eventloop.rst:209
288291msgid "The :func:`asyncio.sleep` function."
289- msgstr " :func:`asyncio.sleep` 函数"
292+ msgstr ":func:`asyncio.sleep` 函数"
290293
291294#: ../../library/asyncio-eventloop.rst:213
292295msgid "Futures"
293296msgstr "Futures"
294297
295298#: ../../library/asyncio-eventloop.rst:217
296299msgid "Create an :class:`asyncio.Future` object attached to the loop."
297- msgstr "创建一个 :class:`asyncio.Future` 类的示例对象并注册到事件循环上 。"
300+ msgstr "创建一个 :class:`asyncio.Future` 类的实例对象并注册到事件循环上 。"
298301
299302#: ../../library/asyncio-eventloop.rst:219
300303msgid ""
@@ -312,8 +315,7 @@ msgid ""
312315"Schedule the execution of a :ref:`coroutine object <coroutine>`: wrap it in "
313316"a future. Return a :class:`Task` object."
314317msgstr ""
315- "将一个可执行的协程对象 :ref:`coroutine object `: 包装成一个 future。 返回一个 :class:`Task` "
316- "类型的对象。"
318+ "调度一个可执行的 :ref:`协程对象<coroutine>`: 包装成一个future。返回一个 :class:`Task` 类型的对象。"
317319
318320#: ../../library/asyncio-eventloop.rst:234
319321msgid ""
@@ -347,12 +349,12 @@ msgid ""
347349"will be a coroutine object. The callable must return an "
348350":class:`asyncio.Future` compatible object."
349351msgstr ""
350- "如果 *factory* 是一个 *可调用*的对象,它的签名需要符合``(loop, coro)``, *loop*是当前激活的事件循环, "
351- "*coro*是一个协程对象。返回一个与类 :class:`asyncio.Future` 兼容的对象。"
352+ "如果 *factory* 是一个 *可调用* 的对象,它的签名需要符合 ``(loop, coro)``, *loop* 是当前激活的事件循环, "
353+ "*coro* 是一个协程对象。返回一个与类 :class:`asyncio.Future` 兼容的对象。"
352354
353355#: ../../library/asyncio-eventloop.rst:259
354356msgid "Return a task factory, or ``None`` if the default one is in use."
355- msgstr "返回创建task的工厂函数,使用默认工厂函数时返回``None``。"
357+ msgstr "返回创建task的工厂函数,使用默认工厂函数时返回 ``None``。"
356358
357359#: ../../library/asyncio-eventloop.rst:265
358360msgid "Creating connections"
@@ -367,8 +369,8 @@ msgid ""
367369"callable returning a :ref:`protocol <asyncio-protocol>` instance."
368370msgstr ""
369371"同给定的 *host* 和 *port* 建立一个流式传输链接:套接字族是 :py:data:`~socket.AF_INET` 或者 "
370- ":py:data:`~socket.AF_INET6` 由 *host*(或者指定的*family*)确定,套接字类型 "
371- ":py:data:`~socket.SOCK_STREAM`。 *protocol_factory* 需要是可调用对象,并返回一个 "
372+ ":py:data:`~socket.AF_INET6` 由 *host* (或者指定的 *family* )确定,套接字类型 "
373+ ":py:data:`~socket.SOCK_STREAM`。 *protocol_factory* 需要是可调用对象,并返回一个 "
372374":ref:`protocol<asyncio-protocol>` 实例。"
373375
374376#: ../../library/asyncio-eventloop.rst:275
@@ -379,8 +381,7 @@ msgid ""
379381"the connection in the background. When successful, the coroutine returns a "
380382"``(transport, protocol)`` pair."
381383msgstr ""
382- " 这个方法是 :ref:`协程<coroutine> ` ,尝试在后台建立链接。成功时,协程返回一个 ``(transport, protocol)``"
383- " 对。"
384+ "这个方法是一个 :ref:`协程<coroutine>`。它尝试在后台建立链接,成功时返回一对 ``(transport, protocol)`` 。"
384385
385386#: ../../library/asyncio-eventloop.rst:279
386387msgid "The chronological synopsis of the underlying operation is as follows:"
@@ -407,7 +408,7 @@ msgstr "协议实例绑定到transport,并调用它的 :meth:`connection_made`
407408#: ../../library/asyncio-eventloop.rst:290
408409msgid ""
409410"The coroutine returns successfully with the ``(transport, protocol)`` pair."
410- msgstr "协程成功时会返回 ``(transport, protocol)`` 对 。"
411+ msgstr "成功时会返回一对 ``(transport, protocol)`` 。"
411412
412413#: ../../library/asyncio-eventloop.rst:293
413414msgid ""
@@ -434,13 +435,13 @@ msgid ""
434435"object, this context is used to create the transport; if *ssl* is "
435436":const:`True`, a context with some unspecified default settings is used."
436437msgstr ""
437- "*ssl*:指定,并且不是假 ,会创建一个SSL/TLS transport(默认情况下会创建一个纯TCP传输)。如果 *ssl* 是一个类 "
438- ":class:`ssl.SSLContext` 的对象 ,此上下文用于创建transport;如果 *ssl* 是 :const:`True` "
438+ "*ssl*:指定,并且不为假 ,会创建一个SSL/TLS transport(默认情况下会创建一个纯TCP传输)。如果 *ssl* 是 "
439+ ":class:`ssl.SSLContext` 类型的对象 ,此上下文用于创建transport;如果 *ssl* 是 :const:`True` "
439440"使用默认设置的上下文。"
440441
441442#: ../../library/asyncio-eventloop.rst:308
442443msgid ":ref:`SSL/TLS security considerations <ssl-security>`"
443- msgstr ":ref:`SSL/TLS 安全事项 <ssl-security> `"
444+ msgstr ":ref:`SSL/TLS安全事项 <ssl-security>`"
444445
445446#: ../../library/asyncio-eventloop.rst:310
446447msgid ""
@@ -451,8 +452,8 @@ msgid ""
451452" If *server_hostname* is an empty string, hostname matching is disabled "
452453"(which is a serious security risk, allowing for man-in-the-middle-attacks)."
453454msgstr ""
454- "*server_hostname*只和 *ssl*一起使用,并设置或覆盖目标服务器证书将与之匹配的主机名。默认情况下使用 *host* 参数的值。如果 "
455- "*host* 为空,没有默认值, 你必须为*server_hostname*设置一个值。如果 *server_hostname* "
455+ "*server_hostname* 只能和 *ssl* 一起使用,并设置或覆盖目标服务器证书将与之匹配的主机名。默认情况下使用 *host* "
456+ "参数的值。如果 *host* 为空,你必须为 *server_hostname* 设置一个值。如果 *server_hostname* "
456457"是空字符串,主机名匹配被禁用(这是一种严重的安全风险,允许进行中间人攻击)。"
457458
458459#: ../../library/asyncio-eventloop.rst:318
@@ -462,8 +463,8 @@ msgid ""
462463" these should all be integers from the corresponding :mod:`socket` module "
463464"constants."
464465msgstr ""
465- "*family*, *proto*, *flags* 是可选的地址族,协议和标志,通过 getaddrinfo() 传递给 "
466- "*host*解析 。如果给出,这些应该都是来自相应的 :mod:`socket` 模块常量的整数 。"
466+ "*family*,*proto*,*flags* 是可选的地址族,协议和标志,通过传递给 getaddrinfo() 来解析 "
467+ "*host*。如果给出,这些应该都是来自 :mod:`socket` 模块相应的常量的整数 。"
467468
468469#: ../../library/asyncio-eventloop.rst:323
469470msgid ""
@@ -473,28 +474,30 @@ msgid ""
473474"should be specified."
474475msgstr ""
475476"*sock*,如果给出的话,应该是一个现有的,已经连接的 :class:`socket.socket` "
476- "对象,这个对象将被transport使用。如果给出 *sock*,则*host "
477- "*,*port*,*family*,*proto*,*flags*和* local_addr*中的任何一个都不应该指定。"
477+ "对象,这个对象将被transport使用。如果给出 *sock*,则 *host*,*port*,*family*,*proto*,*flags* 和 "
478+ "*local_addr* 中的任何一个都不应该指定。"
478479
479480#: ../../library/asyncio-eventloop.rst:328
480481msgid ""
481482"*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind"
482483" the socket to locally. The *local_host* and *local_port* are looked up "
483484"using getaddrinfo(), similarly to *host* and *port*."
484485msgstr ""
485- "*local_addr*,如果给定的话,是一个 ``(local_host,local_port)`` 元组,用于在本地绑定套接字。使用 "
486+ "*local_addr*,如果给定的话,应是一个 ``(local_host,local_port)`` 元组,用于在本地绑定套接字。使用 "
486487"getaddrinfo() 查找 *local_host* 和 *local_port*,与 *host* 和 *port* 类似。"
487488
488489#: ../../library/asyncio-eventloop.rst:334
489490#: ../../library/asyncio-eventloop.rst:464
490491msgid "On Windows with :class:`ProactorEventLoop`, SSL/TLS is now supported."
491- msgstr ""
492+ msgstr "在Windows平台上, :class:`ProactorEventLoop` 支持SSL/TLS了。 "
492493
493494#: ../../library/asyncio-eventloop.rst:338
494495msgid ""
495496"The :func:`open_connection` function can be used to get a pair of "
496497"(:class:`StreamReader`, :class:`StreamWriter`) instead of a protocol."
497498msgstr ""
499+ "可以使用 :func:`open_connection` 函数获取一对(:class:`StreamReader`, "
500+ ":class:`StreamWriter`) 代替一个protocol。"
498501
499502#: ../../library/asyncio-eventloop.rst:344
500503msgid ""
0 commit comments