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

Skip to content

Commit 5c09a55

Browse files
[po] auto sync
1 parent 8c72861 commit 5c09a55

2 files changed

Lines changed: 19 additions & 11 deletions

File tree

library/asyncio-protocol.po

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -895,11 +895,13 @@ msgid ""
895895
" data. Sophisticated protocol implementations can significantly reduce the "
896896
"number of buffer allocations."
897897
msgstr ""
898+
"``BufferedProtocol`` 实现允许显式手动分配和控制接收缓冲区。 随后事件循环可以使用协议提供的缓冲区来避免不必要的数据复制。 "
899+
"这对于接收大量数据的协议来说会有明显的性能提升。 复杂的协议实现能显著地减少缓冲区分配的数量。"
898900

899901
#: ../../library/asyncio-protocol.rst:602
900902
msgid ""
901903
"The following callbacks are called on :class:`BufferedProtocol` instances:"
902-
msgstr ""
904+
msgstr "以下回调是在 :class:`BufferedProtocol` 实例上被调用的:"
903905

904906
#: ../../library/asyncio-protocol.rst:607
905907
msgid "Called to allocate a new receive buffer."
@@ -912,26 +914,28 @@ msgid ""
912914
"suggests. When set to -1, the buffer size can be arbitrary. It is an error "
913915
"to return a buffer with a zero size."
914916
msgstr ""
917+
"*sizehint* 是推荐的返回缓冲区最小尺寸。 返回小于或大于 *sizehint* 推荐尺寸的缓冲区也是可接受的。 当设为 -1 "
918+
"时,缓冲区尺寸可以是任意的。 返回尺寸为零的缓冲区则是错误的。"
915919

916920
#: ../../library/asyncio-protocol.rst:614
917921
msgid ""
918922
"``get_buffer()`` must return an object implementing the :ref:`buffer "
919923
"protocol <bufferobjects>`."
920-
msgstr ""
924+
msgstr "``get_buffer()`` 必须返回一个实现了 :ref:`缓冲区协议 <bufferobjects>` 的对象。"
921925

922926
#: ../../library/asyncio-protocol.rst:619
923927
msgid "Called when the buffer was updated with the received data."
924928
msgstr "用接收的数据更新缓冲区时被调用。"
925929

926930
#: ../../library/asyncio-protocol.rst:621
927931
msgid "*nbytes* is the total number of bytes that were written to the buffer."
928-
msgstr ""
932+
msgstr "*nbytes* 是被写入到缓冲区的字节总数。"
929933

930934
#: ../../library/asyncio-protocol.rst:625
931935
msgid ""
932936
"See the documentation of the :meth:`protocol.eof_received() "
933937
"<Protocol.eof_received>` method."
934-
msgstr ""
938+
msgstr "请查看 :meth:`protocol.eof_received() <Protocol.eof_received>` 方法的文档。"
935939

936940
#: ../../library/asyncio-protocol.rst:629
937941
msgid ""
@@ -941,6 +945,10 @@ msgid ""
941945
":meth:`~BufferedProtocol.get_buffer` and "
942946
":meth:`~BufferedProtocol.buffer_updated` won't be called after it."
943947
msgstr ""
948+
"在连接期间 :meth:`~BufferedProtocol.get_buffer` 可以被调用任意次数。 "
949+
"但是,:meth:`protocol.eof_received() <Protocol.eof_received>` "
950+
"最多只能被调用一次,如果被调用,则在此之后 :meth:`~BufferedProtocol.get_buffer` 和 "
951+
":meth:`~BufferedProtocol.buffer_updated` 不能再被调用。"
944952

945953
#: ../../library/asyncio-protocol.rst:648
946954
msgid "Datagram Protocols"
@@ -950,34 +958,34 @@ msgstr "数据报协议"
950958
msgid ""
951959
"Datagram Protocol instances should be constructed by protocol factories "
952960
"passed to the :meth:`loop.create_datagram_endpoint` method."
953-
msgstr ""
961+
msgstr "数据报协议实例应当由传递给 :meth:`loop.create_datagram_endpoint` 方法的协议工厂来构造。"
954962

955963
#: ../../library/asyncio-protocol.rst:655
956964
msgid ""
957965
"Called when a datagram is received. *data* is a bytes object containing the"
958966
" incoming data. *addr* is the address of the peer sending the data; the "
959967
"exact format depends on the transport."
960-
msgstr ""
968+
msgstr "当接收到数据报时被调用。 *data* 是包含传入数据的字节串对象。 *addr* 是发送数据的对等端地址;实际的格式取决于具体传输。"
961969

962970
#: ../../library/asyncio-protocol.rst:661
963971
msgid ""
964972
"Called when a previous send or receive operation raises an :class:`OSError`."
965973
" *exc* is the :class:`OSError` instance."
966-
msgstr ""
974+
msgstr "当前一个发送或接收操作引发 :class:`OSError` 时被调用。 *exc* 是 :class:`OSError` 的实例。"
967975

968976
#: ../../library/asyncio-protocol.rst:664
969977
msgid ""
970978
"This method is called in rare conditions, when the transport (e.g. UDP) "
971979
"detects that a datagram could not be delivered to its recipient. In many "
972980
"conditions though, undeliverable datagrams will be silently dropped."
973-
msgstr ""
981+
msgstr "此方法会在当传输(例如UDP)检测到无法将数据报传给接收方等极少数情况下被调用。 而在大多数情况下,无法送达的数据报将被静默地丢弃。"
974982

975983
#: ../../library/asyncio-protocol.rst:671
976984
msgid ""
977985
"On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for "
978986
"datagram protocols, because there is no reliable way to detect send failures"
979987
" caused by writing too many packets."
980-
msgstr ""
988+
msgstr "在 BSD 系统(macOS, FreeBSD 等等)上,数据报协议不支持流控制,因为没有可靠的方式来检测因写入多过包所导致的发送失败。"
981989

982990
#: ../../library/asyncio-protocol.rst:675
983991
msgid ""

tutorial/interpreter.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ msgid ""
154154
" module to handle."
155155
msgstr ""
156156
"如果可能的话,解释器会读取命令行参数,转化为字符串列表存入 ``sys`` 模块中的 ``argv`` 变量中。执行命令 ``import sys`` "
157-
"你可以导入这个模块并访问这个列表。这个列表最少也会有一个元素;如果没有给定输入参数,``sys.argv[0]`` "
158-
"就是个空字符串。如果脚本名是标准输入,``sys.argv[0]`` 就是 ``'-'``。使用 :option:`-c` *command* "
157+
"你可以导入这个模块并访问这个列表。这个列表最少也会有一个元素;如果没有给定输入参数,``sys.argv[0]`` 就是个空字符串。如果给定的脚本名是 "
158+
"``'-'`` (表示标准输入),``sys.argv[0]`` 就是 ``'-'``。使用 :option:`-c` *command* "
159159
"时,``sys.argv[0]`` 就会是 ``'-c'``。如果使用选项 :option:`-m` *module*,``sys.argv[0]`` "
160160
"就是包含目录的模块全名。在 :option:`-c` *command* 或 :option:`-m` *module* "
161161
"之后的选项不会被解释器处理,而会直接留在 ``sys.argv`` 中给命令或模块来处理。"

0 commit comments

Comments
 (0)