Skip to content

Commit f060abf

Browse files
github-actions[bot]mattwang44
authored andcommitted
sync with cpython 5e1bbb58
1 parent 1d34f1a commit f060abf

File tree

1 file changed

+72
-56
lines changed

1 file changed

+72
-56
lines changed

library/asyncio-stream.po

+72-56
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: Python 3.11\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2023-02-13 00:17+0000\n"
11+
"POT-Creation-Date: 2023-02-24 00:17+0000\n"
1212
"PO-Revision-Date: 2022-10-31 16:28+0800\n"
1313
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
1414
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
@@ -223,41 +223,50 @@ msgstr ""
223223
"`start_server` 會是較好的做法。"
224224

225225
#: ../../library/asyncio-stream.rst:209
226-
msgid ""
227-
"Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read until "
228-
"EOF and return all read bytes."
226+
msgid "Read up to *n* bytes from the stream."
229227
msgstr ""
230-
"讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取直"
231-
"到 EOF 並回傳所有已讀取的位元組。"
232228

233-
#: ../../library/asyncio-stream.rst:212
229+
#: ../../library/asyncio-stream.rst:211
230+
#, fuzzy
234231
msgid ""
235-
"If EOF was received and the internal buffer is empty, return an empty "
236-
"``bytes`` object."
232+
"If *n* is not provided or set to ``-1``, read until EOF, then return all "
233+
"read :class:`bytes`. If EOF was received and the internal buffer is empty, "
234+
"return an empty ``bytes`` object."
237235
msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。"
238236

239-
#: ../../library/asyncio-stream.rst:217
237+
#: ../../library/asyncio-stream.rst:216
238+
msgid "If *n* is ``0``, return an empty ``bytes`` object immediately."
239+
msgstr ""
240+
241+
#: ../../library/asyncio-stream.rst:218
242+
msgid ""
243+
"If *n* is positive, return at most *n* available ``bytes`` as soon as at "
244+
"least 1 byte is available in the internal buffer. If EOF is received before "
245+
"any byte is read, return an empty ``bytes`` object."
246+
msgstr ""
247+
248+
#: ../../library/asyncio-stream.rst:225
240249
msgid ""
241250
"Read one line, where \"line\" is a sequence of bytes ending with ``\\n``."
242251
msgstr "讀取一行,其中\"\"指的是以 ``\\n`` 結尾的位元組序列。"
243252

244-
#: ../../library/asyncio-stream.rst:220
253+
#: ../../library/asyncio-stream.rst:228
245254
msgid ""
246255
"If EOF is received and ``\\n`` was not found, the method returns partially "
247256
"read data."
248257
msgstr "如果讀取到 EOF 而沒有找到 ``\\n``,該方法會回傳部分的已讀取資料。"
249258

250-
#: ../../library/asyncio-stream.rst:223
259+
#: ../../library/asyncio-stream.rst:231
251260
msgid ""
252261
"If EOF is received and the internal buffer is empty, return an empty "
253262
"``bytes`` object."
254263
msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。"
255264

256-
#: ../../library/asyncio-stream.rst:228
265+
#: ../../library/asyncio-stream.rst:236
257266
msgid "Read exactly *n* bytes."
258267
msgstr "讀取剛好 *n* 個位元組。"
259268

260-
#: ../../library/asyncio-stream.rst:230
269+
#: ../../library/asyncio-stream.rst:238
261270
msgid ""
262271
"Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be "
263272
"read. Use the :attr:`IncompleteReadError.partial` attribute to get the "
@@ -267,19 +276,19 @@ msgstr ""
267276
"`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串"
268277
"流結束前已讀取的部分資料。"
269278

270-
#: ../../library/asyncio-stream.rst:236
279+
#: ../../library/asyncio-stream.rst:244
271280
msgid "Read data from the stream until *separator* is found."
272281
msgstr "從串流中持續讀取資料直到出現 *separator*。"
273282

274-
#: ../../library/asyncio-stream.rst:238
283+
#: ../../library/asyncio-stream.rst:246
275284
msgid ""
276285
"On success, the data and separator will be removed from the internal buffer "
277286
"(consumed). Returned data will include the separator at the end."
278287
msgstr ""
279288
"成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 "
280289
"(consumed))。回傳的資料在末尾會有一個 separator。"
281290

282-
#: ../../library/asyncio-stream.rst:242
291+
#: ../../library/asyncio-stream.rst:250
283292
msgid ""
284293
"If the amount of data read exceeds the configured stream limit, a :exc:"
285294
"`LimitOverrunError` exception is raised, and the data is left in the "
@@ -288,7 +297,7 @@ msgstr ""
288297
"如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例"
289298
"外,資料將被留在內部緩衝區中,並可以再次被讀取。"
290299

291-
#: ../../library/asyncio-stream.rst:246
300+
#: ../../library/asyncio-stream.rst:254
292301
msgid ""
293302
"If EOF is reached before the complete separator is found, an :exc:"
294303
"`IncompleteReadError` exception is raised, and the internal buffer is "
@@ -299,28 +308,28 @@ msgstr ""
299308
"`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError."
300309
"partial` 屬性可能包含一部分的 separator。"
301310

302-
#: ../../library/asyncio-stream.rst:255
311+
#: ../../library/asyncio-stream.rst:263
303312
msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called."
304313
msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。"
305314

306-
#: ../../library/asyncio-stream.rst:260
315+
#: ../../library/asyncio-stream.rst:268
307316
msgid "StreamWriter"
308317
msgstr "StreamWriter"
309318

310-
#: ../../library/asyncio-stream.rst:264
319+
#: ../../library/asyncio-stream.rst:272
311320
msgid ""
312321
"Represents a writer object that provides APIs to write data to the IO stream."
313322
msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。"
314323

315-
#: ../../library/asyncio-stream.rst:267
324+
#: ../../library/asyncio-stream.rst:275
316325
msgid ""
317326
"It is not recommended to instantiate *StreamWriter* objects directly; use :"
318327
"func:`open_connection` and :func:`start_server` instead."
319328
msgstr ""
320329
"不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:"
321330
"`start_server` 會是較好的做法。"
322331

323-
#: ../../library/asyncio-stream.rst:273
332+
#: ../../library/asyncio-stream.rst:281
324333
msgid ""
325334
"The method attempts to write the *data* to the underlying socket "
326335
"immediately. If that fails, the data is queued in an internal write buffer "
@@ -329,14 +338,14 @@ msgstr ""
329338
"此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入"
330339
"緩衝中排隊等待 (queue),直到它可被發送。"
331340

332-
#: ../../library/asyncio-stream.rst:277 ../../library/asyncio-stream.rst:289
341+
#: ../../library/asyncio-stream.rst:285 ../../library/asyncio-stream.rst:297
333342
msgid "The method should be used along with the ``drain()`` method::"
334343
msgstr ""
335344
"此方法應當與 ``drain()`` 方法一起使用:\n"
336345
"\n"
337346
"::"
338347

339-
#: ../../library/asyncio-stream.rst:284
348+
#: ../../library/asyncio-stream.rst:292
340349
msgid ""
341350
"The method writes a list (or any iterable) of bytes to the underlying socket "
342351
"immediately. If that fails, the data is queued in an internal write buffer "
@@ -345,11 +354,11 @@ msgstr ""
345354
"此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 "
346355
"socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。"
347356

348-
#: ../../library/asyncio-stream.rst:296
357+
#: ../../library/asyncio-stream.rst:304
349358
msgid "The method closes the stream and the underlying socket."
350359
msgstr "此方法會關閉串流以及底層的 socket。"
351360

352-
#: ../../library/asyncio-stream.rst:298
361+
#: ../../library/asyncio-stream.rst:306
353362
msgid ""
354363
"The method should be used, though not mandatory, along with the "
355364
"``wait_closed()`` method::"
@@ -358,37 +367,37 @@ msgstr ""
358367
"\n"
359368
"::"
360369

361-
#: ../../library/asyncio-stream.rst:306
370+
#: ../../library/asyncio-stream.rst:314
362371
msgid ""
363372
"Return ``True`` if the underlying transport supports the :meth:`write_eof` "
364373
"method, ``False`` otherwise."
365374
msgstr ""
366375
"如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 "
367376
"``False``。"
368377

369-
#: ../../library/asyncio-stream.rst:311
378+
#: ../../library/asyncio-stream.rst:319
370379
msgid ""
371380
"Close the write end of the stream after the buffered write data is flushed."
372381
msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。"
373382

374-
#: ../../library/asyncio-stream.rst:316
383+
#: ../../library/asyncio-stream.rst:324
375384
msgid "Return the underlying asyncio transport."
376385
msgstr "回傳底層的 asyncio 傳輸。"
377386

378-
#: ../../library/asyncio-stream.rst:320
387+
#: ../../library/asyncio-stream.rst:328
379388
msgid ""
380389
"Access optional transport information; see :meth:`BaseTransport."
381390
"get_extra_info` for details."
382391
msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。"
383392

384-
#: ../../library/asyncio-stream.rst:325
393+
#: ../../library/asyncio-stream.rst:333
385394
msgid "Wait until it is appropriate to resume writing to the stream. Example::"
386395
msgstr ""
387396
"等待直到可以繼續寫入到串流。範例:\n"
388397
"\n"
389398
"::"
390399

391-
#: ../../library/asyncio-stream.rst:331
400+
#: ../../library/asyncio-stream.rst:339
392401
msgid ""
393402
"This is a flow control method that interacts with the underlying IO write "
394403
"buffer. When the size of the buffer reaches the high watermark, *drain()* "
@@ -400,41 +409,41 @@ msgstr ""
400409
"(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low "
401410
"watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。"
402411

403-
#: ../../library/asyncio-stream.rst:341
412+
#: ../../library/asyncio-stream.rst:349
404413
msgid "Upgrade an existing stream-based connection to TLS."
405414
msgstr ""
406415

407-
#: ../../library/asyncio-stream.rst:343
416+
#: ../../library/asyncio-stream.rst:351
408417
msgid "Parameters:"
409418
msgstr ""
410419

411-
#: ../../library/asyncio-stream.rst:345
420+
#: ../../library/asyncio-stream.rst:353
412421
msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`."
413422
msgstr ""
414423

415-
#: ../../library/asyncio-stream.rst:347
424+
#: ../../library/asyncio-stream.rst:355
416425
msgid ""
417426
"*server_hostname*: sets or overrides the host name that the target server's "
418427
"certificate will be matched against."
419428
msgstr ""
420429

421-
#: ../../library/asyncio-stream.rst:350
430+
#: ../../library/asyncio-stream.rst:358
422431
msgid ""
423432
"*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake "
424433
"to complete before aborting the connection. ``60.0`` seconds if ``None`` "
425434
"(default)."
426435
msgstr ""
427436

428-
#: ../../library/asyncio-stream.rst:358
437+
#: ../../library/asyncio-stream.rst:366
429438
msgid ""
430439
"Return ``True`` if the stream is closed or in the process of being closed."
431440
msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。"
432441

433-
#: ../../library/asyncio-stream.rst:365
442+
#: ../../library/asyncio-stream.rst:373
434443
msgid "Wait until the stream is closed."
435444
msgstr "等待直到串流被關閉。"
436445

437-
#: ../../library/asyncio-stream.rst:367
446+
#: ../../library/asyncio-stream.rst:375
438447
msgid ""
439448
"Should be called after :meth:`close` to wait until the underlying connection "
440449
"is closed, ensuring that all data has been flushed before e.g. exiting the "
@@ -443,22 +452,22 @@ msgstr ""
443452
"應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在"
444453
"這之前(例如在程式退出前)所有資料都已經被清空"
445454

446-
#: ../../library/asyncio-stream.rst:375
455+
#: ../../library/asyncio-stream.rst:383
447456
msgid "Examples"
448457
msgstr "範例"
449458

450-
#: ../../library/asyncio-stream.rst:380
459+
#: ../../library/asyncio-stream.rst:388
451460
msgid "TCP echo client using streams"
452461
msgstr "使用串流的 TCP echo 客戶端"
453462

454-
#: ../../library/asyncio-stream.rst:382
463+
#: ../../library/asyncio-stream.rst:390
455464
msgid "TCP echo client using the :func:`asyncio.open_connection` function::"
456465
msgstr ""
457466
"使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n"
458467
"\n"
459468
"::"
460469

461-
#: ../../library/asyncio-stream.rst:406
470+
#: ../../library/asyncio-stream.rst:414
462471
msgid ""
463472
"The :ref:`TCP echo client protocol "
464473
"<asyncio_example_tcp_echo_client_protocol>` example uses the low-level :meth:"
@@ -467,18 +476,18 @@ msgstr ""
467476
"使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 "
468477
"<asyncio_example_tcp_echo_client_protocol>`\\ 範例。"
469478

470-
#: ../../library/asyncio-stream.rst:413
479+
#: ../../library/asyncio-stream.rst:421
471480
msgid "TCP echo server using streams"
472481
msgstr "使用串流的 TCP echo 伺服器"
473482

474-
#: ../../library/asyncio-stream.rst:415
483+
#: ../../library/asyncio-stream.rst:423
475484
msgid "TCP echo server using the :func:`asyncio.start_server` function::"
476485
msgstr ""
477486
"TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n"
478487
"\n"
479488
"::"
480489

481-
#: ../../library/asyncio-stream.rst:449
490+
#: ../../library/asyncio-stream.rst:457
482491
msgid ""
483492
"The :ref:`TCP echo server protocol "
484493
"<asyncio_example_tcp_echo_server_protocol>` example uses the :meth:`loop."
@@ -487,37 +496,37 @@ msgstr ""
487496
"使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 "
488497
"<asyncio_example_tcp_echo_server_protocol>` 範例。"
489498

490-
#: ../../library/asyncio-stream.rst:454
499+
#: ../../library/asyncio-stream.rst:462
491500
msgid "Get HTTP headers"
492501
msgstr "獲取 HTTP 標頭"
493502

494-
#: ../../library/asyncio-stream.rst:456
503+
#: ../../library/asyncio-stream.rst:464
495504
msgid ""
496505
"Simple example querying HTTP headers of the URL passed on the command line::"
497506
msgstr ""
498507
"查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例:\n"
499508
"\n"
500509
"::"
501510

502-
#: ../../library/asyncio-stream.rst:495
511+
#: ../../library/asyncio-stream.rst:503
503512
msgid "Usage::"
504513
msgstr ""
505514
"用法:\n"
506515
"\n"
507516
"::"
508517

509-
#: ../../library/asyncio-stream.rst:499
518+
#: ../../library/asyncio-stream.rst:507
510519
msgid "or with HTTPS::"
511520
msgstr ""
512521
"或使用 HTTPS:\n"
513522
"\n"
514523
"::"
515524

516-
#: ../../library/asyncio-stream.rst:507
525+
#: ../../library/asyncio-stream.rst:515
517526
msgid "Register an open socket to wait for data using streams"
518527
msgstr "註冊一個使用串流來等待資料的開放 socket"
519528

520-
#: ../../library/asyncio-stream.rst:509
529+
#: ../../library/asyncio-stream.rst:517
521530
msgid ""
522531
"Coroutine waiting until a socket receives data using the :func:"
523532
"`open_connection` function::"
@@ -526,7 +535,7 @@ msgstr ""
526535
"\n"
527536
"::"
528537

529-
#: ../../library/asyncio-stream.rst:544
538+
#: ../../library/asyncio-stream.rst:552
530539
msgid ""
531540
"The :ref:`register an open socket to wait for data using a protocol "
532541
"<asyncio_example_create_connection>` example uses a low-level protocol and "
@@ -536,11 +545,18 @@ msgstr ""
536545
"<asyncio_example_create_connection>`\\ 範例中,有使用了低階協定以及 :meth:"
537546
"`loop.create_connection` 方法。"
538547

539-
#: ../../library/asyncio-stream.rst:548
548+
#: ../../library/asyncio-stream.rst:556
540549
msgid ""
541550
"The :ref:`watch a file descriptor for read events "
542551
"<asyncio_example_watch_fd>` example uses the low-level :meth:`loop."
543552
"add_reader` method to watch a file descriptor."
544553
msgstr ""
545554
"在\\ :ref:`監視檔案描述器以讀取事件 <asyncio_example_watch_fd>`\\ 範例中,有"
546555
"使用低階的 :meth:`loop.add_reader` 方法來監視檔案描述器。"
556+
557+
#~ msgid ""
558+
#~ "Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read "
559+
#~ "until EOF and return all read bytes."
560+
#~ msgstr ""
561+
#~ "讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取"
562+
#~ "直到 EOF 並回傳所有已讀取的位元組。"

0 commit comments

Comments
 (0)