8
8
msgstr ""
9
9
"Project-Id-Version : Python 3.11\n "
10
10
"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 "
12
12
"PO-Revision-Date : 2022-10-31 16:28+0800\n "
13
13
"Last-Translator : Matt Wang <mattwang44@gmail.com>\n "
14
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -223,41 +223,50 @@ msgstr ""
223
223
"`start_server` 會是較好的做法。"
224
224
225
225
#: ../../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."
229
227
msgstr ""
230
- "讀取至多 *n* 個位元組。如果沒有設定 *n* 或被設為 ``-1``,則表示要持續讀取直"
231
- "到 EOF 並回傳所有已讀取的位元組。"
232
228
233
- #: ../../library/asyncio-stream.rst:212
229
+ #: ../../library/asyncio-stream.rst:211
230
+ #, fuzzy
234
231
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."
237
235
msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。"
238
236
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
240
249
msgid ""
241
250
"Read one line, where \" line\" is a sequence of bytes ending with ``\\ n``."
242
251
msgstr "讀取一行,其中\" 行\" 指的是以 ``\\ n`` 結尾的位元組序列。"
243
252
244
- #: ../../library/asyncio-stream.rst:220
253
+ #: ../../library/asyncio-stream.rst:228
245
254
msgid ""
246
255
"If EOF is received and ``\\ n`` was not found, the method returns partially "
247
256
"read data."
248
257
msgstr "如果讀取到 EOF 而沒有找到 ``\\ n``,該方法會回傳部分的已讀取資料。"
249
258
250
- #: ../../library/asyncio-stream.rst:223
259
+ #: ../../library/asyncio-stream.rst:231
251
260
msgid ""
252
261
"If EOF is received and the internal buffer is empty, return an empty "
253
262
"``bytes`` object."
254
263
msgstr "如果讀取到 EOF 且內部緩衝區是空的,則回傳一個空的 ``bytes`` 物件。"
255
264
256
- #: ../../library/asyncio-stream.rst:228
265
+ #: ../../library/asyncio-stream.rst:236
257
266
msgid "Read exactly *n* bytes."
258
267
msgstr "讀取剛好 *n* 個位元組。"
259
268
260
- #: ../../library/asyncio-stream.rst:230
269
+ #: ../../library/asyncio-stream.rst:238
261
270
msgid ""
262
271
"Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be "
263
272
"read. Use the :attr:`IncompleteReadError.partial` attribute to get the "
@@ -267,19 +276,19 @@ msgstr ""
267
276
"`IncompleteReadError`。使用 :attr:`IncompleteReadError.partial` 屬性來獲取串"
268
277
"流結束前已讀取的部分資料。"
269
278
270
- #: ../../library/asyncio-stream.rst:236
279
+ #: ../../library/asyncio-stream.rst:244
271
280
msgid "Read data from the stream until *separator* is found."
272
281
msgstr "從串流中持續讀取資料直到出現 *separator*。"
273
282
274
- #: ../../library/asyncio-stream.rst:238
283
+ #: ../../library/asyncio-stream.rst:246
275
284
msgid ""
276
285
"On success, the data and separator will be removed from the internal buffer "
277
286
"(consumed). Returned data will include the separator at the end."
278
287
msgstr ""
279
288
"成功後,資料和 separator(分隔符號)會從內部緩衝區中刪除(或者說是被消費掉 "
280
289
"(consumed))。回傳的資料在末尾會有一個 separator。"
281
290
282
- #: ../../library/asyncio-stream.rst:242
291
+ #: ../../library/asyncio-stream.rst:250
283
292
msgid ""
284
293
"If the amount of data read exceeds the configured stream limit, a :exc:"
285
294
"`LimitOverrunError` exception is raised, and the data is left in the "
@@ -288,7 +297,7 @@ msgstr ""
288
297
"如果讀取的資料量超過了設定的串流限制,將會引發 :exc:`LimitOverrunError` 例"
289
298
"外,資料將被留在內部緩衝區中,並可以再次被讀取。"
290
299
291
- #: ../../library/asyncio-stream.rst:246
300
+ #: ../../library/asyncio-stream.rst:254
292
301
msgid ""
293
302
"If EOF is reached before the complete separator is found, an :exc:"
294
303
"`IncompleteReadError` exception is raised, and the internal buffer is "
@@ -299,28 +308,28 @@ msgstr ""
299
308
"`IncompleteReadError` 例外,且內部緩衝區會被重置。:attr:`IncompleteReadError."
300
309
"partial` 屬性可能包含一部分的 separator。"
301
310
302
- #: ../../library/asyncio-stream.rst:255
311
+ #: ../../library/asyncio-stream.rst:263
303
312
msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called."
304
313
msgstr "如果緩衝區是空的且 :meth:`feed_eof` 曾被呼叫則回傳 ``True``。"
305
314
306
- #: ../../library/asyncio-stream.rst:260
315
+ #: ../../library/asyncio-stream.rst:268
307
316
msgid "StreamWriter"
308
317
msgstr "StreamWriter"
309
318
310
- #: ../../library/asyncio-stream.rst:264
319
+ #: ../../library/asyncio-stream.rst:272
311
320
msgid ""
312
321
"Represents a writer object that provides APIs to write data to the IO stream."
313
322
msgstr "表示一個有提供 API 來將資料寫入 IO 串流的 writer 物件。"
314
323
315
- #: ../../library/asyncio-stream.rst:267
324
+ #: ../../library/asyncio-stream.rst:275
316
325
msgid ""
317
326
"It is not recommended to instantiate *StreamWriter* objects directly; use :"
318
327
"func:`open_connection` and :func:`start_server` instead."
319
328
msgstr ""
320
329
"不建議直接實例化 *StreamWriter* 物件;使用 :func:`open_connection` 和 :func:"
321
330
"`start_server` 會是較好的做法。"
322
331
323
- #: ../../library/asyncio-stream.rst:273
332
+ #: ../../library/asyncio-stream.rst:281
324
333
msgid ""
325
334
"The method attempts to write the *data* to the underlying socket "
326
335
"immediately. If that fails, the data is queued in an internal write buffer "
@@ -329,14 +338,14 @@ msgstr ""
329
338
"此方法會嘗試立即將 *data* 寫入到底層的 socket。如果失敗,資料會被放到內部寫入"
330
339
"緩衝中排隊等待 (queue),直到它可被發送。"
331
340
332
- #: ../../library/asyncio-stream.rst:277 ../../library/asyncio-stream.rst:289
341
+ #: ../../library/asyncio-stream.rst:285 ../../library/asyncio-stream.rst:297
333
342
msgid "The method should be used along with the ``drain()`` method::"
334
343
msgstr ""
335
344
"此方法應當與 ``drain()`` 方法一起使用:\n"
336
345
"\n"
337
346
"::"
338
347
339
- #: ../../library/asyncio-stream.rst:284
348
+ #: ../../library/asyncio-stream.rst:292
340
349
msgid ""
341
350
"The method writes a list (or any iterable) of bytes to the underlying socket "
342
351
"immediately. If that fails, the data is queued in an internal write buffer "
@@ -345,11 +354,11 @@ msgstr ""
345
354
"此方法會立即嘗試將一個位元組 list(或任何可疊代物件 (iterable))寫入到底層的 "
346
355
"socket。如果失敗,資料會被放到內部寫入緩衝中排隊等待,直到它可被發送。"
347
356
348
- #: ../../library/asyncio-stream.rst:296
357
+ #: ../../library/asyncio-stream.rst:304
349
358
msgid "The method closes the stream and the underlying socket."
350
359
msgstr "此方法會關閉串流以及底層的 socket。"
351
360
352
- #: ../../library/asyncio-stream.rst:298
361
+ #: ../../library/asyncio-stream.rst:306
353
362
msgid ""
354
363
"The method should be used, though not mandatory, along with the "
355
364
"``wait_closed()`` method::"
@@ -358,37 +367,37 @@ msgstr ""
358
367
"\n"
359
368
"::"
360
369
361
- #: ../../library/asyncio-stream.rst:306
370
+ #: ../../library/asyncio-stream.rst:314
362
371
msgid ""
363
372
"Return ``True`` if the underlying transport supports the :meth:`write_eof` "
364
373
"method, ``False`` otherwise."
365
374
msgstr ""
366
375
"如果底層的傳輸支援 :meth:`write_eof` 方法就回傳 ``True``,否則回傳 "
367
376
"``False``。"
368
377
369
- #: ../../library/asyncio-stream.rst:311
378
+ #: ../../library/asyncio-stream.rst:319
370
379
msgid ""
371
380
"Close the write end of the stream after the buffered write data is flushed."
372
381
msgstr "在已緩衝的寫入資料被清理 (flush) 後關閉串流的寫入端。"
373
382
374
- #: ../../library/asyncio-stream.rst:316
383
+ #: ../../library/asyncio-stream.rst:324
375
384
msgid "Return the underlying asyncio transport."
376
385
msgstr "回傳底層的 asyncio 傳輸。"
377
386
378
- #: ../../library/asyncio-stream.rst:320
387
+ #: ../../library/asyncio-stream.rst:328
379
388
msgid ""
380
389
"Access optional transport information; see :meth:`BaseTransport."
381
390
"get_extra_info` for details."
382
391
msgstr "存取可選的傳輸資訊;詳情請見 :meth:`BaseTransport.get_extra_info`。"
383
392
384
- #: ../../library/asyncio-stream.rst:325
393
+ #: ../../library/asyncio-stream.rst:333
385
394
msgid "Wait until it is appropriate to resume writing to the stream. Example::"
386
395
msgstr ""
387
396
"等待直到可以繼續寫入到串流。範例:\n"
388
397
"\n"
389
398
"::"
390
399
391
- #: ../../library/asyncio-stream.rst:331
400
+ #: ../../library/asyncio-stream.rst:339
392
401
msgid ""
393
402
"This is a flow control method that interacts with the underlying IO write "
394
403
"buffer. When the size of the buffer reaches the high watermark, *drain()* "
@@ -400,41 +409,41 @@ msgstr ""
400
409
"(high watermark) 時,*drain()* 會阻塞直到緩衝區大小減少至最低標記位 (low "
401
410
"watermark) 以便繼續寫入。當沒有要等待的資料時,:meth:`drain` 會立即回傳。"
402
411
403
- #: ../../library/asyncio-stream.rst:341
412
+ #: ../../library/asyncio-stream.rst:349
404
413
msgid "Upgrade an existing stream-based connection to TLS."
405
414
msgstr ""
406
415
407
- #: ../../library/asyncio-stream.rst:343
416
+ #: ../../library/asyncio-stream.rst:351
408
417
msgid "Parameters:"
409
418
msgstr ""
410
419
411
- #: ../../library/asyncio-stream.rst:345
420
+ #: ../../library/asyncio-stream.rst:353
412
421
msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`."
413
422
msgstr ""
414
423
415
- #: ../../library/asyncio-stream.rst:347
424
+ #: ../../library/asyncio-stream.rst:355
416
425
msgid ""
417
426
"*server_hostname*: sets or overrides the host name that the target server's "
418
427
"certificate will be matched against."
419
428
msgstr ""
420
429
421
- #: ../../library/asyncio-stream.rst:350
430
+ #: ../../library/asyncio-stream.rst:358
422
431
msgid ""
423
432
"*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake "
424
433
"to complete before aborting the connection. ``60.0`` seconds if ``None`` "
425
434
"(default)."
426
435
msgstr ""
427
436
428
- #: ../../library/asyncio-stream.rst:358
437
+ #: ../../library/asyncio-stream.rst:366
429
438
msgid ""
430
439
"Return ``True`` if the stream is closed or in the process of being closed."
431
440
msgstr "如果串流已被關閉或正在被關閉則回傳 ``True``。"
432
441
433
- #: ../../library/asyncio-stream.rst:365
442
+ #: ../../library/asyncio-stream.rst:373
434
443
msgid "Wait until the stream is closed."
435
444
msgstr "等待直到串流被關閉。"
436
445
437
- #: ../../library/asyncio-stream.rst:367
446
+ #: ../../library/asyncio-stream.rst:375
438
447
msgid ""
439
448
"Should be called after :meth:`close` to wait until the underlying connection "
440
449
"is closed, ensuring that all data has been flushed before e.g. exiting the "
@@ -443,22 +452,22 @@ msgstr ""
443
452
"應當在 :meth:`close` 之後才被呼叫,這會持續等待直到底層的連線被關閉,以確保在"
444
453
"這之前(例如在程式退出前)所有資料都已經被清空"
445
454
446
- #: ../../library/asyncio-stream.rst:375
455
+ #: ../../library/asyncio-stream.rst:383
447
456
msgid "Examples"
448
457
msgstr "範例"
449
458
450
- #: ../../library/asyncio-stream.rst:380
459
+ #: ../../library/asyncio-stream.rst:388
451
460
msgid "TCP echo client using streams"
452
461
msgstr "使用串流的 TCP echo 客戶端"
453
462
454
- #: ../../library/asyncio-stream.rst:382
463
+ #: ../../library/asyncio-stream.rst:390
455
464
msgid "TCP echo client using the :func:`asyncio.open_connection` function::"
456
465
msgstr ""
457
466
"使用 :func:`asyncio.open_connection` 函式的 TCP echo 客戶端:\n"
458
467
"\n"
459
468
"::"
460
469
461
- #: ../../library/asyncio-stream.rst:406
470
+ #: ../../library/asyncio-stream.rst:414
462
471
msgid ""
463
472
"The :ref:`TCP echo client protocol "
464
473
"<asyncio_example_tcp_echo_client_protocol>` example uses the low-level :meth:"
@@ -467,18 +476,18 @@ msgstr ""
467
476
"使用低階 :meth:`loop.create_connection` 方法的 :ref:`TCP echo 客戶端協定 "
468
477
"<asyncio_example_tcp_echo_client_protocol>`\\ 範例。"
469
478
470
- #: ../../library/asyncio-stream.rst:413
479
+ #: ../../library/asyncio-stream.rst:421
471
480
msgid "TCP echo server using streams"
472
481
msgstr "使用串流的 TCP echo 伺服器"
473
482
474
- #: ../../library/asyncio-stream.rst:415
483
+ #: ../../library/asyncio-stream.rst:423
475
484
msgid "TCP echo server using the :func:`asyncio.start_server` function::"
476
485
msgstr ""
477
486
"TCP echo 伺服器使用 :func:`asyncio.start_server` 函式:\n"
478
487
"\n"
479
488
"::"
480
489
481
- #: ../../library/asyncio-stream.rst:449
490
+ #: ../../library/asyncio-stream.rst:457
482
491
msgid ""
483
492
"The :ref:`TCP echo server protocol "
484
493
"<asyncio_example_tcp_echo_server_protocol>` example uses the :meth:`loop."
@@ -487,37 +496,37 @@ msgstr ""
487
496
"使用 :meth:`loop.create_server` 方法的 :ref:`TCP echo 伺服器協定 "
488
497
"<asyncio_example_tcp_echo_server_protocol>` 範例。"
489
498
490
- #: ../../library/asyncio-stream.rst:454
499
+ #: ../../library/asyncio-stream.rst:462
491
500
msgid "Get HTTP headers"
492
501
msgstr "獲取 HTTP 標頭"
493
502
494
- #: ../../library/asyncio-stream.rst:456
503
+ #: ../../library/asyncio-stream.rst:464
495
504
msgid ""
496
505
"Simple example querying HTTP headers of the URL passed on the command line::"
497
506
msgstr ""
498
507
"查詢自命令列傳入之 URL 所帶有 HTTP 標頭的簡單範例:\n"
499
508
"\n"
500
509
"::"
501
510
502
- #: ../../library/asyncio-stream.rst:495
511
+ #: ../../library/asyncio-stream.rst:503
503
512
msgid "Usage::"
504
513
msgstr ""
505
514
"用法:\n"
506
515
"\n"
507
516
"::"
508
517
509
- #: ../../library/asyncio-stream.rst:499
518
+ #: ../../library/asyncio-stream.rst:507
510
519
msgid "or with HTTPS::"
511
520
msgstr ""
512
521
"或使用 HTTPS:\n"
513
522
"\n"
514
523
"::"
515
524
516
- #: ../../library/asyncio-stream.rst:507
525
+ #: ../../library/asyncio-stream.rst:515
517
526
msgid "Register an open socket to wait for data using streams"
518
527
msgstr "註冊一個使用串流來等待資料的開放 socket"
519
528
520
- #: ../../library/asyncio-stream.rst:509
529
+ #: ../../library/asyncio-stream.rst:517
521
530
msgid ""
522
531
"Coroutine waiting until a socket receives data using the :func:"
523
532
"`open_connection` function::"
@@ -526,7 +535,7 @@ msgstr ""
526
535
"\n"
527
536
"::"
528
537
529
- #: ../../library/asyncio-stream.rst:544
538
+ #: ../../library/asyncio-stream.rst:552
530
539
msgid ""
531
540
"The :ref:`register an open socket to wait for data using a protocol "
532
541
"<asyncio_example_create_connection>` example uses a low-level protocol and "
@@ -536,11 +545,18 @@ msgstr ""
536
545
"<asyncio_example_create_connection>`\\ 範例中,有使用了低階協定以及 :meth:"
537
546
"`loop.create_connection` 方法。"
538
547
539
- #: ../../library/asyncio-stream.rst:548
548
+ #: ../../library/asyncio-stream.rst:556
540
549
msgid ""
541
550
"The :ref:`watch a file descriptor for read events "
542
551
"<asyncio_example_watch_fd>` example uses the low-level :meth:`loop."
543
552
"add_reader` method to watch a file descriptor."
544
553
msgstr ""
545
554
"在\\ :ref:`監視檔案描述器以讀取事件 <asyncio_example_watch_fd>`\\ 範例中,有"
546
555
"使用低階的 :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