From b56cd64c2f6a725373cfc804bfc562ae591d1103 Mon Sep 17 00:00:00 2001 From: Neo Date: Sun, 3 Sep 2023 20:56:10 +0800 Subject: [PATCH 1/6] docs(wsgiref): add partial document translation from english to traditional chinese from rst:87 to rst:845 --- library/wsgiref.po | 243 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 211 insertions(+), 32 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index 0c898ef064..1c19dab53e 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -220,13 +220,14 @@ msgstr "" msgid "" "In addition to the environment functions above, the :mod:`wsgiref.util` " "module also provides these miscellaneous utilities:" -msgstr "" +msgstr "除了上述的環境功能外, :mod:`wsgiref.util` 模組還提供以下各類工具:" #: ../../library/wsgiref.rst:152 msgid "" "Return ``True`` if 'header_name' is an HTTP/1.1 \"Hop-by-Hop\" header, as " "defined by :rfc:`2616`." msgstr "" +"如果 'header_name' 是根據 :rfc:`2616` 所定義的 HTTP/1.1 \"Hop-by-Hop\" 標頭,則回傳 ``True``。" #: ../../library/wsgiref.rst:158 msgid "" @@ -237,6 +238,9 @@ msgid "" "object's :meth:`read` method to obtain bytestrings to yield. When :meth:" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" +":class:`wsgiref.types.FileWrapper` 協議的具體實作 用於將類似檔案的物件轉換為 :term:`iterator`。" +"產生的物件是 :term:`iterables`。當物件進行疊代時,將重複並可選的 *blksize* 引數傳遞給 *filelike* 物件的" +":meth"`read` 方法去獲得與產生位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" #: ../../library/wsgiref.rst:166 msgid "" @@ -244,20 +248,22 @@ msgid "" "a :meth:`close` method, and it will invoke the *filelike* object's :meth:" "`close` method when called." msgstr "" +"如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方法,並在調" +"用時呼叫 *filelike* 物件的 :meth:`close` 方法。" #: ../../library/wsgiref.rst:182 -msgid "Support for :meth:`~object.__getitem__` method has been removed." -msgstr "" +msgid "Support for :meth:`__getitem__` method has been removed." +msgstr "已移除對 :meth:`__getitem__` 方法的支援。" #: ../../library/wsgiref.rst:187 msgid ":mod:`wsgiref.headers` -- WSGI response header tools" -msgstr "" +msgstr ":mod:`wsgiref.headers` -- WSGI 回應標頭工具。" #: ../../library/wsgiref.rst:193 msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." -msgstr "" +msgstr "這個模組提供單一類別,:class:`Headers`,用於使用類似映射的介面方便地操作 WSGI 回應標頭。" #: ../../library/wsgiref.rst:199 msgid "" @@ -265,6 +271,8 @@ msgid "" "header name/value tuples as described in :pep:`3333`. The default value of " "*headers* is an empty list." msgstr "" +"建立一個類似映射物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/value 元組的標頭串列。" +"*headers* 的默認值是一個空串列。" #: ../../library/wsgiref.rst:203 msgid "" @@ -277,6 +285,10 @@ msgid "" "the end of the wrapped header list. Headers' existing order is generally " "maintained, with new headers added to the end of the wrapped list." msgstr "" +":class:`Headers` 物件支援典型映射操作包括 :meth:`__getitem__`、:meth:`get`、:meth:`__setitem__`、" +":meth:`setdefault`、:meth:`__delitem__` 以及 :meth:`__contains__`。對於這些方法中的每一個,鍵是標頭" +"名稱(以不區分大小寫方式處理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標頭的所有現有值,然後將新值" +"添加到包裝的標頭串列末尾。標頭的現有順序通常保持不變,新標頭會添加到包裝串列的末尾。" #: ../../library/wsgiref.rst:212 msgid "" @@ -285,6 +297,8 @@ msgid "" "nonexistent header just returns ``None``, and deleting a nonexistent header " "does nothing." msgstr "" +"不同於字典,當你嘗試取得或刪除包裝的標頭串列不存在的鍵,:class:`Headers` 物件不會引發例外錯誤。" +"取得不存在的標頭只會回傳 ``None``,而刪除不存在的標頭則不會有任何效果。" #: ../../library/wsgiref.rst:217 msgid "" @@ -296,6 +310,10 @@ msgid "" "In fact, the :meth:`items` method just returns a copy of the wrapped header " "list." msgstr "" +":class:`Headers` 物件還支援 :meth:`keys`、:meth:`value`、和 :meth:`items` 方法。" +"由 :meth:`keys` 和 :meth:`items` 回傳的串列在存在多值標頭時可能會包含相同的鍵。" +":class:`Headers` 物件的 ``len()`` 與 "meth:`items` 的長度相同,也與包裝標頭串列的長度相同。" +"實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" #: ../../library/wsgiref.rst:224 msgid "" @@ -305,6 +323,8 @@ msgid "" "line is terminated by a carriage return and line feed, and the bytestring is " "terminated with a blank line." msgstr "" +"對 :class:`Header` 物件調用 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格式化的位元組字串。" +"每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回車和換行結束,而該位元組字串則以空行結束。" #: ../../library/wsgiref.rst:230 msgid "" @@ -312,10 +332,12 @@ msgid "" "`Headers` objects also have the following methods for querying and adding " "multi-valued headers, and for adding headers with MIME parameters:" msgstr "" +"除了映射介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭的以及附加 MIME 參數" +"標頭的方法:" #: ../../library/wsgiref.rst:237 msgid "Return a list of all the values for the named header." -msgstr "" +msgstr "回傳指定標頭的所有值的串列。" #: ../../library/wsgiref.rst:239 msgid "" @@ -324,12 +346,14 @@ msgid "" "fields deleted and re-inserted are always appended to the header list. If " "no fields exist with the given name, returns an empty list." msgstr "" +"回傳的串列按照它們在在原始的標頭串列出現的順序或是被添加到此實例的順序進行排序,並且可能包含重複的內容。" +"任何被刪除並重新插入的欄位都會被添加到標頭串列的末尾。如果不存在指定名稱的欄位,則回傳空串列。" #: ../../library/wsgiref.rst:247 msgid "" "Add a (possibly multi-valued) header, with optional MIME parameters " "specified via keyword arguments." -msgstr "" +msgstr "添加一個(可能是多值的)標頭,可通過關鍵字引數來指定選擇性的 MIME 參數。" #: ../../library/wsgiref.rst:250 msgid "" @@ -342,18 +366,26 @@ msgid "" "only the parameter name is added. (This is used for MIME parameters without " "a value.) Example usage::" msgstr "" +"*name* 是要添加的標頭欄位。關鍵字引數可使於設定標頭欄位的 MIME 參數。每一個參數必須是字串或是 ``None``。" +"由於破折號在 Python 識別符中是非法的,但是許多 MIME 參數名稱包含破折號,因此參數名稱的底線會轉換成破折號。" +"如果參數值是字串,則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加參數名稱。" +"(這使用於沒有值的 MIME 參數)使用範例:" + +"::" #: ../../library/wsgiref.rst:260 msgid "The above will add a header that looks like this::" -msgstr "" +msgstr "上述操作將添加看起來像這樣的標頭:" + +"::" #: ../../library/wsgiref.rst:265 msgid "*headers* parameter is optional." -msgstr "" +msgstr "*headers* 參數是可選的。" #: ../../library/wsgiref.rst:270 msgid ":mod:`wsgiref.simple_server` -- a simple WSGI HTTP server" -msgstr "" +msgstr ":mod:`wsgiref.simple_server` -- 一個簡單的 WSGI HTTP 伺服器" #: ../../library/wsgiref.rst:276 msgid "" @@ -365,6 +397,10 @@ msgid "" "request. (E.g., using the :func:`shift_path_info` function from :mod:" "`wsgiref.util`.)" msgstr "" +"這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI 應用程式。每個伺服器執行個體" +"在特定的主機與埠提供單一的 WSGI 應用程式。如果你想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI" +"應用程式以解析 ``PATH_INFO`` 去選擇為每個請求調用哪個應用程式。(例如,使用來自 :mod:`wsgiref.util` 的" +":func:`shift_path_info` 函式。)" #: ../../library/wsgiref.rst:287 msgid "" @@ -374,6 +410,8 @@ msgid "" "*handler_class*. *app* must be a WSGI application object, as defined by :" "pep:`3333`." msgstr "" +"建立一個新的 WSGI 伺服器監聽 *host* 和 *port*,接受 *app* 的連線。回傳值是提供 "*server_class* 的實例," +"並將使用指定的 *handler_class* 處理請求。*app* 必須是一個 WSGI 應用程式物件,如 :pep:`3333` 所定義。" #: ../../library/wsgiref.rst:308 msgid "" @@ -383,6 +421,9 @@ msgid "" "WSGI server (such as :mod:`wsgiref.simple_server`) is able to run a simple " "WSGI application correctly." msgstr "" +"這個函式是一個簡單但完整的 WSGI 應用程式,它回傳一個包含訊息 \"Hello world!\" 和在 *environ* 參數" +"中提供的鍵值對串列的文字頁面。這對於驗證 WSGI 伺服器(例如 :mod:`wsgiref.simple_server`)是否能正" +"確執行簡單的 WSGI 應用程式非常有用。" #: ../../library/wsgiref.rst:317 msgid "" @@ -390,12 +431,16 @@ msgid "" "port)`` tuple, and *RequestHandlerClass* should be the subclass of :class:" "`http.server.BaseHTTPRequestHandler` that will be used to process requests." msgstr "" +"建立一個 :class:`WSGIServer` 實例。*server_address* 應該是一個 ``(host, port)`` 元組,而 " +"*RequestHandlerClass* 應該是 :class:`http.server.BaseHTTPRequestHandler` 的子類別,將用" +"於處理請求。 #: ../../library/wsgiref.rst:322 msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." msgstr "" +"通常你不需要呼叫這個建構器,因為 :func:`make_server` 函式可以為你處理所有細節。" #: ../../library/wsgiref.rst:325 msgid "" @@ -403,16 +448,21 @@ msgid "" "of its methods (such as :meth:`serve_forever` and :meth:`handle_request`) " "are available. :class:`WSGIServer` also provides these WSGI-specific methods:" msgstr "" +":class:`WSGIServer` 是 :class:`http.server.HTTPServer` 的子類別,因此它的所有方法" +"(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:`WSGIServer`" +"也提供這些特定於 WSGI 的方法:" + #: ../../library/wsgiref.rst:332 msgid "" "Sets the callable *application* as the WSGI application that will receive " "requests." msgstr "" +"將可呼叫的 *application* 設定為接收請求的 WSGI 應用程式。" #: ../../library/wsgiref.rst:338 msgid "Returns the currently set application callable." -msgstr "" +msgstr "回傳目前設定應用程式的可呼叫物件。" #: ../../library/wsgiref.rst:340 msgid "" @@ -420,6 +470,8 @@ msgid "" "`set_app` is normally called by :func:`make_server`, and the :meth:`get_app` " "exists mainly for the benefit of request handler instances." msgstr "" +"然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會被 :func:`make_server` 呼叫" +"而 :meth:`get_app` 主要存在於請求處置器實例的好處上。" #: ../../library/wsgiref.rst:347 msgid "" @@ -427,6 +479,8 @@ msgid "" "*client_address* (a ``(host,port)`` tuple), and *server* (:class:" "`WSGIServer` instance)." msgstr "" +"為給定的 *request*(即一個 socket)、*client_address*(一個 ``(host,port)`` 位元組)" +"、*server*(:class:`WSGIServer` 實例)建立一個 HTTP 處置器。" #: ../../library/wsgiref.rst:350 msgid "" @@ -436,6 +490,9 @@ msgid "" "`make_server` function. Some possibly relevant methods for overriding in " "subclasses:" msgstr "" +"你不需要直接建立這個類的實例;它們會在需要時由 :class:WSGIServer 物件自動建立。不過,你可以" +"建立這個類的子類並將其作為 *handler_class* 提供給 :func:`make_server` 函式。一些可能相關" +"的方法可以在子類中進行覆寫:" #: ../../library/wsgiref.rst:359 msgid "" @@ -446,12 +503,16 @@ msgid "" "return a new dictionary containing all of the relevant CGI environment " "variables as specified in :pep:`3333`." msgstr "" +"唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。默認的實作會複製 :class:" +"`WSGIServer` 物件的 :attr:`base_environ` 字典屬性的內容以及添加從 HTTP 請求中衍生的各種標頭" +"。每次呼叫這個方法都應該回傳一個包含所有如 :pep:`3333` 所指定的相關 CGI 環境變數的新字典。" #: ../../library/wsgiref.rst:370 msgid "" "Return the object that should be used as the ``wsgi.errors`` stream. The " "default implementation just returns ``sys.stderr``." msgstr "" +"回傳的物件應該被用作 ``wsgi.errors`` 流。默認實作只會回傳 ``sys.stderr``。" #: ../../library/wsgiref.rst:376 msgid "" @@ -459,10 +520,13 @@ msgid "" "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " "application interface." msgstr "" +"處理 HTTP 請求。默認實作會使用 :mod:`wsgiref.handler` 類別來建立處置器實例來實作實際" +" WSGI 應用程式介面。" + #: ../../library/wsgiref.rst:382 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" -msgstr "" +msgstr ":mod:`wsgiref.validate` --- WSGI 符合姓檢查" #: ../../library/wsgiref.rst:388 msgid "" @@ -472,7 +536,10 @@ msgid "" "application objects that validate communications between a WSGI server or " "gateway and a WSGI application object, to check both sides for protocol " "conformance." -msgstr "" +msgstr "" +"當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體時,使用 :mod:`wsgiref.validate`來驗證新程式" +"碼的符合性可能會很有用。這個模組提供一個函式用於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與" +" WSGI 應用程式物件之間的通訊,以檢查雙方協議的符合性。" #: ../../library/wsgiref.rst:395 msgid "" @@ -482,12 +549,15 @@ msgid "" "virtually certain that either the server or application is not 100% " "compliant." msgstr "" +"請注意這個工具並不保證完全符合 :pep:`3333`;這個模組中的錯誤不一定代表不存在錯誤。但是,如果" +"如果這個模組產生錯誤,那麼幾乎可以確定伺服器或應用程式不是 100% 符合標準。" #: ../../library/wsgiref.rst:400 msgid "" "This module is based on the :mod:`paste.lint` module from Ian Bicking's " "\"Python Paste\" library." msgstr "" +"這個模組基於 Ian Bicking 的 \"Python Paste"\ 函式庫的 :mod:`paste.lint` 模組。" #: ../../library/wsgiref.rst:406 msgid "" @@ -496,6 +566,8 @@ msgid "" "will check that both the *application* and the server invoking it are " "conforming to the WSGI specification and to :rfc:`2616`." msgstr "" +"封裝 *application* 並回傳一個新的 WSGI 應用程式物件。回傳的應用程式將轉發所有請求給原始的 *application*" +",並檢查 *application* 和呼叫它的伺服器是否符合 WSGI 規範和 :rfc:`2616`。" #: ../../library/wsgiref.rst:411 msgid "" @@ -507,6 +579,12 @@ msgid "" "occurred, and dump the traceback to ``sys.stderr`` or some other error " "stream." msgstr "" +"任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;請注意,但是," + +"任何檢測到的不符合都將引發 :exc:`AssertionError`;但請注意,如何處理這些錯誤取決於伺服器。" +"例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref.simple_server` 以及其他伺服器(未" +"覆蓋錯誤處理方法以執行其他操作的伺服器)將僅輸出一條錯誤訊息,指示發生錯誤,並將回溯信息輸出到 ``" +"sys.stderr`` 或是其他錯誤流。" #: ../../library/wsgiref.rst:418 msgid "" @@ -517,10 +595,14 @@ msgid "" "to ``sys.stderr`` (*not* ``wsgi.errors``, unless they happen to be the same " "object)." msgstr "" +這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上可能不會被 :pep:`3333`" +" 禁止的行為。除非使用 Python 命令行選項或 :mod:`warnings` API,抑制了這些警告,否則這類警告將被寫入" +"到 ``sys.stderr``(*not* ``wsgi.errors``,除非它們碰巧是相同的物件)。" #: ../../library/wsgiref.rst:450 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" msgstr "" +":mod:`wsgiref.handlers` -- 伺服器 / 閘道基本類別" #: ../../library/wsgiref.rst:456 msgid "" @@ -529,6 +611,8 @@ msgid "" "a WSGI application, as long as they are given a CGI-like environment, along " "with input, output, and error streams." msgstr "" +"這個模組提供實作 WSGI 伺服器和閘道的基礎處置器類別。這些基礎類別處置器大部分與 WSGI 應用程式通訊的工作," +"只要它們被提供 CGI-like 環境,以及輸入、輸出和錯誤流。" #: ../../library/wsgiref.rst:464 msgid "" @@ -537,6 +621,9 @@ msgid "" "run it as a CGI script. Simply invoke ``CGIHandler().run(app)``, where " "``app`` is the WSGI application object you wish to invoke." msgstr "" +"這是基於 CGI 的調用方式並透過 ``sys.stdin``、``sys.stdout``、``sys.stderr`` 和 ``os.environ``。" +"當您擁有一個 WSGI 應用程式並希望將其作為 CGI 腳本運行時是很有用的。只需呼叫 ``CGIHandler().run(app)``" +",其中 ``app`` 是你希望調用的 WSGI 應用程式物件。 #: ../../library/wsgiref.rst:469 msgid "" @@ -545,6 +632,9 @@ msgid "" "to true, and always uses :mod:`sys` and :mod:`os` to obtain the necessary " "CGI streams and environment." msgstr "" +"這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true,``wsgi.multithread``" +"設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需" +"的 CGI 流以及環境。" #: ../../library/wsgiref.rst:477 msgid "" @@ -552,6 +642,8 @@ msgid "" "Microsoft's IIS web server, without having set the config allowPathInfo " "option (IIS>=7) or metabase allowPathInfoForScriptMappings (IIS<7)." msgstr "" +"這是用於在 Microsoft 的 IIS 網頁伺服器上部署時使用的 :class:`CGIHandler` 的一個專門替代選擇,無需設置" +" config 的 allowPathInfo 選項(IIS>=7),或 metabase 的 allowPathInfoForScriptMappings 選項(IIS<7)。" #: ../../library/wsgiref.rst:481 msgid "" @@ -559,6 +651,8 @@ msgid "" "the front, causing problems for WSGI applications that wish to implement " "routing. This handler strips any such duplicated path." msgstr "" +"預設情況下,IIS 提供的 ``PATH_INFO`` 會在前面複製 ``SCRIPT_NAME``,對於希望實現路由的 WSGI 應用程式造成問題。" +"這個處置器會移除任何這樣的重複路徑。" #: ../../library/wsgiref.rst:485 msgid "" @@ -570,6 +664,10 @@ msgid "" "IIS<7 is almost never deployed with the fix (Even IIS7 rarely uses it " "because there is still no UI for it.)." msgstr "" +"IIS 可以配置去傳遞正確的 ``PATH_INFO``,但這會導致 ``PATH_TRANSLATED`` 是錯誤的問題。幸運的是這個變數很少被使用" +"並且不受 WSGI 保證。然而,在 IIS<7 上,這個設置只能在虛擬主機層級進行,影響所有其他腳本的映射,其中許多在暴露 ``" +"PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即使是 IIS7 也很少使用它,因為它仍然沒有相" +"應的 UI)。" #: ../../library/wsgiref.rst:493 msgid "" @@ -578,6 +676,8 @@ msgid "" "`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where ``app`` " "is the WSGI application object you wish to invoke." msgstr "" +"CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處置器類別。它的使用方式與 :class:`CGIHandler` 相同," +"即,通過調用 ``IISCGIHandler().run(app)`` 來使用,其中 ``app`` 是你希望調用的 WSGI 應用程式物件。" #: ../../library/wsgiref.rst:503 msgid "" @@ -587,6 +687,8 @@ msgid "" "multithread`` and ``wsgi.multiprocess`` flags for any applications run by " "the handler instance." msgstr "" +"類似於 :class:`CGIHandler`,但不是使用 :mod:`sys` 和 :mod:`os` 模組,而是明確指定 CGI 環境與 I/O 流。" +"*multithread* 和 *multiprocess* 值用於設置由處置器實例運行的任何應用程式的旗標。" #: ../../library/wsgiref.rst:509 msgid "" @@ -596,6 +698,9 @@ msgid "" "``Status:`` header to send an HTTP status, you probably want to subclass " "this instead of :class:`SimpleHandler`." msgstr "" +"這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用的 :class:`SimpleHandler` 的子類別。" +"如果你正在撰寫一個使用``Status:``標頭來發送 HTTP 狀態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可" +"能會想要子類化這個類別來替代 :class:`SimpleHandler`。" #: ../../library/wsgiref.rst:518 msgid "" @@ -603,6 +708,8 @@ msgid "" "servers. If you are writing an HTTP server implementation, you will " "probably want to subclass this instead of :class:`BaseCGIHandler`." msgstr "" +"類似於 :class:`BaseCGIHandler`,但是被設計使用在 HTTP origin 伺服器。如果你正在撰寫 HTTP 伺服器的實作," +"你可能會想要子類化這個類別來替代 :class:`BaseCGIHandler`。" #: ../../library/wsgiref.rst:522 msgid "" @@ -613,12 +720,17 @@ msgid "" "streams are stored in the :attr:`stdin`, :attr:`stdout`, :attr:`stderr`, " "and :attr:`environ` attributes." msgstr "" +"這個類別是 :class:`BaseHandler` 的子類別。它透過建構器去覆寫 :meth:`__init__`、:meth:`get_stdin`" +"、:meth:`get_stderr`、:meth:`add_cgi_vars`、:meth:`_write`、和 :meth:`_flush` 方法來明確提供設置" +"環境與流。提供的環境與流被儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` " +"環境中。" #: ../../library/wsgiref.rst:529 msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." -msgstr "" +msgstr "*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊,像是" +" :class:`io.BufferedIOBase`。" #: ../../library/wsgiref.rst:535 msgid "" @@ -626,16 +738,18 @@ msgid "" "will handle a single HTTP request, although in principle you could create a " "subclass that was reusable for multiple requests." msgstr "" +"這是一個運行 WSGI 應用程式的抽象基礎類別。每個實例將處理單個 HTTP 請求,儘管原則上你可以建立" +"一個可重用於多個請求的子類別。" #: ../../library/wsgiref.rst:539 msgid "" ":class:`BaseHandler` instances have only one method intended for external " "use:" -msgstr "" +msgstr ":class:`BaseHandler` 實例只有一個供外部使用的方法:" #: ../../library/wsgiref.rst:544 msgid "Run the specified WSGI application, *app*." -msgstr "" +msgstr "運行指定 WSGI 應用程式,*app*。" #: ../../library/wsgiref.rst:546 msgid "" @@ -643,10 +757,12 @@ msgid "" "the process of running the application, and thus exist primarily to allow " "customizing the process." msgstr "" +"此方法在運行應用程式的過程中調用了所有其他 :class:`BaseHandler` 的方法,因此這些方法主要存在" +"是為了允許自定義整個過程。" #: ../../library/wsgiref.rst:550 msgid "The following methods MUST be overridden in a subclass:" -msgstr "" +msgstr "以下方法必須在子類別中覆寫:" #: ../../library/wsgiref.rst:555 msgid "" @@ -655,32 +771,35 @@ msgid "" "write and flush operations for greater efficiency when the underlying system " "actually has such a distinction." msgstr "" +"緩衝要傳送給客戶端的位元組 *data*。如果這個方法實際上傳送了數據也是可以的;當底層系統實際具有這種區分時," +":class:`BaseHandler` 為了更好的效能進而分離寫入和刷新操作。" #: ../../library/wsgiref.rst:563 msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." msgstr "" +"強制將緩衝數據傳送到客戶端。如果這是一個無操作的方法(即,如果 :meth:`_write` 實際上發送了數據),那麼是可以的。" #: ../../library/wsgiref.rst:569 msgid "" "Return an object compatible with :class:`~wsgiref.types.InputStream` " "suitable for use as the ``wsgi.input`` of the request currently being " "processed." -msgstr "" +msgstr "回傳一個與 :class:`~wsgiref.types.InputStream` 相容的物件並適用於用作當前正在處理請求的 ``wsgi.input``。" #: ../../library/wsgiref.rst:576 msgid "" "Return an object compatible with :class:`~wsgiref.types.ErrorStream` " "suitable for use as the ``wsgi.errors`` of the request currently being " "processed." -msgstr "" +msgstr "回傳一個與 :class:`~wsgiref.types.ErrorStream` 相容的物件並適用於用作當前正在處理請求的 ``wsgi.errors``。" #: ../../library/wsgiref.rst:583 msgid "" "Insert CGI variables for the current request into the :attr:`environ` " "attribute." -msgstr "" +msgstr "將當前請求的 CGI 變數插入到 :attr:`environ` 屬性中。" #: ../../library/wsgiref.rst:585 msgid "" @@ -690,10 +809,12 @@ msgid "" "additional information before attempting to create a customized :class:" "`BaseHandler` subclass." msgstr "" +"以下是你可能希望覆寫的其他方法和屬性。這個列表只是一個摘要,然而,不包括可以被覆寫的每個方法。" +"在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,您應該參考文件說明和原始碼以獲得更多資訊。" #: ../../library/wsgiref.rst:591 msgid "Attributes and methods for customizing the WSGI environment:" -msgstr "" +msgstr "用於自定義 WSGI 環境的屬性和方法:" #: ../../library/wsgiref.rst:596 msgid "" @@ -701,6 +822,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" +"用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 true,但在其他子" +"類別中可能有不同的默認值(或由建構器設置)。" #: ../../library/wsgiref.rst:603 msgid "" @@ -708,6 +831,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" +"用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 true,但在其他子" +"類別中可能有不同的默認值(或由建構器設置)。" #: ../../library/wsgiref.rst:610 msgid "" @@ -715,6 +840,8 @@ msgid "" "defaults to false in :class:`BaseHandler`, but :class:`CGIHandler` sets it " "to true by default." msgstr "" +"用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false,但 :class:`CGIHandler`" +"默認將其設置為 true。" #: ../../library/wsgiref.rst:617 msgid "" @@ -725,6 +852,8 @@ msgid "" "considered read-only, since the default value is shared between multiple " "classes and instances." msgstr "" +"默認環境變數包含在每一個請求的 WSGI 環境中。默認情況下,這是在載入 :mod:`wsgiref.handlers` 時的 `os.environ`" +" 副本,但子類別可以在類別或實例層級建立自己的副本。注意字典應該被視為只讀,因為默認值在多個類別與實例中共享。" #: ../../library/wsgiref.rst:627 msgid "" @@ -734,12 +863,15 @@ msgid "" "for handlers (such as :class:`BaseCGIHandler` and :class:`CGIHandler`) that " "are not HTTP origin servers." msgstr "" +"如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置默認的 ``SERVER_SOFTWARE`` WSGI 環境變數,並且還將" +"用於設置 HTTP 回應中的默認 ``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置器(例如 :class:`BaseCGIHandler`" +" 和 :class:`CGIHandler`),此屬性將被忽略。" #: ../../library/wsgiref.rst:633 msgid "" "The term \"Python\" is replaced with implementation specific term like " "\"CPython\", \"Jython\" etc." -msgstr "" +msgstr "將術語 \"Python\" 替換為特定實作的術語,如 \"CPython\"、\"Jython\" 等。" #: ../../library/wsgiref.rst:639 msgid "" @@ -748,6 +880,8 @@ msgid "" "util` to guess whether the scheme should be \"http\" or \"https\", based on " "the current request's :attr:`environ` variables." msgstr "" +"回傳用於當前請求的 URL scheme。默認的實作使用 :mod:`wsgiref.util` 中的 :func:`guess_scheme`函式" +"去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :attr:`environ` 變數。" #: ../../library/wsgiref.rst:647 msgid "" @@ -758,10 +892,14 @@ msgid "" "``SERVER_SOFTWARE`` key if not present, as long as the :attr:`origin_server` " "attribute is a true value and the :attr:`server_software` attribute is set." msgstr "" +"將 :attr:`environ` 屬性設置為完全填充的 WSGI 環境。默認的實作使用上述所有方法和屬性,以及" +" :meth:`get_stdin`、:meth:`get_stderr` 和 :meth:`add_cgi_vars` 方法以及 :attr:`" +"wsgi_file_wrapper` 屬性。如果不呈現它也會插入一個 ``SERVER_SOFTWARE`` 關鍵字,只要 :attr:" +"`origin_server` 屬性是一個 true 值並且 :attr:`server_software` 屬性被設置。" #: ../../library/wsgiref.rst:654 msgid "Methods and attributes for customizing exception handling:" -msgstr "" +msgstr "用於自定義例外處理的屬性和方法:" #: ../../library/wsgiref.rst:659 msgid "" @@ -772,18 +910,21 @@ msgid "" "traceback to an administrator, or whatever other action may be deemed " "suitable." msgstr "" +"將 *exc_info* 元組記錄到伺服器日誌中。*exc_info* 是一個 ``(type, value, traceback)`` 元組。" +"默認實作只是將追蹤資訊寫入到請求的 ``wsgi.errors`` 流中並刷新它。子類別可以覆蓋此方法以更改格式或重新定" +"向輸出,將追蹤資訊發送給管理員,或執行其他被認為合適的操作。" #: ../../library/wsgiref.rst:668 msgid "" "The maximum number of frames to include in tracebacks output by the default :" "meth:`log_exception` method. If ``None``, all frames are included." -msgstr "" +msgstr "默認的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``,則包含所有幀。" #: ../../library/wsgiref.rst:674 msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." -msgstr "" +msgstr "這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給客戶端前如果發生錯誤才會被調用。" #: ../../library/wsgiref.rst:677 msgid "" @@ -791,6 +932,8 @@ msgid "" "should pass that information to *start_response* when calling it (as " "described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" +"此方法使用 ``sys.exception()`` 訪問當前的錯誤,當呼叫它(如 :pep:`3333` 的 \"Error Handling\" 部分所描述)" +"時應該傳遞資訊給 *start_response*。" #: ../../library/wsgiref.rst:681 msgid "" @@ -798,6 +941,8 @@ msgid "" "`error_headers`, and :attr:`error_body` attributes to generate an output " "page. Subclasses can override this to produce more dynamic error output." msgstr "" +"默認的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:`error_body` 屬性產生輸出頁面。" +"子類別可以覆蓋此方法以生成更動態的錯誤輸出。" #: ../../library/wsgiref.rst:685 msgid "" @@ -806,12 +951,14 @@ msgid "" "special to enable diagnostic output, which is why the default implementation " "doesn't include any." msgstr "" +"然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,您應該需要採取特殊措施才能啟用診斷輸出," +"這就是默認實作不包括任何診斷資訊的原因。" #: ../../library/wsgiref.rst:693 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." -msgstr "" +msgstr "用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;默認為 500 狀態碼和訊息。" #: ../../library/wsgiref.rst:699 msgid "" @@ -819,6 +966,8 @@ msgid "" "response headers (``(name, value)`` tuples), as described in :pep:`3333`. " "The default list just sets the content type to ``text/plain``." msgstr "" +"用於錯誤回應的 HTTP 標頭。這應該是一個 WSGI 回應標頭的串列(``(name, value)`` 元組),如 :pep:`3333` 中所描述。" +"默認串列只設置內容種類為 ``text/plain``。" #: ../../library/wsgiref.rst:706 msgid "" @@ -826,12 +975,14 @@ msgid "" "It defaults to the plain text, \"A server error occurred. Please contact " "the administrator.\"" msgstr "" +"錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。默認為純正文,\"伺服器發生錯誤。請聯繫管理員。\"" #: ../../library/wsgiref.rst:710 msgid "" "Methods and attributes for :pep:`3333`'s \"Optional Platform-Specific File " "Handling\" feature:" msgstr "" +"用於 :pep:`3333` 中的 \"Optional Platform-Specific File Handling\" 功能的方法和屬性:" #: ../../library/wsgiref.rst:716 msgid "" @@ -839,6 +990,8 @@ msgid "" "FileWrapper`, or ``None``. The default value of this attribute is the :" "class:`wsgiref.util.FileWrapper` class." msgstr "" +"一個 ``wsgi.file_wrapper`` 工廠,與 :class:`wsgiref.types.FileWrapper` 兼容,或者為 ``None``。" +"這個屬性的默認值是 :class:`wsgiref.util.FileWrapper` 類別。" #: ../../library/wsgiref.rst:723 msgid "" @@ -849,10 +1002,12 @@ msgid "" "default transmission code will not be executed. The default implementation " "of this method just returns a false value." msgstr "" +"覆蓋以實作特定平台的檔案傳輸。只有當應用程序的回傳值是由 :attr:`wsgi_file_wrapper` 屬性指定的類別實例時才會調用此方法。" +"如果它能夠成功傳輸檔案應該回傳一個 true 值,以便不執行默認的傳輸程式碼。該方法的默認實作只回傳一個 false 值。" #: ../../library/wsgiref.rst:730 msgid "Miscellaneous methods and attributes:" -msgstr "" +msgstr "其他方法和屬性:" #: ../../library/wsgiref.rst:735 msgid "" @@ -861,18 +1016,23 @@ msgid "" "rather than via a CGI-like gateway protocol that wants the HTTP status in a " "special ``Status:`` header." msgstr "" +"這個屬性應該被設置為 true 值,如果處置器的 :meth:`_write` 和 :meth:`_flush` 被用於直接與客戶端通訊,而不是透過" +"CGI-like 的閘道協議希望 HTTP 狀態在特殊的 ``Status:`` 標頭中。" #: ../../library/wsgiref.rst:740 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" +"這個屬性在 :class:`BaseCGIHandler` 默認值為 true,但是在 :class:`BaseCGIHandler` 和 :class:`CGIHandler`" +"為 false。" #: ../../library/wsgiref.rst:746 msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." msgstr "" +"如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給客戶端的回應的 HTTP 版本。預設為 ``\"1.0\"``。" #: ../../library/wsgiref.rst:752 msgid "" @@ -885,6 +1045,11 @@ msgid "" "bytes, but the system encoding used by Python to decode it is anything other " "than ISO-8859-1 (e.g. Unix systems using UTF-8)." msgstr "" +"從 ``os.environ`` 轉碼 CGI 變數到 :pep:`3333` 中的 \"bytes in unicode\" 字串,並回傳一個新字典。" +"這個函式被 :class:`CGIHandler` 和 :class:`IISCGIHandler` 使用來直接替代 ``os.environ``,在所有平台" +"和使用 Python 3 的網頁伺服器上不一定符合 WSGI 標準,具體來說,在 OS 的實際環境是 Unicode(例如 Windows)" +"的情況下,或者在環境是位元組的情況下,但 Python 用於解碼它的系統編碼不是 ISO-8859-1 (例如使用 UTF-8 的 Unix" +" 系統)。" #: ../../library/wsgiref.rst:761 msgid "" @@ -892,42 +1057,49 @@ msgid "" "to use this routine instead of just copying values out of ``os.environ`` " "directly." msgstr "" +"如果你自己正在實作 CGI-based 處置器,你可能想要使用這個函式來替換單純直接從 ``os.environ`` 中複製值。" #: ../../library/wsgiref.rst:769 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" -msgstr "" +msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 種類。" #: ../../library/wsgiref.rst:775 msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." msgstr "" +"這個模組提供在 :pep:`3333` 中所描述的各種用於靜態類型檢查的種類。" #: ../../library/wsgiref.rst:783 msgid "" "A :class:`typing.Protocol` describing `start_response() `_ callables (:pep:`3333`)." -msgstr "" +msgstr "一個描述 `start_response() `_ " +"可呼叫物件的 :class:`typing.Protocol`(:pep:`3333`)。" #: ../../library/wsgiref.rst:789 msgid "A type alias describing a WSGI environment dictionary." -msgstr "" +msgstr "一個描述 WSGI 環境字典的型別別名。" #: ../../library/wsgiref.rst:793 msgid "A type alias describing a WSGI application callable." -msgstr "" +msgstr "一個描述 WSGI 應用程式可呼叫物件的型別別名。" #: ../../library/wsgiref.rst:797 msgid "" "A :class:`typing.Protocol` describing a `WSGI Input Stream `_." msgstr "" +"一個描述 `WSGI Input Stream `_ " +"的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:802 msgid "" "A :class:`typing.Protocol` describing a `WSGI Error Stream `_." msgstr "" +"一個描述 `WSGI Error Stream `_ " +"的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:807 msgid "" @@ -935,6 +1107,8 @@ msgid "" "org/pep-3333/#optional-platform-specific-file-handling>`_. See :class:" "`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." msgstr "" +"一個描述 `file wrapper `_ 的" +" :class:`typing.Protocol`。請參閱 :class:`wsgiref.util.FileWrapper` 來瞭解此協議的具體實作。" #: ../../library/wsgiref.rst:814 msgid "Examples" @@ -942,10 +1116,15 @@ msgstr "範例" #: ../../library/wsgiref.rst:816 msgid "This is a working \"Hello World\" WSGI application::" -msgstr "" +msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式" + +"::" #: ../../library/wsgiref.rst:845 msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" msgstr "" +"WSGI 應用程式的範例服務的當前目錄,並接受命令行上的可選目錄和埠號(預設:8000)" + +"::" From 43d8b04bf25d85f5f6a9134f1d164ec40412d19e Mon Sep 17 00:00:00 2001 From: neochang Date: Sun, 3 Sep 2023 21:17:44 +0800 Subject: [PATCH 2/6] docs(wsgiref): modified wsgiref.po for formatting via powrap library --- library/wsgiref.po | 436 +++++++++++++++++++++++++-------------------- 1 file changed, 242 insertions(+), 194 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index 1c19dab53e..8712181214 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -227,7 +227,8 @@ msgid "" "Return ``True`` if 'header_name' is an HTTP/1.1 \"Hop-by-Hop\" header, as " "defined by :rfc:`2616`." msgstr "" -"如果 'header_name' 是根據 :rfc:`2616` 所定義的 HTTP/1.1 \"Hop-by-Hop\" 標頭,則回傳 ``True``。" +"如果 'header_name' 是根據 :rfc:`2616` 所定義的 HTTP/1.1 \"Hop-by-Hop\" 標頭," +"則回傳 ``True``。" #: ../../library/wsgiref.rst:158 msgid "" @@ -238,9 +239,10 @@ msgid "" "object's :meth:`read` method to obtain bytestrings to yield. When :meth:" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" -":class:`wsgiref.types.FileWrapper` 協議的具體實作 用於將類似檔案的物件轉換為 :term:`iterator`。" -"產生的物件是 :term:`iterables`。當物件進行疊代時,將重複並可選的 *blksize* 引數傳遞給 *filelike* 物件的" -":meth"`read` 方法去獲得與產生位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" +":class:`wsgiref.types.FileWrapper` 協議的具體實作 用於將類似檔案的物件轉換" +"為 :term:`iterator`。產生的物件是 :term:`iterables`。當物件進行疊代時,將重複" +"並可選的 *blksize* 引數傳遞給 *filelike* 物件的:meth:`read` 方法去獲得與產生" +"位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" #: ../../library/wsgiref.rst:166 msgid "" @@ -248,8 +250,8 @@ msgid "" "a :meth:`close` method, and it will invoke the *filelike* object's :meth:" "`close` method when called." msgstr "" -"如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方法,並在調" -"用時呼叫 *filelike* 物件的 :meth:`close` 方法。" +"如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方" +"法,並在調用時呼叫 *filelike* 物件的 :meth:`close` 方法。" #: ../../library/wsgiref.rst:182 msgid "Support for :meth:`__getitem__` method has been removed." @@ -263,7 +265,9 @@ msgstr ":mod:`wsgiref.headers` -- WSGI 回應標頭工具。" msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." -msgstr "這個模組提供單一類別,:class:`Headers`,用於使用類似映射的介面方便地操作 WSGI 回應標頭。" +msgstr "" +"這個模組提供單一類別,:class:`Headers`,用於使用類似映射的介面方便地操作 " +"WSGI 回應標頭。" #: ../../library/wsgiref.rst:199 msgid "" @@ -271,8 +275,8 @@ msgid "" "header name/value tuples as described in :pep:`3333`. The default value of " "*headers* is an empty list." msgstr "" -"建立一個類似映射物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/value 元組的標頭串列。" -"*headers* 的默認值是一個空串列。" +"建立一個類似映射物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/" +"value 元組的標頭串列。*headers* 的默認值是一個空串列。" #: ../../library/wsgiref.rst:203 msgid "" @@ -285,10 +289,12 @@ msgid "" "the end of the wrapped header list. Headers' existing order is generally " "maintained, with new headers added to the end of the wrapped list." msgstr "" -":class:`Headers` 物件支援典型映射操作包括 :meth:`__getitem__`、:meth:`get`、:meth:`__setitem__`、" -":meth:`setdefault`、:meth:`__delitem__` 以及 :meth:`__contains__`。對於這些方法中的每一個,鍵是標頭" -"名稱(以不區分大小寫方式處理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標頭的所有現有值,然後將新值" -"添加到包裝的標頭串列末尾。標頭的現有順序通常保持不變,新標頭會添加到包裝串列的末尾。" +":class:`Headers` 物件支援典型映射操作包括 :meth:`__getitem__`、:meth:`get`、:" +"meth:`__setitem__`、:meth:`setdefault`、:meth:`__delitem__` 以及 :meth:" +"`__contains__`。對於這些方法中的每一個,鍵是標頭名稱(以不區分大小寫方式處" +"理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標頭的所有現有值," +"然後將新值添加到包裝的標頭串列末尾。標頭的現有順序通常保持不變,新標頭會添加" +"到包裝串列的末尾。" #: ../../library/wsgiref.rst:212 msgid "" @@ -297,8 +303,9 @@ msgid "" "nonexistent header just returns ``None``, and deleting a nonexistent header " "does nothing." msgstr "" -"不同於字典,當你嘗試取得或刪除包裝的標頭串列不存在的鍵,:class:`Headers` 物件不會引發例外錯誤。" -"取得不存在的標頭只會回傳 ``None``,而刪除不存在的標頭則不會有任何效果。" +"不同於字典,當你嘗試取得或刪除包裝的標頭串列不存在的鍵,:class:`Headers` 物件" +"不會引發例外錯誤。取得不存在的標頭只會回傳 ``None``,而刪除不存在的標頭則不會" +"有任何效果。" #: ../../library/wsgiref.rst:217 msgid "" @@ -310,10 +317,10 @@ msgid "" "In fact, the :meth:`items` method just returns a copy of the wrapped header " "list." msgstr "" -":class:`Headers` 物件還支援 :meth:`keys`、:meth:`value`、和 :meth:`items` 方法。" -"由 :meth:`keys` 和 :meth:`items` 回傳的串列在存在多值標頭時可能會包含相同的鍵。" -":class:`Headers` 物件的 ``len()`` 與 "meth:`items` 的長度相同,也與包裝標頭串列的長度相同。" -"實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" +":class:`Headers` 物件還支援 :meth:`keys`、:meth:`value`、和 :meth:`items` 方" +"法。由 :meth:`keys` 和 :meth:`items` 回傳的串列在存在多值標頭時可能會包含相同" +"的鍵。:class:`Headers` 物件的 ``len()`` 與 :meth:`items` 的長度相同,也與包裝" +"標頭串列的長度相同。實際上,:meth:`items` 方法只是回傳包裝的標頭串列的副本。" #: ../../library/wsgiref.rst:224 msgid "" @@ -323,8 +330,9 @@ msgid "" "line is terminated by a carriage return and line feed, and the bytestring is " "terminated with a blank line." msgstr "" -"對 :class:`Header` 物件調用 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格式化的位元組字串。" -"每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回車和換行結束,而該位元組字串則以空行結束。" +"對 :class:`Header` 物件調用 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" +"式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" +"車和換行結束,而該位元組字串則以空行結束。" #: ../../library/wsgiref.rst:230 msgid "" @@ -332,8 +340,8 @@ msgid "" "`Headers` objects also have the following methods for querying and adding " "multi-valued headers, and for adding headers with MIME parameters:" msgstr "" -"除了映射介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭的以及附加 MIME 參數" -"標頭的方法:" +"除了映射介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭" +"的以及附加 MIME 參數標頭的方法:" #: ../../library/wsgiref.rst:237 msgid "Return a list of all the values for the named header." @@ -346,14 +354,16 @@ msgid "" "fields deleted and re-inserted are always appended to the header list. If " "no fields exist with the given name, returns an empty list." msgstr "" -"回傳的串列按照它們在在原始的標頭串列出現的順序或是被添加到此實例的順序進行排序,並且可能包含重複的內容。" -"任何被刪除並重新插入的欄位都會被添加到標頭串列的末尾。如果不存在指定名稱的欄位,則回傳空串列。" +"回傳的串列按照它們在在原始的標頭串列出現的順序或是被添加到此實例的順序進行排" +"序,並且可能包含重複的內容。任何被刪除並重新插入的欄位都會被添加到標頭串列的" +"末尾。如果不存在指定名稱的欄位,則回傳空串列。" #: ../../library/wsgiref.rst:247 msgid "" "Add a (possibly multi-valued) header, with optional MIME parameters " "specified via keyword arguments." -msgstr "添加一個(可能是多值的)標頭,可通過關鍵字引數來指定選擇性的 MIME 參數。" +msgstr "" +"添加一個(可能是多值的)標頭,可通過關鍵字引數來指定選擇性的 MIME 參數。" #: ../../library/wsgiref.rst:250 msgid "" @@ -366,18 +376,15 @@ msgid "" "only the parameter name is added. (This is used for MIME parameters without " "a value.) Example usage::" msgstr "" -"*name* 是要添加的標頭欄位。關鍵字引數可使於設定標頭欄位的 MIME 參數。每一個參數必須是字串或是 ``None``。" -"由於破折號在 Python 識別符中是非法的,但是許多 MIME 參數名稱包含破折號,因此參數名稱的底線會轉換成破折號。" -"如果參數值是字串,則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加參數名稱。" -"(這使用於沒有值的 MIME 參數)使用範例:" - -"::" +"*name* 是要添加的標頭欄位。關鍵字引數可使於設定標頭欄位的 MIME 參數。每一個參" +"數必須是字串或是 ``None``。由於破折號在 Python 識別符中是非法的,但是許多 " +"MIME 參數名稱包含破折號,因此參數名稱的底線會轉換成破折號。如果參數值是字串," +"則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加" +"參數名稱。(這使用於沒有值的 MIME 參數)使用範例:::" #: ../../library/wsgiref.rst:260 msgid "The above will add a header that looks like this::" -msgstr "上述操作將添加看起來像這樣的標頭:" - -"::" +msgstr "上述操作將添加看起來像這樣的標頭:::" #: ../../library/wsgiref.rst:265 msgid "*headers* parameter is optional." @@ -397,10 +404,11 @@ msgid "" "request. (E.g., using the :func:`shift_path_info` function from :mod:" "`wsgiref.util`.)" msgstr "" -"這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI 應用程式。每個伺服器執行個體" -"在特定的主機與埠提供單一的 WSGI 應用程式。如果你想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI" -"應用程式以解析 ``PATH_INFO`` 去選擇為每個請求調用哪個應用程式。(例如,使用來自 :mod:`wsgiref.util` 的" -":func:`shift_path_info` 函式。)" +"這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI " +"應用程式。每個伺服器執行個體在特定的主機與埠提供單一的 WSGI 應用程式。如果你" +"想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI應用程式以解析 " +"``PATH_INFO`` 去選擇為每個請求調用哪個應用程式。(例如,使用來自 :mod:" +"`wsgiref.util` 的:func:`shift_path_info` 函式。)" #: ../../library/wsgiref.rst:287 msgid "" @@ -410,8 +418,9 @@ msgid "" "*handler_class*. *app* must be a WSGI application object, as defined by :" "pep:`3333`." msgstr "" -"建立一個新的 WSGI 伺服器監聽 *host* 和 *port*,接受 *app* 的連線。回傳值是提供 "*server_class* 的實例," -"並將使用指定的 *handler_class* 處理請求。*app* 必須是一個 WSGI 應用程式物件,如 :pep:`3333` 所定義。" +"建立一個新的 WSGI 伺服器監聽 *host* 和 *port*,接受 *app* 的連線。回傳值是提" +"供 *server_class* 的實例,並將使用指定的 *handler_class* 處理請求。*app* 必須" +"是一個 WSGI 應用程式物件,如 :pep:`3333` 所定義。" #: ../../library/wsgiref.rst:308 msgid "" @@ -421,9 +430,10 @@ msgid "" "WSGI server (such as :mod:`wsgiref.simple_server`) is able to run a simple " "WSGI application correctly." msgstr "" -"這個函式是一個簡單但完整的 WSGI 應用程式,它回傳一個包含訊息 \"Hello world!\" 和在 *environ* 參數" -"中提供的鍵值對串列的文字頁面。這對於驗證 WSGI 伺服器(例如 :mod:`wsgiref.simple_server`)是否能正" -"確執行簡單的 WSGI 應用程式非常有用。" +"這個函式是一個簡單但完整的 WSGI 應用程式,它回傳一個包含訊息 \"Hello world!" +"\" 和在 *environ* 參數中提供的鍵值對串列的文字頁面。這對於驗證 WSGI 伺服器" +"(例如 :mod:`wsgiref.simple_server`)是否能正確執行簡單的 WSGI 應用程式非常有" +"用。" #: ../../library/wsgiref.rst:317 msgid "" @@ -431,16 +441,17 @@ msgid "" "port)`` tuple, and *RequestHandlerClass* should be the subclass of :class:" "`http.server.BaseHTTPRequestHandler` that will be used to process requests." msgstr "" -"建立一個 :class:`WSGIServer` 實例。*server_address* 應該是一個 ``(host, port)`` 元組,而 " -"*RequestHandlerClass* 應該是 :class:`http.server.BaseHTTPRequestHandler` 的子類別,將用" -"於處理請求。 +"建立一個 :class:`WSGIServer` 實例。*server_address* 應該是一個 ``(host, " +"port)`` 元組,而 *RequestHandlerClass* 應該是 :class:`http.server." +"BaseHTTPRequestHandler` 的子類別,將用於處理請求。" #: ../../library/wsgiref.rst:322 msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." msgstr "" -"通常你不需要呼叫這個建構器,因為 :func:`make_server` 函式可以為你處理所有細節。" +"通常你不需要呼叫這個建構器,因為 :func:`make_server` 函式可以為你處理所有細" +"節。" #: ../../library/wsgiref.rst:325 msgid "" @@ -448,17 +459,15 @@ msgid "" "of its methods (such as :meth:`serve_forever` and :meth:`handle_request`) " "are available. :class:`WSGIServer` also provides these WSGI-specific methods:" msgstr "" -":class:`WSGIServer` 是 :class:`http.server.HTTPServer` 的子類別,因此它的所有方法" -"(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:`WSGIServer`" -"也提供這些特定於 WSGI 的方法:" - +":class:`WSGIServer` 是 :class:`http.server.HTTPServer` 的子類別,因此它的所有" +"方法(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:" +"`WSGIServer`也提供這些特定於 WSGI 的方法:" #: ../../library/wsgiref.rst:332 msgid "" "Sets the callable *application* as the WSGI application that will receive " "requests." -msgstr "" -"將可呼叫的 *application* 設定為接收請求的 WSGI 應用程式。" +msgstr "將可呼叫的 *application* 設定為接收請求的 WSGI 應用程式。" #: ../../library/wsgiref.rst:338 msgid "Returns the currently set application callable." @@ -470,8 +479,8 @@ msgid "" "`set_app` is normally called by :func:`make_server`, and the :meth:`get_app` " "exists mainly for the benefit of request handler instances." msgstr "" -"然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會被 :func:`make_server` 呼叫" -"而 :meth:`get_app` 主要存在於請求處置器實例的好處上。" +"然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會被 :" +"func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處置器實例的好處上。" #: ../../library/wsgiref.rst:347 msgid "" @@ -479,8 +488,8 @@ msgid "" "*client_address* (a ``(host,port)`` tuple), and *server* (:class:" "`WSGIServer` instance)." msgstr "" -"為給定的 *request*(即一個 socket)、*client_address*(一個 ``(host,port)`` 位元組)" -"、*server*(:class:`WSGIServer` 實例)建立一個 HTTP 處置器。" +"為給定的 *request*(即一個 socket)、*client_address*(一個 ``(host,port)`` " +"位元組)、*server*(:class:`WSGIServer` 實例)建立一個 HTTP 處置器。" #: ../../library/wsgiref.rst:350 msgid "" @@ -490,9 +499,9 @@ msgid "" "`make_server` function. Some possibly relevant methods for overriding in " "subclasses:" msgstr "" -"你不需要直接建立這個類的實例;它們會在需要時由 :class:WSGIServer 物件自動建立。不過,你可以" -"建立這個類的子類並將其作為 *handler_class* 提供給 :func:`make_server` 函式。一些可能相關" -"的方法可以在子類中進行覆寫:" +"你不需要直接建立這個類的實例;它們會在需要時由 :class:WSGIServer 物件自動建" +"立。不過,你可以建立這個類的子類並將其作為 *handler_class* 提供給 :func:" +"`make_server` 函式。一些可能相關的方法可以在子類中進行覆寫:" #: ../../library/wsgiref.rst:359 msgid "" @@ -503,9 +512,10 @@ msgid "" "return a new dictionary containing all of the relevant CGI environment " "variables as specified in :pep:`3333`." msgstr "" -"唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。默認的實作會複製 :class:" -"`WSGIServer` 物件的 :attr:`base_environ` 字典屬性的內容以及添加從 HTTP 請求中衍生的各種標頭" -"。每次呼叫這個方法都應該回傳一個包含所有如 :pep:`3333` 所指定的相關 CGI 環境變數的新字典。" +"唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。默認的實作會" +"複製 :class:`WSGIServer` 物件的 :attr:`base_environ` 字典屬性的內容以及添加" +"從 HTTP 請求中衍生的各種標頭。每次呼叫這個方法都應該回傳一個包含所有如 :pep:" +"`3333` 所指定的相關 CGI 環境變數的新字典。" #: ../../library/wsgiref.rst:370 msgid "" @@ -520,9 +530,8 @@ msgid "" "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " "application interface." msgstr "" -"處理 HTTP 請求。默認實作會使用 :mod:`wsgiref.handler` 類別來建立處置器實例來實作實際" -" WSGI 應用程式介面。" - +"處理 HTTP 請求。默認實作會使用 :mod:`wsgiref.handler` 類別來建立處置器實例來" +"實作實際 WSGI 應用程式介面。" #: ../../library/wsgiref.rst:382 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" @@ -536,10 +545,11 @@ msgid "" "application objects that validate communications between a WSGI server or " "gateway and a WSGI application object, to check both sides for protocol " "conformance." -msgstr "" -"當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體時,使用 :mod:`wsgiref.validate`來驗證新程式" -"碼的符合性可能會很有用。這個模組提供一個函式用於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與" -" WSGI 應用程式物件之間的通訊,以檢查雙方協議的符合性。" +msgstr "" +"當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體時,使用 :mod:" +"`wsgiref.validate`來驗證新程式碼的符合性可能會很有用。這個模組提供一個函式用" +"於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用程式物件" +"之間的通訊,以檢查雙方協議的符合性。" #: ../../library/wsgiref.rst:395 msgid "" @@ -549,15 +559,17 @@ msgid "" "virtually certain that either the server or application is not 100% " "compliant." msgstr "" -"請注意這個工具並不保證完全符合 :pep:`3333`;這個模組中的錯誤不一定代表不存在錯誤。但是,如果" -"如果這個模組產生錯誤,那麼幾乎可以確定伺服器或應用程式不是 100% 符合標準。" +"請注意這個工具並不保證完全符合 :pep:`3333`;這個模組中的錯誤不一定代表不存在" +"錯誤。但是,如果如果這個模組產生錯誤,那麼幾乎可以確定伺服器或應用程式不是 " +"100% 符合標準。" #: ../../library/wsgiref.rst:400 msgid "" "This module is based on the :mod:`paste.lint` module from Ian Bicking's " "\"Python Paste\" library." msgstr "" -"這個模組基於 Ian Bicking 的 \"Python Paste"\ 函式庫的 :mod:`paste.lint` 模組。" +"這個模組基於 Ian Bicking 的 \"Python Paste\" 函式庫的 :mod:`paste.lint` 模" +"組。" #: ../../library/wsgiref.rst:406 msgid "" @@ -566,8 +578,9 @@ msgid "" "will check that both the *application* and the server invoking it are " "conforming to the WSGI specification and to :rfc:`2616`." msgstr "" -"封裝 *application* 並回傳一個新的 WSGI 應用程式物件。回傳的應用程式將轉發所有請求給原始的 *application*" -",並檢查 *application* 和呼叫它的伺服器是否符合 WSGI 規範和 :rfc:`2616`。" +"封裝 *application* 並回傳一個新的 WSGI 應用程式物件。回傳的應用程式將轉發所有" +"請求給原始的 *application*,並檢查 *application* 和呼叫它的伺服器是否符合 " +"WSGI 規範和 :rfc:`2616`。" #: ../../library/wsgiref.rst:411 msgid "" @@ -579,12 +592,11 @@ msgid "" "occurred, and dump the traceback to ``sys.stderr`` or some other error " "stream." msgstr "" -"任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;請注意,但是," - -"任何檢測到的不符合都將引發 :exc:`AssertionError`;但請注意,如何處理這些錯誤取決於伺服器。" -"例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref.simple_server` 以及其他伺服器(未" -"覆蓋錯誤處理方法以執行其他操作的伺服器)將僅輸出一條錯誤訊息,指示發生錯誤,並將回溯信息輸出到 ``" -"sys.stderr`` 或是其他錯誤流。" +"任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;請注意,但是,任何" +"檢測到的不符合都將引發 :exc:`AssertionError`;但請注意,如何處理這些錯誤取決" +"於伺服器。例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref.simple_server` " +"以及其他伺服器(未覆蓋錯誤處理方法以執行其他操作的伺服器)將僅輸出一條錯誤訊" +"息,指示發生錯誤,並將回溯信息輸出到 ``sys.stderr`` 或是其他錯誤流。" #: ../../library/wsgiref.rst:418 msgid "" @@ -595,14 +607,14 @@ msgid "" "to ``sys.stderr`` (*not* ``wsgi.errors``, unless they happen to be the same " "object)." msgstr "" -這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上可能不會被 :pep:`3333`" -" 禁止的行為。除非使用 Python 命令行選項或 :mod:`warnings` API,抑制了這些警告,否則這類警告將被寫入" -"到 ``sys.stderr``(*not* ``wsgi.errors``,除非它們碰巧是相同的物件)。" +"這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上" +"可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令行選項或 :mod:" +"`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``(*not* " +"``wsgi.errors``,除非它們碰巧是相同的物件)。" #: ../../library/wsgiref.rst:450 msgid ":mod:`wsgiref.handlers` -- server/gateway base classes" -msgstr "" -":mod:`wsgiref.handlers` -- 伺服器 / 閘道基本類別" +msgstr ":mod:`wsgiref.handlers` -- 伺服器 / 閘道基本類別" #: ../../library/wsgiref.rst:456 msgid "" @@ -611,8 +623,9 @@ msgid "" "a WSGI application, as long as they are given a CGI-like environment, along " "with input, output, and error streams." msgstr "" -"這個模組提供實作 WSGI 伺服器和閘道的基礎處置器類別。這些基礎類別處置器大部分與 WSGI 應用程式通訊的工作," -"只要它們被提供 CGI-like 環境,以及輸入、輸出和錯誤流。" +"這個模組提供實作 WSGI 伺服器和閘道的基礎處置器類別。這些基礎類別處置器大部分" +"與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及輸入、輸出和錯" +"誤流。" #: ../../library/wsgiref.rst:464 msgid "" @@ -621,9 +634,10 @@ msgid "" "run it as a CGI script. Simply invoke ``CGIHandler().run(app)``, where " "``app`` is the WSGI application object you wish to invoke." msgstr "" -"這是基於 CGI 的調用方式並透過 ``sys.stdin``、``sys.stdout``、``sys.stderr`` 和 ``os.environ``。" -"當您擁有一個 WSGI 應用程式並希望將其作為 CGI 腳本運行時是很有用的。只需呼叫 ``CGIHandler().run(app)``" -",其中 ``app`` 是你希望調用的 WSGI 應用程式物件。 +"這是基於 CGI 的調用方式並透過 ``sys.stdin``、``sys.stdout``、``sys.stderr`` " +"和 ``os.environ``。當您擁有一個 WSGI 應用程式並希望將其作為 CGI 腳本運行時是" +"很有用的。只需呼叫 ``CGIHandler().run(app)``,其中 ``app`` 是你希望調用的 " +"WSGI 應用程式物件。" #: ../../library/wsgiref.rst:469 msgid "" @@ -632,9 +646,9 @@ msgid "" "to true, and always uses :mod:`sys` and :mod:`os` to obtain the necessary " "CGI streams and environment." msgstr "" -"這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true,``wsgi.multithread``" -"設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需" -"的 CGI 流以及環境。" +"這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true," +"``wsgi.multithread``設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" +"且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需的 CGI 流以及環境。" #: ../../library/wsgiref.rst:477 msgid "" @@ -642,8 +656,9 @@ msgid "" "Microsoft's IIS web server, without having set the config allowPathInfo " "option (IIS>=7) or metabase allowPathInfoForScriptMappings (IIS<7)." msgstr "" -"這是用於在 Microsoft 的 IIS 網頁伺服器上部署時使用的 :class:`CGIHandler` 的一個專門替代選擇,無需設置" -" config 的 allowPathInfo 選項(IIS>=7),或 metabase 的 allowPathInfoForScriptMappings 選項(IIS<7)。" +"這是用於在 Microsoft 的 IIS 網頁伺服器上部署時使用的 :class:`CGIHandler` 的一" +"個專門替代選擇,無需設置 config 的 allowPathInfo 選項(IIS>=7),或 metabase " +"的 allowPathInfoForScriptMappings 選項(IIS<7)。" #: ../../library/wsgiref.rst:481 msgid "" @@ -651,8 +666,8 @@ msgid "" "the front, causing problems for WSGI applications that wish to implement " "routing. This handler strips any such duplicated path." msgstr "" -"預設情況下,IIS 提供的 ``PATH_INFO`` 會在前面複製 ``SCRIPT_NAME``,對於希望實現路由的 WSGI 應用程式造成問題。" -"這個處置器會移除任何這樣的重複路徑。" +"預設情況下,IIS 提供的 ``PATH_INFO`` 會在前面複製 ``SCRIPT_NAME``,對於希望實" +"現路由的 WSGI 應用程式造成問題。這個處置器會移除任何這樣的重複路徑。" #: ../../library/wsgiref.rst:485 msgid "" @@ -664,10 +679,11 @@ msgid "" "IIS<7 is almost never deployed with the fix (Even IIS7 rarely uses it " "because there is still no UI for it.)." msgstr "" -"IIS 可以配置去傳遞正確的 ``PATH_INFO``,但這會導致 ``PATH_TRANSLATED`` 是錯誤的問題。幸運的是這個變數很少被使用" -"並且不受 WSGI 保證。然而,在 IIS<7 上,這個設置只能在虛擬主機層級進行,影響所有其他腳本的映射,其中許多在暴露 ``" -"PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即使是 IIS7 也很少使用它,因為它仍然沒有相" -"應的 UI)。" +"IIS 可以配置去傳遞正確的 ``PATH_INFO``,但這會導致 ``PATH_TRANSLATED`` 是錯誤" +"的問題。幸運的是這個變數很少被使用並且不受 WSGI 保證。然而,在 IIS<7 上,這個" +"設置只能在虛擬主機層級進行,影響所有其他腳本的映射,其中許多在暴露 " +"``PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即" +"使是 IIS7 也很少使用它,因為它仍然沒有相應的 UI)。" #: ../../library/wsgiref.rst:493 msgid "" @@ -676,8 +692,9 @@ msgid "" "`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where ``app`` " "is the WSGI application object you wish to invoke." msgstr "" -"CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處置器類別。它的使用方式與 :class:`CGIHandler` 相同," -"即,通過調用 ``IISCGIHandler().run(app)`` 來使用,其中 ``app`` 是你希望調用的 WSGI 應用程式物件。" +"CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處置器類別。它的使用" +"方式與 :class:`CGIHandler` 相同,即,通過調用 ``IISCGIHandler().run(app)`` 來" +"使用,其中 ``app`` 是你希望調用的 WSGI 應用程式物件。" #: ../../library/wsgiref.rst:503 msgid "" @@ -687,8 +704,9 @@ msgid "" "multithread`` and ``wsgi.multiprocess`` flags for any applications run by " "the handler instance." msgstr "" -"類似於 :class:`CGIHandler`,但不是使用 :mod:`sys` 和 :mod:`os` 模組,而是明確指定 CGI 環境與 I/O 流。" -"*multithread* 和 *multiprocess* 值用於設置由處置器實例運行的任何應用程式的旗標。" +"類似於 :class:`CGIHandler`,但不是使用 :mod:`sys` 和 :mod:`os` 模組,而是明確" +"指定 CGI 環境與 I/O 流。*multithread* 和 *multiprocess* 值用於設置由處置器實" +"例運行的任何應用程式的旗標。" #: ../../library/wsgiref.rst:509 msgid "" @@ -698,9 +716,10 @@ msgid "" "``Status:`` header to send an HTTP status, you probably want to subclass " "this instead of :class:`SimpleHandler`." msgstr "" -"這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用的 :class:`SimpleHandler` 的子類別。" -"如果你正在撰寫一個使用``Status:``標頭來發送 HTTP 狀態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可" -"能會想要子類化這個類別來替代 :class:`SimpleHandler`。" +"這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用的 :class:" +"`SimpleHandler` 的子類別。如果你正在撰寫一個使用``Status:``標頭來發送 HTTP 狀" +"態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類化這個類別來" +"替代 :class:`SimpleHandler`。" #: ../../library/wsgiref.rst:518 msgid "" @@ -708,8 +727,9 @@ msgid "" "servers. If you are writing an HTTP server implementation, you will " "probably want to subclass this instead of :class:`BaseCGIHandler`." msgstr "" -"類似於 :class:`BaseCGIHandler`,但是被設計使用在 HTTP origin 伺服器。如果你正在撰寫 HTTP 伺服器的實作," -"你可能會想要子類化這個類別來替代 :class:`BaseCGIHandler`。" +"類似於 :class:`BaseCGIHandler`,但是被設計使用在 HTTP origin 伺服器。如果你正" +"在撰寫 HTTP 伺服器的實作,你可能會想要子類化這個類別來替代 :class:" +"`BaseCGIHandler`。" #: ../../library/wsgiref.rst:522 msgid "" @@ -720,17 +740,19 @@ msgid "" "streams are stored in the :attr:`stdin`, :attr:`stdout`, :attr:`stderr`, " "and :attr:`environ` attributes." msgstr "" -"這個類別是 :class:`BaseHandler` 的子類別。它透過建構器去覆寫 :meth:`__init__`、:meth:`get_stdin`" -"、:meth:`get_stderr`、:meth:`add_cgi_vars`、:meth:`_write`、和 :meth:`_flush` 方法來明確提供設置" -"環境與流。提供的環境與流被儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` " -"環境中。" +"這個類別是 :class:`BaseHandler` 的子類別。它透過建構器去覆寫 :meth:" +"`__init__`、:meth:`get_stdin`、:meth:`get_stderr`、:meth:`add_cgi_vars`、:" +"meth:`_write`、和 :meth:`_flush` 方法來明確提供設置環境與流。提供的環境與流被" +"儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` 環境" +"中。" #: ../../library/wsgiref.rst:529 msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." -msgstr "*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊,像是" -" :class:`io.BufferedIOBase`。" +msgstr "" +"*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊,像是 :" +"class:`io.BufferedIOBase`。" #: ../../library/wsgiref.rst:535 msgid "" @@ -738,8 +760,8 @@ msgid "" "will handle a single HTTP request, although in principle you could create a " "subclass that was reusable for multiple requests." msgstr "" -"這是一個運行 WSGI 應用程式的抽象基礎類別。每個實例將處理單個 HTTP 請求,儘管原則上你可以建立" -"一個可重用於多個請求的子類別。" +"這是一個運行 WSGI 應用程式的抽象基礎類別。每個實例將處理單個 HTTP 請求,儘管" +"原則上你可以建立一個可重用於多個請求的子類別。" #: ../../library/wsgiref.rst:539 msgid "" @@ -757,8 +779,8 @@ msgid "" "the process of running the application, and thus exist primarily to allow " "customizing the process." msgstr "" -"此方法在運行應用程式的過程中調用了所有其他 :class:`BaseHandler` 的方法,因此這些方法主要存在" -"是為了允許自定義整個過程。" +"此方法在運行應用程式的過程中調用了所有其他 :class:`BaseHandler` 的方法,因此" +"這些方法主要存在是為了允許自定義整個過程。" #: ../../library/wsgiref.rst:550 msgid "The following methods MUST be overridden in a subclass:" @@ -771,29 +793,35 @@ msgid "" "write and flush operations for greater efficiency when the underlying system " "actually has such a distinction." msgstr "" -"緩衝要傳送給客戶端的位元組 *data*。如果這個方法實際上傳送了數據也是可以的;當底層系統實際具有這種區分時," -":class:`BaseHandler` 為了更好的效能進而分離寫入和刷新操作。" +"緩衝要傳送給客戶端的位元組 *data*。如果這個方法實際上傳送了數據也是可以的;當" +"底層系統實際具有這種區分時,:class:`BaseHandler` 為了更好的效能進而分離寫入和" +"刷新操作。" #: ../../library/wsgiref.rst:563 msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." msgstr "" -"強制將緩衝數據傳送到客戶端。如果這是一個無操作的方法(即,如果 :meth:`_write` 實際上發送了數據),那麼是可以的。" +"強制將緩衝數據傳送到客戶端。如果這是一個無操作的方法(即,如果 :meth:" +"`_write` 實際上發送了數據),那麼是可以的。" #: ../../library/wsgiref.rst:569 msgid "" "Return an object compatible with :class:`~wsgiref.types.InputStream` " "suitable for use as the ``wsgi.input`` of the request currently being " "processed." -msgstr "回傳一個與 :class:`~wsgiref.types.InputStream` 相容的物件並適用於用作當前正在處理請求的 ``wsgi.input``。" +msgstr "" +"回傳一個與 :class:`~wsgiref.types.InputStream` 相容的物件並適用於用作當前正在" +"處理請求的 ``wsgi.input``。" #: ../../library/wsgiref.rst:576 msgid "" "Return an object compatible with :class:`~wsgiref.types.ErrorStream` " "suitable for use as the ``wsgi.errors`` of the request currently being " "processed." -msgstr "回傳一個與 :class:`~wsgiref.types.ErrorStream` 相容的物件並適用於用作當前正在處理請求的 ``wsgi.errors``。" +msgstr "" +"回傳一個與 :class:`~wsgiref.types.ErrorStream` 相容的物件並適用於用作當前正在" +"處理請求的 ``wsgi.errors``。" #: ../../library/wsgiref.rst:583 msgid "" @@ -809,8 +837,9 @@ msgid "" "additional information before attempting to create a customized :class:" "`BaseHandler` subclass." msgstr "" -"以下是你可能希望覆寫的其他方法和屬性。這個列表只是一個摘要,然而,不包括可以被覆寫的每個方法。" -"在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,您應該參考文件說明和原始碼以獲得更多資訊。" +"以下是你可能希望覆寫的其他方法和屬性。這個列表只是一個摘要,然而,不包括可以" +"被覆寫的每個方法。在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,您應該" +"參考文件說明和原始碼以獲得更多資訊。" #: ../../library/wsgiref.rst:591 msgid "Attributes and methods for customizing the WSGI environment:" @@ -822,8 +851,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" -"用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 true,但在其他子" -"類別中可能有不同的默認值(或由建構器設置)。" +"用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " +"true,但在其他子類別中可能有不同的默認值(或由建構器設置)。" #: ../../library/wsgiref.rst:603 msgid "" @@ -831,8 +860,8 @@ msgid "" "defaults to true in :class:`BaseHandler`, but may have a different default " "(or be set by the constructor) in the other subclasses." msgstr "" -"用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 true,但在其他子" -"類別中可能有不同的默認值(或由建構器設置)。" +"用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " +"true,但在其他子類別中可能有不同的默認值(或由建構器設置)。" #: ../../library/wsgiref.rst:610 msgid "" @@ -840,8 +869,8 @@ msgid "" "defaults to false in :class:`BaseHandler`, but :class:`CGIHandler` sets it " "to true by default." msgstr "" -"用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false,但 :class:`CGIHandler`" -"默認將其設置為 true。" +"用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false," +"但 :class:`CGIHandler`默認將其設置為 true。" #: ../../library/wsgiref.rst:617 msgid "" @@ -852,8 +881,9 @@ msgid "" "considered read-only, since the default value is shared between multiple " "classes and instances." msgstr "" -"默認環境變數包含在每一個請求的 WSGI 環境中。默認情況下,這是在載入 :mod:`wsgiref.handlers` 時的 `os.environ`" -" 副本,但子類別可以在類別或實例層級建立自己的副本。注意字典應該被視為只讀,因為默認值在多個類別與實例中共享。" +"默認環境變數包含在每一個請求的 WSGI 環境中。默認情況下,這是在載入 :mod:" +"`wsgiref.handlers` 時的 `os.environ` 副本,但子類別可以在類別或實例層級建立自" +"己的副本。注意字典應該被視為只讀,因為默認值在多個類別與實例中共享。" #: ../../library/wsgiref.rst:627 msgid "" @@ -863,15 +893,17 @@ msgid "" "for handlers (such as :class:`BaseCGIHandler` and :class:`CGIHandler`) that " "are not HTTP origin servers." msgstr "" -"如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置默認的 ``SERVER_SOFTWARE`` WSGI 環境變數,並且還將" -"用於設置 HTTP 回應中的默認 ``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置器(例如 :class:`BaseCGIHandler`" -" 和 :class:`CGIHandler`),此屬性將被忽略。" +"如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置默認的 " +"``SERVER_SOFTWARE`` WSGI 環境變數,並且還將用於設置 HTTP 回應中的默認 " +"``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置器(例如 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler`),此屬性將被忽略。" #: ../../library/wsgiref.rst:633 msgid "" "The term \"Python\" is replaced with implementation specific term like " "\"CPython\", \"Jython\" etc." -msgstr "將術語 \"Python\" 替換為特定實作的術語,如 \"CPython\"、\"Jython\" 等。" +msgstr "" +"將術語 \"Python\" 替換為特定實作的術語,如 \"CPython\"、\"Jython\" 等。" #: ../../library/wsgiref.rst:639 msgid "" @@ -880,8 +912,9 @@ msgid "" "util` to guess whether the scheme should be \"http\" or \"https\", based on " "the current request's :attr:`environ` variables." msgstr "" -"回傳用於當前請求的 URL scheme。默認的實作使用 :mod:`wsgiref.util` 中的 :func:`guess_scheme`函式" -"去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :attr:`environ` 變數。" +"回傳用於當前請求的 URL scheme。默認的實作使用 :mod:`wsgiref.util` 中的 :func:" +"`guess_scheme`函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" +"attr:`environ` 變數。" #: ../../library/wsgiref.rst:647 msgid "" @@ -892,10 +925,11 @@ msgid "" "``SERVER_SOFTWARE`` key if not present, as long as the :attr:`origin_server` " "attribute is a true value and the :attr:`server_software` attribute is set." msgstr "" -"將 :attr:`environ` 屬性設置為完全填充的 WSGI 環境。默認的實作使用上述所有方法和屬性,以及" -" :meth:`get_stdin`、:meth:`get_stderr` 和 :meth:`add_cgi_vars` 方法以及 :attr:`" -"wsgi_file_wrapper` 屬性。如果不呈現它也會插入一個 ``SERVER_SOFTWARE`` 關鍵字,只要 :attr:" -"`origin_server` 屬性是一個 true 值並且 :attr:`server_software` 屬性被設置。" +"將 :attr:`environ` 屬性設置為完全填充的 WSGI 環境。默認的實作使用上述所有方法" +"和屬性,以及 :meth:`get_stdin`、:meth:`get_stderr` 和 :meth:`add_cgi_vars` 方" +"法以及 :attr:`wsgi_file_wrapper` 屬性。如果不呈現它也會插入一個 " +"``SERVER_SOFTWARE`` 關鍵字,只要 :attr:`origin_server` 屬性是一個 true 值並" +"且 :attr:`server_software` 屬性被設置。" #: ../../library/wsgiref.rst:654 msgid "Methods and attributes for customizing exception handling:" @@ -910,21 +944,26 @@ msgid "" "traceback to an administrator, or whatever other action may be deemed " "suitable." msgstr "" -"將 *exc_info* 元組記錄到伺服器日誌中。*exc_info* 是一個 ``(type, value, traceback)`` 元組。" -"默認實作只是將追蹤資訊寫入到請求的 ``wsgi.errors`` 流中並刷新它。子類別可以覆蓋此方法以更改格式或重新定" -"向輸出,將追蹤資訊發送給管理員,或執行其他被認為合適的操作。" +"將 *exc_info* 元組記錄到伺服器日誌中。*exc_info* 是一個 ``(type, value, " +"traceback)`` 元組。默認實作只是將追蹤資訊寫入到請求的 ``wsgi.errors`` 流中並" +"刷新它。子類別可以覆蓋此方法以更改格式或重新定向輸出,將追蹤資訊發送給管理" +"員,或執行其他被認為合適的操作。" #: ../../library/wsgiref.rst:668 msgid "" "The maximum number of frames to include in tracebacks output by the default :" "meth:`log_exception` method. If ``None``, all frames are included." -msgstr "默認的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``,則包含所有幀。" +msgstr "" +"默認的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``," +"則包含所有幀。" #: ../../library/wsgiref.rst:674 msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." -msgstr "這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給客戶端前如果發生錯誤才會被調用。" +msgstr "" +"這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給客戶端" +"前如果發生錯誤才會被調用。" #: ../../library/wsgiref.rst:677 msgid "" @@ -932,8 +971,8 @@ msgid "" "should pass that information to *start_response* when calling it (as " "described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" -"此方法使用 ``sys.exception()`` 訪問當前的錯誤,當呼叫它(如 :pep:`3333` 的 \"Error Handling\" 部分所描述)" -"時應該傳遞資訊給 *start_response*。" +"此方法使用 ``sys.exception()`` 訪問當前的錯誤,當呼叫它(如 :pep:`3333` 的 " +"\"Error Handling\" 部分所描述)時應該傳遞資訊給 *start_response*。" #: ../../library/wsgiref.rst:681 msgid "" @@ -941,8 +980,8 @@ msgid "" "`error_headers`, and :attr:`error_body` attributes to generate an output " "page. Subclasses can override this to produce more dynamic error output." msgstr "" -"默認的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:`error_body` 屬性產生輸出頁面。" -"子類別可以覆蓋此方法以生成更動態的錯誤輸出。" +"默認的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:" +"`error_body` 屬性產生輸出頁面。子類別可以覆蓋此方法以生成更動態的錯誤輸出。" #: ../../library/wsgiref.rst:685 msgid "" @@ -951,14 +990,16 @@ msgid "" "special to enable diagnostic output, which is why the default implementation " "doesn't include any." msgstr "" -"然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,您應該需要採取特殊措施才能啟用診斷輸出," -"這就是默認實作不包括任何診斷資訊的原因。" +"然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,您應該需" +"要採取特殊措施才能啟用診斷輸出,這就是默認實作不包括任何診斷資訊的原因。" #: ../../library/wsgiref.rst:693 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." -msgstr "用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;默認為 500 狀態碼和訊息。" +msgstr "" +"用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;默認" +"為 500 狀態碼和訊息。" #: ../../library/wsgiref.rst:699 msgid "" @@ -966,8 +1007,9 @@ msgid "" "response headers (``(name, value)`` tuples), as described in :pep:`3333`. " "The default list just sets the content type to ``text/plain``." msgstr "" -"用於錯誤回應的 HTTP 標頭。這應該是一個 WSGI 回應標頭的串列(``(name, value)`` 元組),如 :pep:`3333` 中所描述。" -"默認串列只設置內容種類為 ``text/plain``。" +"用於錯誤回應的 HTTP 標頭。這應該是一個 WSGI 回應標頭的串列(``(name, " +"value)`` 元組),如 :pep:`3333` 中所描述。默認串列只設置內容種類為 ``text/" +"plain``。" #: ../../library/wsgiref.rst:706 msgid "" @@ -975,14 +1017,16 @@ msgid "" "It defaults to the plain text, \"A server error occurred. Please contact " "the administrator.\"" msgstr "" -"錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。默認為純正文,\"伺服器發生錯誤。請聯繫管理員。\"" +"錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。默認為純正文,\"伺服" +"器發生錯誤。請聯繫管理員。\"" #: ../../library/wsgiref.rst:710 msgid "" "Methods and attributes for :pep:`3333`'s \"Optional Platform-Specific File " "Handling\" feature:" msgstr "" -"用於 :pep:`3333` 中的 \"Optional Platform-Specific File Handling\" 功能的方法和屬性:" +"用於 :pep:`3333` 中的 \"Optional Platform-Specific File Handling\" 功能的方法" +"和屬性:" #: ../../library/wsgiref.rst:716 msgid "" @@ -990,8 +1034,8 @@ msgid "" "FileWrapper`, or ``None``. The default value of this attribute is the :" "class:`wsgiref.util.FileWrapper` class." msgstr "" -"一個 ``wsgi.file_wrapper`` 工廠,與 :class:`wsgiref.types.FileWrapper` 兼容,或者為 ``None``。" -"這個屬性的默認值是 :class:`wsgiref.util.FileWrapper` 類別。" +"一個 ``wsgi.file_wrapper`` 工廠,與 :class:`wsgiref.types.FileWrapper` 兼容," +"或者為 ``None``。這個屬性的默認值是 :class:`wsgiref.util.FileWrapper` 類別。" #: ../../library/wsgiref.rst:723 msgid "" @@ -1002,8 +1046,10 @@ msgid "" "default transmission code will not be executed. The default implementation " "of this method just returns a false value." msgstr "" -"覆蓋以實作特定平台的檔案傳輸。只有當應用程序的回傳值是由 :attr:`wsgi_file_wrapper` 屬性指定的類別實例時才會調用此方法。" -"如果它能夠成功傳輸檔案應該回傳一個 true 值,以便不執行默認的傳輸程式碼。該方法的默認實作只回傳一個 false 值。" +"覆蓋以實作特定平台的檔案傳輸。只有當應用程序的回傳值是由 :attr:" +"`wsgi_file_wrapper` 屬性指定的類別實例時才會調用此方法。如果它能夠成功傳輸檔" +"案應該回傳一個 true 值,以便不執行默認的傳輸程式碼。該方法的默認實作只回傳一" +"個 false 值。" #: ../../library/wsgiref.rst:730 msgid "Miscellaneous methods and attributes:" @@ -1016,23 +1062,25 @@ msgid "" "rather than via a CGI-like gateway protocol that wants the HTTP status in a " "special ``Status:`` header." msgstr "" -"這個屬性應該被設置為 true 值,如果處置器的 :meth:`_write` 和 :meth:`_flush` 被用於直接與客戶端通訊,而不是透過" -"CGI-like 的閘道協議希望 HTTP 狀態在特殊的 ``Status:`` 標頭中。" +"這個屬性應該被設置為 true 值,如果處置器的 :meth:`_write` 和 :meth:`_flush` " +"被用於直接與客戶端通訊,而不是透過CGI-like 的閘道協議希望 HTTP 狀態在特殊的 " +"``Status:`` 標頭中。" #: ../../library/wsgiref.rst:740 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" -"這個屬性在 :class:`BaseCGIHandler` 默認值為 true,但是在 :class:`BaseCGIHandler` 和 :class:`CGIHandler`" -"為 false。" +"這個屬性在 :class:`BaseCGIHandler` 默認值為 true,但是在 :class:" +"`BaseCGIHandler` 和 :class:`CGIHandler`為 false。" #: ../../library/wsgiref.rst:746 msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." msgstr "" -"如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給客戶端的回應的 HTTP 版本。預設為 ``\"1.0\"``。" +"如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給客戶端的回應的 " +"HTTP 版本。預設為 ``\"1.0\"``。" #: ../../library/wsgiref.rst:752 msgid "" @@ -1045,11 +1093,12 @@ msgid "" "bytes, but the system encoding used by Python to decode it is anything other " "than ISO-8859-1 (e.g. Unix systems using UTF-8)." msgstr "" -"從 ``os.environ`` 轉碼 CGI 變數到 :pep:`3333` 中的 \"bytes in unicode\" 字串,並回傳一個新字典。" -"這個函式被 :class:`CGIHandler` 和 :class:`IISCGIHandler` 使用來直接替代 ``os.environ``,在所有平台" -"和使用 Python 3 的網頁伺服器上不一定符合 WSGI 標準,具體來說,在 OS 的實際環境是 Unicode(例如 Windows)" -"的情況下,或者在環境是位元組的情況下,但 Python 用於解碼它的系統編碼不是 ISO-8859-1 (例如使用 UTF-8 的 Unix" -" 系統)。" +"從 ``os.environ`` 轉碼 CGI 變數到 :pep:`3333` 中的 \"bytes in unicode\" 字" +"串,並回傳一個新字典。這個函式被 :class:`CGIHandler` 和 :class:" +"`IISCGIHandler` 使用來直接替代 ``os.environ``,在所有平台和使用 Python 3 的網" +"頁伺服器上不一定符合 WSGI 標準,具體來說,在 OS 的實際環境是 Unicode(例如 " +"Windows)的情況下,或者在環境是位元組的情況下,但 Python 用於解碼它的系統編碼" +"不是 ISO-8859-1 (例如使用 UTF-8 的 Unix 系統)。" #: ../../library/wsgiref.rst:761 msgid "" @@ -1057,7 +1106,8 @@ msgid "" "to use this routine instead of just copying values out of ``os.environ`` " "directly." msgstr "" -"如果你自己正在實作 CGI-based 處置器,你可能想要使用這個函式來替換單純直接從 ``os.environ`` 中複製值。" +"如果你自己正在實作 CGI-based 處置器,你可能想要使用這個函式來替換單純直接從 " +"``os.environ`` 中複製值。" #: ../../library/wsgiref.rst:769 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" @@ -1067,15 +1117,15 @@ msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 種類。" msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." -msgstr "" -"這個模組提供在 :pep:`3333` 中所描述的各種用於靜態類型檢查的種類。" +msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態類型檢查的種類。" #: ../../library/wsgiref.rst:783 msgid "" "A :class:`typing.Protocol` describing `start_response() `_ callables (:pep:`3333`)." -msgstr "一個描述 `start_response() `_ " -"可呼叫物件的 :class:`typing.Protocol`(:pep:`3333`)。" +msgstr "" +"一個描述 `start_response() `_ 可呼叫物件的 :class:`typing.Protocol`(:pep:`3333`)。" #: ../../library/wsgiref.rst:789 msgid "A type alias describing a WSGI environment dictionary." @@ -1090,16 +1140,16 @@ msgid "" "A :class:`typing.Protocol` describing a `WSGI Input Stream `_." msgstr "" -"一個描述 `WSGI Input Stream `_ " -"的 :class:`typing.Protocol`。" +"一個描述 `WSGI Input Stream `_ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:802 msgid "" "A :class:`typing.Protocol` describing a `WSGI Error Stream `_." msgstr "" -"一個描述 `WSGI Error Stream `_ " -"的 :class:`typing.Protocol`。" +"一個描述 `WSGI Error Stream `_ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:807 msgid "" @@ -1107,8 +1157,9 @@ msgid "" "org/pep-3333/#optional-platform-specific-file-handling>`_. See :class:" "`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." msgstr "" -"一個描述 `file wrapper `_ 的" -" :class:`typing.Protocol`。請參閱 :class:`wsgiref.util.FileWrapper` 來瞭解此協議的具體實作。" +"一個描述 `file wrapper `_ 的 :class:`typing.Protocol`。請參閱 :class:" +"`wsgiref.util.FileWrapper` 來瞭解此協議的具體實作。" #: ../../library/wsgiref.rst:814 msgid "Examples" @@ -1116,15 +1167,12 @@ msgstr "範例" #: ../../library/wsgiref.rst:816 msgid "This is a working \"Hello World\" WSGI application::" -msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式" - -"::" +msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式::" #: ../../library/wsgiref.rst:845 msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" msgstr "" -"WSGI 應用程式的範例服務的當前目錄,並接受命令行上的可選目錄和埠號(預設:8000)" - -"::" +"WSGI 應用程式的範例服務的當前目錄,並接受命令行上的可選目錄和埠號(預設:" +"8000)::" From b8b22443933bee72238b844f60eca196681ab23e Mon Sep 17 00:00:00 2001 From: Neo Date: Tue, 5 Sep 2023 20:17:19 +0800 Subject: [PATCH 3/6] docs(wsgiref): modified format issue at rst:250, rst:260, rst:816, rst:845 --- library/wsgiref.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index 8712181214..a7245a3878 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -380,11 +380,11 @@ msgstr "" "數必須是字串或是 ``None``。由於破折號在 Python 識別符中是非法的,但是許多 " "MIME 參數名稱包含破折號,因此參數名稱的底線會轉換成破折號。如果參數值是字串," "則以 ``name=\"value\"`` 的形式添加到標頭值參數中。如果它是 ``None``,則僅添加" -"參數名稱。(這使用於沒有值的 MIME 參數)使用範例:::" +"參數名稱。(這使用於沒有值的 MIME 參數)使用範例: ::" #: ../../library/wsgiref.rst:260 msgid "The above will add a header that looks like this::" -msgstr "上述操作將添加看起來像這樣的標頭:::" +msgstr "上述操作將添加看起來像這樣的標頭: ::" #: ../../library/wsgiref.rst:265 msgid "*headers* parameter is optional." @@ -461,7 +461,7 @@ msgid "" msgstr "" ":class:`WSGIServer` 是 :class:`http.server.HTTPServer` 的子類別,因此它的所有" "方法(例如 :meth:`serve_forever` 和 :meth:`handle_request`)都可用。:class:" -"`WSGIServer`也提供這些特定於 WSGI 的方法:" +"`WSGIServer` 也提供這些特定於 WSGI 的方法:" #: ../../library/wsgiref.rst:332 msgid "" @@ -1167,7 +1167,7 @@ msgstr "範例" #: ../../library/wsgiref.rst:816 msgid "This is a working \"Hello World\" WSGI application::" -msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式::" +msgstr "這個一個運作中的 \"Hello World\" WSGI 應用程式: ::" #: ../../library/wsgiref.rst:845 msgid "" @@ -1175,4 +1175,4 @@ msgid "" "directory and port number (default: 8000) on the command line::" msgstr "" "WSGI 應用程式的範例服務的當前目錄,並接受命令行上的可選目錄和埠號(預設:" -"8000)::" +"8000): ::" From add9102b3aa6a6c92258e0b64d97fb7179e90528 Mon Sep 17 00:00:00 2001 From: neochang Date: Fri, 15 Sep 2023 20:31:59 +0800 Subject: [PATCH 4/6] docs(wsgiref): modified sphinx rst syntax issue --- library/wsgiref.po | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index a7245a3878..da991cfb90 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -240,8 +240,8 @@ msgid "" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" ":class:`wsgiref.types.FileWrapper` 協議的具體實作 用於將類似檔案的物件轉換" -"為 :term:`iterator`。產生的物件是 :term:`iterables`。當物件進行疊代時,將重複" -"並可選的 *blksize* 引數傳遞給 *filelike* 物件的:meth:`read` 方法去獲得與產生" +"為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將重複" +"並可選的 *blksize* 引數傳遞給 *filelike* 物件的 :meth:`read` 方法去獲得與產生" "位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" #: ../../library/wsgiref.rst:166 @@ -408,7 +408,7 @@ msgstr "" "應用程式。每個伺服器執行個體在特定的主機與埠提供單一的 WSGI 應用程式。如果你" "想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI應用程式以解析 " "``PATH_INFO`` 去選擇為每個請求調用哪個應用程式。(例如,使用來自 :mod:" -"`wsgiref.util` 的:func:`shift_path_info` 函式。)" +"`wsgiref.util` 的 :func:`shift_path_info` 函式。)" #: ../../library/wsgiref.rst:287 msgid "" @@ -489,7 +489,7 @@ msgid "" "`WSGIServer` instance)." msgstr "" "為給定的 *request*(即一個 socket)、*client_address*(一個 ``(host,port)`` " -"位元組)、*server*(:class:`WSGIServer` 實例)建立一個 HTTP 處置器。" +"位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處置器。" #: ../../library/wsgiref.rst:350 msgid "" @@ -499,7 +499,7 @@ msgid "" "`make_server` function. Some possibly relevant methods for overriding in " "subclasses:" msgstr "" -"你不需要直接建立這個類的實例;它們會在需要時由 :class:WSGIServer 物件自動建" +"你不需要直接建立這個類的實例;它們會在需要時由 :class:`WSGIServer` 物件自動建" "立。不過,你可以建立這個類的子類並將其作為 *handler_class* 提供給 :func:" "`make_server` 函式。一些可能相關的方法可以在子類中進行覆寫:" @@ -547,7 +547,7 @@ msgid "" "conformance." msgstr "" "當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體時,使用 :mod:" -"`wsgiref.validate`來驗證新程式碼的符合性可能會很有用。這個模組提供一個函式用" +"`wsgiref.validate` 來驗證新程式碼的符合性可能會很有用。這個模組提供一個函式用" "於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用程式物件" "之間的通訊,以檢查雙方協議的符合性。" @@ -592,11 +592,11 @@ msgid "" "occurred, and dump the traceback to ``sys.stderr`` or some other error " "stream." msgstr "" -"任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;請注意,但是,任何" -"檢測到的不符合都將引發 :exc:`AssertionError`;但請注意,如何處理這些錯誤取決" -"於伺服器。例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref.simple_server` " -"以及其他伺服器(未覆蓋錯誤處理方法以執行其他操作的伺服器)將僅輸出一條錯誤訊" -"息,指示發生錯誤,並將回溯信息輸出到 ``sys.stderr`` 或是其他錯誤流。" +"任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;但請注意,如何處理" +"這些錯誤取決於伺服器。例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref." +"simple_server` 以及其他伺服器(未覆蓋錯誤處理方法以執行其他操作的伺服器)將僅" +"輸出一條錯誤訊息,指示發生錯誤,並將回溯信息輸出到 ``sys.stderr`` 或是其他錯" +"誤流。" #: ../../library/wsgiref.rst:418 msgid "" @@ -717,9 +717,9 @@ msgid "" "this instead of :class:`SimpleHandler`." msgstr "" "這個類別是專門為除了 HTTP \"origin servers\" 以外的軟體一起使用的 :class:" -"`SimpleHandler` 的子類別。如果你正在撰寫一個使用``Status:``標頭來發送 HTTP 狀" -"態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類化這個類別來" -"替代 :class:`SimpleHandler`。" +"`SimpleHandler` 的子類別。如果你正在撰寫一個使用 ``Status:`` 標頭來發送 HTTP " +"狀態的閘道協議實作(例如 CGI、FastCGI、SCGI 等),你可能會想要子類化這個類別" +"來替代 :class:`SimpleHandler`。" #: ../../library/wsgiref.rst:518 msgid "" @@ -870,7 +870,7 @@ msgid "" "to true by default." msgstr "" "用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false," -"但 :class:`CGIHandler`默認將其設置為 true。" +"但 :class:`CGIHandler` 默認將其設置為 true。" #: ../../library/wsgiref.rst:617 msgid "" @@ -913,7 +913,7 @@ msgid "" "the current request's :attr:`environ` variables." msgstr "" "回傳用於當前請求的 URL scheme。默認的實作使用 :mod:`wsgiref.util` 中的 :func:" -"`guess_scheme`函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" +"`guess_scheme` 函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" "attr:`environ` 變數。" #: ../../library/wsgiref.rst:647 @@ -1072,7 +1072,7 @@ msgid "" "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" "這個屬性在 :class:`BaseCGIHandler` 默認值為 true,但是在 :class:" -"`BaseCGIHandler` 和 :class:`CGIHandler`為 false。" +"`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" #: ../../library/wsgiref.rst:746 msgid "" From c871986bf8adb730f876b95496fd72361269bd2a Mon Sep 17 00:00:00 2001 From: neochang Date: Wed, 1 Nov 2023 20:28:15 +0800 Subject: [PATCH 5/6] docs(wsgiref): modified simplified chinese word to traditional chinese word and correcting rst syntax issue --- library/wsgiref.po | 196 +++++++++++++++++++++++---------------------- 1 file changed, 100 insertions(+), 96 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index da991cfb90..931299f34e 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -84,7 +84,7 @@ msgid "" "please see :pep:`3333` for a detailed specification and :data:`~wsgiref." "types.WSGIEnvironment` for a type alias that can be used in type annotations." msgstr "" -"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGU 環境是一個包含 HTTP 請求變" +"這個模組提供許多用於處理 WSGI 環境運作的功能。WSGI 環境是一個包含 HTTP 請求變" "數的字典,如 :pep:`3333` 所述。所有接受 *environ* 的參數的函式都需要提供符合 " "WSGI 標準的字典;請參閱 :pep:`3333` 獲取詳細規格,以及 :data:`~wsgiref.types." "WSGIEnvironment` 獲取可用於使用型別註釋的型別別名。" @@ -161,7 +161,7 @@ msgid "" "and ``PATH_INFO`` will change from ``/bar/baz`` to ``/baz``." msgstr "" "通常,此程式用於處理請求 URI 的每一部分路徑,例如將路徑視為一系列的字典鍵此程" -"式會修改傳入的環境,使其適用於調用位於目標 URI 的 WSGI 應用程式。例如,如果" +"式會修改傳入的環境,使其適用於呼叫位於目標 URI 的 WSGI 應用程式。例如,如果" "在 ``/foo`` 上有一個 WSGI 應用程式且請求 URI 路徑為 ``/foo/bar/baz``,並且位" "於 ``/foo`` 的 WSGI 應用程式呼叫 :func:`shift_path_info`,它將接收字串 " "\"bar\",而環境將被更新為適用於傳遞給位於 ``/foo/bar`` 的 WSGI 應用程式。換句" @@ -220,7 +220,7 @@ msgstr "" msgid "" "In addition to the environment functions above, the :mod:`wsgiref.util` " "module also provides these miscellaneous utilities:" -msgstr "除了上述的環境功能外, :mod:`wsgiref.util` 模組還提供以下各類工具:" +msgstr "除了上述的環境功能外,:mod:`wsgiref.util` 模組還提供以下各類工具:" #: ../../library/wsgiref.rst:152 msgid "" @@ -239,7 +239,7 @@ msgid "" "object's :meth:`read` method to obtain bytestrings to yield. When :meth:" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" -":class:`wsgiref.types.FileWrapper` 協議的具體實作 用於將類似檔案的物件轉換" +":class:`wsgiref.types.FileWrapper` 協議的具體實作,用於將類檔案物件轉換" "為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將重複" "並可選的 *blksize* 引數傳遞給 *filelike* 物件的 :meth:`read` 方法去獲得與產生" "位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" @@ -251,7 +251,7 @@ msgid "" "`close` method when called." msgstr "" "如果 *filelike* 有 :meth:`close` 方法,則回傳的物件也會具有 :meth:`close` 方" -"法,並在調用時呼叫 *filelike* 物件的 :meth:`close` 方法。" +"法,並在呼叫時呼叫 *filelike* 物件的 :meth:`close` 方法。" #: ../../library/wsgiref.rst:182 msgid "Support for :meth:`__getitem__` method has been removed." @@ -266,8 +266,8 @@ msgid "" "This module provides a single class, :class:`Headers`, for convenient " "manipulation of WSGI response headers using a mapping-like interface." msgstr "" -"這個模組提供單一類別,:class:`Headers`,用於使用類似映射的介面方便地操作 " -"WSGI 回應標頭。" +"這個模組提供單一類別 :class:`Headers`,用於使用類似對映的介面方便地操作 WSGI " +"回應標頭。" #: ../../library/wsgiref.rst:199 msgid "" @@ -275,8 +275,8 @@ msgid "" "header name/value tuples as described in :pep:`3333`. The default value of " "*headers* is an empty list." msgstr "" -"建立一個類似映射物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/" -"value 元組的標頭串列。*headers* 的默認值是一個空串列。" +"建立一個類似對映物件並包裝 *headers*,並且必須是符合 :pep:`3333` 描述的 name/" +"value 元組的標頭串列。*headers* 的預設值是一個空串列。" #: ../../library/wsgiref.rst:203 msgid "" @@ -289,7 +289,7 @@ msgid "" "the end of the wrapped header list. Headers' existing order is generally " "maintained, with new headers added to the end of the wrapped list." msgstr "" -":class:`Headers` 物件支援典型映射操作包括 :meth:`__getitem__`、:meth:`get`、:" +":class:`Headers` 物件支援典型對映操作包括 :meth:`__getitem__`、:meth:`get`、:" "meth:`__setitem__`、:meth:`setdefault`、:meth:`__delitem__` 以及 :meth:" "`__contains__`。對於這些方法中的每一個,鍵是標頭名稱(以不區分大小寫方式處" "理),而值則是與該標頭名稱關聯的第一個值。設定標頭會刪除該標頭的所有現有值," @@ -330,7 +330,7 @@ msgid "" "line is terminated by a carriage return and line feed, and the bytestring is " "terminated with a blank line." msgstr "" -"對 :class:`Header` 物件調用 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" +"對 :class:`Header` 物件呼叫 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" "式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" "車和換行結束,而該位元組字串則以空行結束。" @@ -340,7 +340,7 @@ msgid "" "`Headers` objects also have the following methods for querying and adding " "multi-valued headers, and for adding headers with MIME parameters:" msgstr "" -"除了映射介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭" +"除了對映介面和格式化功能外,:class:`Headers` 物件還具有以下查詢及附加多值標頭" "的以及附加 MIME 參數標頭的方法:" #: ../../library/wsgiref.rst:237 @@ -406,8 +406,8 @@ msgid "" msgstr "" "這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI " "應用程式。每個伺服器執行個體在特定的主機與埠提供單一的 WSGI 應用程式。如果你" -"想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI應用程式以解析 " -"``PATH_INFO`` 去選擇為每個請求調用哪個應用程式。(例如,使用來自 :mod:" +"想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI應用程式以剖析 " +"``PATH_INFO`` 去選擇為每個請求呼叫哪個應用程式。(例如,使用來自 :mod:" "`wsgiref.util` 的 :func:`shift_path_info` 函式。)" #: ../../library/wsgiref.rst:287 @@ -480,7 +480,8 @@ msgid "" "exists mainly for the benefit of request handler instances." msgstr "" "然而,通常情況下你不需要去使用這些額外方法,因為 :meth:`set_app` 通常會被 :" -"func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處置器實例的好處上。" +"func:`make_server` 呼叫而 :meth:`get_app` 主要存在於請求處理程式(handler)實" +"例的好處上。" #: ../../library/wsgiref.rst:347 msgid "" @@ -489,7 +490,8 @@ msgid "" "`WSGIServer` instance)." msgstr "" "為給定的 *request*(即一個 socket)、*client_address*(一個 ``(host,port)`` " -"位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處置器。" +"位元組)、*server* (:class:`WSGIServer` 實例) 建立一個 HTTP 處理程式" +"(handler)。" #: ../../library/wsgiref.rst:350 msgid "" @@ -500,8 +502,8 @@ msgid "" "subclasses:" msgstr "" "你不需要直接建立這個類的實例;它們會在需要時由 :class:`WSGIServer` 物件自動建" -"立。不過,你可以建立這個類的子類並將其作為 *handler_class* 提供給 :func:" -"`make_server` 函式。一些可能相關的方法可以在子類中進行覆寫:" +"立。不過,你可以建立這個類的子類別並將其作為 *handler_class* 提供給 :func:" +"`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" #: ../../library/wsgiref.rst:359 msgid "" @@ -512,7 +514,7 @@ msgid "" "return a new dictionary containing all of the relevant CGI environment " "variables as specified in :pep:`3333`." msgstr "" -"唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。默認的實作會" +"唯一個請求回傳一個 :data:`~wsgiref.types.WSGIEnvironment` 字典。預設的實作會" "複製 :class:`WSGIServer` 物件的 :attr:`base_environ` 字典屬性的內容以及添加" "從 HTTP 請求中衍生的各種標頭。每次呼叫這個方法都應該回傳一個包含所有如 :pep:" "`3333` 所指定的相關 CGI 環境變數的新字典。" @@ -522,7 +524,7 @@ msgid "" "Return the object that should be used as the ``wsgi.errors`` stream. The " "default implementation just returns ``sys.stderr``." msgstr "" -"回傳的物件應該被用作 ``wsgi.errors`` 流。默認實作只會回傳 ``sys.stderr``。" +"回傳的物件應該被用作 ``wsgi.errors`` 串流。預設實作只會回傳 ``sys.stderr``。" #: ../../library/wsgiref.rst:376 msgid "" @@ -530,12 +532,12 @@ msgid "" "instance using a :mod:`wsgiref.handlers` class to implement the actual WSGI " "application interface." msgstr "" -"處理 HTTP 請求。默認實作會使用 :mod:`wsgiref.handler` 類別來建立處置器實例來" -"實作實際 WSGI 應用程式介面。" +"處理 HTTP 請求。預設實作會使用 :mod:`wsgiref.handler` 類別來建立處置程式" +"(handler)實例來實作實際 WSGI 應用程式介面。" #: ../../library/wsgiref.rst:382 msgid ":mod:`wsgiref.validate` --- WSGI conformance checker" -msgstr ":mod:`wsgiref.validate` --- WSGI 符合姓檢查" +msgstr ":mod:`wsgiref.validate` --- WSGI 符合性檢查" #: ../../library/wsgiref.rst:388 msgid "" @@ -546,10 +548,10 @@ msgid "" "gateway and a WSGI application object, to check both sides for protocol " "conformance." msgstr "" -"當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體時,使用 :mod:" -"`wsgiref.validate` 來驗證新程式碼的符合性可能會很有用。這個模組提供一個函式用" -"於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用程式物件" -"之間的通訊,以檢查雙方協議的符合性。" +"當建立新的 WSGI 應用程式物件、框架、伺服器、或是中介軟體(middleware)時,使" +"用 :mod:`wsgiref.validate` 來驗證新程式碼的符合性可能會很有用。這個模組提供一" +"個函式用於建立 WSGI 應用程式物件,並用於驗證 WSGI 伺服器或是閘道與 WSGI 應用" +"程式物件之間的通訊,以檢查雙方協議的符合性。" #: ../../library/wsgiref.rst:395 msgid "" @@ -595,8 +597,8 @@ msgstr "" "任何在 :exc:`AssertionError` 中偵測不符合結果都會發起例外;但請注意,如何處理" "這些錯誤取決於伺服器。例如,基於 :mod:`wsgiref.handlers` 的 :mod:`wsgiref." "simple_server` 以及其他伺服器(未覆蓋錯誤處理方法以執行其他操作的伺服器)將僅" -"輸出一條錯誤訊息,指示發生錯誤,並將回溯信息輸出到 ``sys.stderr`` 或是其他錯" -"誤流。" +"輸出一條錯誤訊息,指示發生錯誤,並將回溯訊息輸出到 ``sys.stderr`` 或是其他錯" +"誤串流。" #: ../../library/wsgiref.rst:418 msgid "" @@ -608,7 +610,7 @@ msgid "" "object)." msgstr "" "這個包裝器也可以使用 :mod:`warnings` 模組生成輸出去指示一些可能有疑慮但實際上" -"可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令行選項或 :mod:" +"可能不會被 :pep:`3333` 禁止的行為。除非使用 Python 命令列選項或 :mod:" "`warnings` API,抑制了這些警告,否則這類警告將被寫入到 ``sys.stderr``(*not* " "``wsgi.errors``,除非它們碰巧是相同的物件)。" @@ -623,9 +625,9 @@ msgid "" "a WSGI application, as long as they are given a CGI-like environment, along " "with input, output, and error streams." msgstr "" -"這個模組提供實作 WSGI 伺服器和閘道的基礎處置器類別。這些基礎類別處置器大部分" -"與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及輸入、輸出和錯" -"誤流。" +"這個模組提供實作 WSGI 伺服器和閘道的基礎處理程式(handler)類別。這些基礎類別" +"處理程式大部分與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及" +"輸入、輸出和錯誤串流。" #: ../../library/wsgiref.rst:464 msgid "" @@ -634,9 +636,9 @@ msgid "" "run it as a CGI script. Simply invoke ``CGIHandler().run(app)``, where " "``app`` is the WSGI application object you wish to invoke." msgstr "" -"這是基於 CGI 的調用方式並透過 ``sys.stdin``、``sys.stdout``、``sys.stderr`` " -"和 ``os.environ``。當您擁有一個 WSGI 應用程式並希望將其作為 CGI 腳本運行時是" -"很有用的。只需呼叫 ``CGIHandler().run(app)``,其中 ``app`` 是你希望調用的 " +"這是基於 CGI 的呼叫方式並透過 ``sys.stdin``、``sys.stdout``、``sys.stderr`` " +"和 ``os.environ``。當你擁有一個 WSGI 應用程式並希望將其作為 CGI 腳本運行時是" +"很有用的。只需呼叫 ``CGIHandler().run(app)``,其中 ``app`` 是你希望呼叫的 " "WSGI 應用程式物件。" #: ../../library/wsgiref.rst:469 @@ -648,7 +650,7 @@ msgid "" msgstr "" "這個類別是 :class:`BaseCGIHandler` 的子類別將 ``wsgi.run_once`` 設置為 true," "``wsgi.multithread``設置為 false,並將 ``wsgi.multiprocess`` 設置為 true,並" -"且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需的 CGI 流以及環境。" +"且始終使用 :mod:`sys` 和 :mod:`os` 來獲取所需的 CGI 串流以及環境。" #: ../../library/wsgiref.rst:477 msgid "" @@ -667,7 +669,8 @@ msgid "" "routing. This handler strips any such duplicated path." msgstr "" "預設情況下,IIS 提供的 ``PATH_INFO`` 會在前面複製 ``SCRIPT_NAME``,對於希望實" -"現路由的 WSGI 應用程式造成問題。這個處置器會移除任何這樣的重複路徑。" +"現路由的 WSGI 應用程式造成問題。這個處理程式(handler)會移除任何這樣的重複路" +"徑。" #: ../../library/wsgiref.rst:485 msgid "" @@ -681,7 +684,7 @@ msgid "" msgstr "" "IIS 可以配置去傳遞正確的 ``PATH_INFO``,但這會導致 ``PATH_TRANSLATED`` 是錯誤" "的問題。幸運的是這個變數很少被使用並且不受 WSGI 保證。然而,在 IIS<7 上,這個" -"設置只能在虛擬主機層級進行,影響所有其他腳本的映射,其中許多在暴露 " +"設置只能在虛擬主機層級進行,影響所有其他腳本的對映,其中許多在暴露 " "``PATH_TRANSLATED`` 問題時會中斷。由於這個原因幾乎從不會使用修復的 IIS<7(即" "使是 IIS7 也很少使用它,因為它仍然沒有相應的 UI)。" @@ -692,9 +695,9 @@ msgid "" "`CGIHandler`, i.e., by calling ``IISCGIHandler().run(app)``, where ``app`` " "is the WSGI application object you wish to invoke." msgstr "" -"CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處置器類別。它的使用" -"方式與 :class:`CGIHandler` 相同,即,通過調用 ``IISCGIHandler().run(app)`` 來" -"使用,其中 ``app`` 是你希望調用的 WSGI 應用程式物件。" +"CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處理程式(handler)類" +"別。它的使用方式與 :class:`CGIHandler` 相同,即,通過呼叫 ``IISCGIHandler()." +"run(app)`` 來使用,其中 ``app`` 是你希望呼叫的 WSGI 應用程式物件。" #: ../../library/wsgiref.rst:503 msgid "" @@ -705,8 +708,8 @@ msgid "" "the handler instance." msgstr "" "類似於 :class:`CGIHandler`,但不是使用 :mod:`sys` 和 :mod:`os` 模組,而是明確" -"指定 CGI 環境與 I/O 流。*multithread* 和 *multiprocess* 值用於設置由處置器實" -"例運行的任何應用程式的旗標。" +"指定 CGI 環境與 I/O 串流。*multithread* 和 *multiprocess* 值用於設置由處理程" +"式(handler)實例運行的任何應用程式的旗標。" #: ../../library/wsgiref.rst:509 msgid "" @@ -742,9 +745,9 @@ msgid "" msgstr "" "這個類別是 :class:`BaseHandler` 的子類別。它透過建構器去覆寫 :meth:" "`__init__`、:meth:`get_stdin`、:meth:`get_stderr`、:meth:`add_cgi_vars`、:" -"meth:`_write`、和 :meth:`_flush` 方法來明確提供設置環境與流。提供的環境與流被" -"儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` 環境" -"中。" +"meth:`_write`、和 :meth:`_flush` 方法來明確提供設置環境與串流。提供的環境與串" +"流被儲存在 :attr:`stdin`、:attr:`stdout`、:attr:`stderr`、和 :attr:`environ` " +"環境中。" #: ../../library/wsgiref.rst:529 msgid "" @@ -779,7 +782,7 @@ msgid "" "the process of running the application, and thus exist primarily to allow " "customizing the process." msgstr "" -"此方法在運行應用程式的過程中調用了所有其他 :class:`BaseHandler` 的方法,因此" +"此方法在運行應用程式的過程中呼叫了所有其他 :class:`BaseHandler` 的方法,因此" "這些方法主要存在是為了允許自定義整個過程。" #: ../../library/wsgiref.rst:550 @@ -793,7 +796,7 @@ msgid "" "write and flush operations for greater efficiency when the underlying system " "actually has such a distinction." msgstr "" -"緩衝要傳送給客戶端的位元組 *data*。如果這個方法實際上傳送了數據也是可以的;當" +"緩衝要傳送給用戶端的位元組 *data*。如果這個方法實際上傳送了數據也是可以的;當" "底層系統實際具有這種區分時,:class:`BaseHandler` 為了更好的效能進而分離寫入和" "刷新操作。" @@ -802,8 +805,8 @@ msgid "" "Force buffered data to be transmitted to the client. It's okay if this " "method is a no-op (i.e., if :meth:`_write` actually sends the data)." msgstr "" -"強制將緩衝數據傳送到客戶端。如果這是一個無操作的方法(即,如果 :meth:" -"`_write` 實際上發送了數據),那麼是可以的。" +"強制將緩衝數據傳送到用戶端。如果這是一個無操作(no-op)的方法(即,如果 :" +"meth:`_write` 實際上發送了數據),那麼是可以的。" #: ../../library/wsgiref.rst:569 msgid "" @@ -838,7 +841,7 @@ msgid "" "`BaseHandler` subclass." msgstr "" "以下是你可能希望覆寫的其他方法和屬性。這個列表只是一個摘要,然而,不包括可以" -"被覆寫的每個方法。在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,您應該" +"被覆寫的每個方法。在嘗試建立自定義的 :class:`BaseHandler` 子類別之前,你應該" "參考文件說明和原始碼以獲得更多資訊。" #: ../../library/wsgiref.rst:591 @@ -852,7 +855,7 @@ msgid "" "(or be set by the constructor) in the other subclasses." msgstr "" "用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " -"true,但在其他子類別中可能有不同的默認值(或由建構器設置)。" +"true,但在其他子類別中可能有不同的預設值(或由建構器設置)。" #: ../../library/wsgiref.rst:603 msgid "" @@ -861,7 +864,7 @@ msgid "" "(or be set by the constructor) in the other subclasses." msgstr "" "用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " -"true,但在其他子類別中可能有不同的默認值(或由建構器設置)。" +"true,但在其他子類別中可能有不同的預設值(或由建構器設置)。" #: ../../library/wsgiref.rst:610 msgid "" @@ -870,7 +873,7 @@ msgid "" "to true by default." msgstr "" "用於 ``wsgi.run_once`` 環境變數的值。在 :class:`BaseHandler` 中預設為 false," -"但 :class:`CGIHandler` 默認將其設置為 true。" +"但 :class:`CGIHandler` 預設將其設置為 true。" #: ../../library/wsgiref.rst:617 msgid "" @@ -881,9 +884,9 @@ msgid "" "considered read-only, since the default value is shared between multiple " "classes and instances." msgstr "" -"默認環境變數包含在每一個請求的 WSGI 環境中。默認情況下,這是在載入 :mod:" +"預設環境變數包含在每一個請求的 WSGI 環境中。預設情況下,這是在載入 :mod:" "`wsgiref.handlers` 時的 `os.environ` 副本,但子類別可以在類別或實例層級建立自" -"己的副本。注意字典應該被視為只讀,因為默認值在多個類別與實例中共享。" +"己的副本。注意字典應該被視為只讀,因為預設值在多個類別與實例中共享。" #: ../../library/wsgiref.rst:627 msgid "" @@ -893,9 +896,9 @@ msgid "" "for handlers (such as :class:`BaseCGIHandler` and :class:`CGIHandler`) that " "are not HTTP origin servers." msgstr "" -"如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置默認的 " -"``SERVER_SOFTWARE`` WSGI 環境變數,並且還將用於設置 HTTP 回應中的默認 " -"``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置器(例如 :class:" +"如果設置 :attr:`origin_server` 屬性,則此屬性的值將用於設置預設的 " +"``SERVER_SOFTWARE`` WSGI 環境變數,並且還將用於設置 HTTP 回應中的預設 " +"``Server:`` 標頭。對於不是 HTTP origin 伺服器的處置程式(例如 :class:" "`BaseCGIHandler` 和 :class:`CGIHandler`),此屬性將被忽略。" #: ../../library/wsgiref.rst:633 @@ -912,7 +915,7 @@ msgid "" "util` to guess whether the scheme should be \"http\" or \"https\", based on " "the current request's :attr:`environ` variables." msgstr "" -"回傳用於當前請求的 URL scheme。默認的實作使用 :mod:`wsgiref.util` 中的 :func:" +"回傳用於當前請求的 URL scheme。預設的實作使用 :mod:`wsgiref.util` 中的 :func:" "`guess_scheme` 函式去猜測 scheme 是 \"http\" 或是 \"https\",基於目前請求的 :" "attr:`environ` 變數。" @@ -925,7 +928,7 @@ msgid "" "``SERVER_SOFTWARE`` key if not present, as long as the :attr:`origin_server` " "attribute is a true value and the :attr:`server_software` attribute is set." msgstr "" -"將 :attr:`environ` 屬性設置為完全填充的 WSGI 環境。默認的實作使用上述所有方法" +"將 :attr:`environ` 屬性設置為完全填充的 WSGI 環境。預設的實作使用上述所有方法" "和屬性,以及 :meth:`get_stdin`、:meth:`get_stderr` 和 :meth:`add_cgi_vars` 方" "法以及 :attr:`wsgi_file_wrapper` 屬性。如果不呈現它也會插入一個 " "``SERVER_SOFTWARE`` 關鍵字,只要 :attr:`origin_server` 屬性是一個 true 值並" @@ -945,8 +948,8 @@ msgid "" "suitable." msgstr "" "將 *exc_info* 元組記錄到伺服器日誌中。*exc_info* 是一個 ``(type, value, " -"traceback)`` 元組。默認實作只是將追蹤資訊寫入到請求的 ``wsgi.errors`` 流中並" -"刷新它。子類別可以覆蓋此方法以更改格式或重新定向輸出,將追蹤資訊發送給管理" +"traceback)`` 元組。預設實作只是將追蹤資訊寫入到請求的 ``wsgi.errors`` 串流中" +"並刷新它。子類別可以覆蓋此方法以更改格式或重新定向輸出,將追蹤資訊發送給管理" "員,或執行其他被認為合適的操作。" #: ../../library/wsgiref.rst:668 @@ -954,7 +957,7 @@ msgid "" "The maximum number of frames to include in tracebacks output by the default :" "meth:`log_exception` method. If ``None``, all frames are included." msgstr "" -"默認的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``," +"預設的 :meth:`log_exception` 方法追蹤輸出中包含的最大幀數 。如果為 ``None``," "則包含所有幀。" #: ../../library/wsgiref.rst:674 @@ -962,8 +965,8 @@ msgid "" "This method is a WSGI application to generate an error page for the user. " "It is only invoked if an error occurs before headers are sent to the client." msgstr "" -"這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給客戶端" -"前如果發生錯誤才會被調用。" +"這個方法是一個為使用者去產生錯誤頁面的 WSGI 應用程式。只有在標頭傳送給用戶端" +"前如果發生錯誤才會被呼叫。" #: ../../library/wsgiref.rst:677 msgid "" @@ -980,7 +983,7 @@ msgid "" "`error_headers`, and :attr:`error_body` attributes to generate an output " "page. Subclasses can override this to produce more dynamic error output." msgstr "" -"默認的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:" +"預設的實作只是使用 :attr:`error_status`、:attr:`error_headers` 和 :attr:" "`error_body` 屬性產生輸出頁面。子類別可以覆蓋此方法以生成更動態的錯誤輸出。" #: ../../library/wsgiref.rst:685 @@ -990,15 +993,15 @@ msgid "" "special to enable diagnostic output, which is why the default implementation " "doesn't include any." msgstr "" -"然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,您應該需" -"要採取特殊措施才能啟用診斷輸出,這就是默認實作不包括任何診斷資訊的原因。" +"然而,從安全的角度並不建議向任何普通使用者顯示診斷資訊;理想情況下,你應該需" +"要採取特殊措施才能啟用診斷輸出,這就是預設實作不包括任何診斷資訊的原因。" #: ../../library/wsgiref.rst:693 msgid "" "The HTTP status used for error responses. This should be a status string as " "defined in :pep:`3333`; it defaults to a 500 code and message." msgstr "" -"用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;默認" +"用於錯誤回應的 HTTP 狀態。這應該是一個按照 :pep:`3333` 定義的狀態字串;預設" "為 500 狀態碼和訊息。" #: ../../library/wsgiref.rst:699 @@ -1008,7 +1011,7 @@ msgid "" "The default list just sets the content type to ``text/plain``." msgstr "" "用於錯誤回應的 HTTP 標頭。這應該是一個 WSGI 回應標頭的串列(``(name, " -"value)`` 元組),如 :pep:`3333` 中所描述。默認串列只設置內容種類為 ``text/" +"value)`` 元組),如 :pep:`3333` 中所描述。預設串列只設置內容種類為 ``text/" "plain``。" #: ../../library/wsgiref.rst:706 @@ -1017,8 +1020,8 @@ msgid "" "It defaults to the plain text, \"A server error occurred. Please contact " "the administrator.\"" msgstr "" -"錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。默認為純正文,\"伺服" -"器發生錯誤。請聯繫管理員。\"" +"錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。預設為純文字 \"A " +"servererror occurred. Please contact the administrator.\"" #: ../../library/wsgiref.rst:710 msgid "" @@ -1034,8 +1037,9 @@ msgid "" "FileWrapper`, or ``None``. The default value of this attribute is the :" "class:`wsgiref.util.FileWrapper` class." msgstr "" -"一個 ``wsgi.file_wrapper`` 工廠,與 :class:`wsgiref.types.FileWrapper` 兼容," -"或者為 ``None``。這個屬性的默認值是 :class:`wsgiref.util.FileWrapper` 類別。" +"一個 ``wsgi.file_wrapper`` 工廠函式(factory),與 :class:`wsgiref.types." +"FileWrapper` 相容,或者為 ``None``。這個屬性的預設值是 :class:`wsgiref.util." +"FileWrapper` 類別。" #: ../../library/wsgiref.rst:723 msgid "" @@ -1046,9 +1050,9 @@ msgid "" "default transmission code will not be executed. The default implementation " "of this method just returns a false value." msgstr "" -"覆蓋以實作特定平台的檔案傳輸。只有當應用程序的回傳值是由 :attr:" -"`wsgi_file_wrapper` 屬性指定的類別實例時才會調用此方法。如果它能夠成功傳輸檔" -"案應該回傳一個 true 值,以便不執行默認的傳輸程式碼。該方法的默認實作只回傳一" +"覆蓋以實作特定平台的檔案傳輸。只有當應用程式的回傳值是由 :attr:" +"`wsgi_file_wrapper` 屬性指定的類別實例時才會呼叫此方法。如果它能夠成功傳輸檔" +"案應該回傳一個 true 值,以便不執行預設的傳輸程式碼。該方法的預設實作只回傳一" "個 false 值。" #: ../../library/wsgiref.rst:730 @@ -1062,16 +1066,16 @@ msgid "" "rather than via a CGI-like gateway protocol that wants the HTTP status in a " "special ``Status:`` header." msgstr "" -"這個屬性應該被設置為 true 值,如果處置器的 :meth:`_write` 和 :meth:`_flush` " -"被用於直接與客戶端通訊,而不是透過CGI-like 的閘道協議希望 HTTP 狀態在特殊的 " -"``Status:`` 標頭中。" +"這個屬性應該被設置為 true 值,如果處理程式(handler)的 :meth:`_write` 和 :" +"meth:`_flush` 被用於直接與用戶端通訊,而不是透過 CGI-like 的閘道協議希望 " +"HTTP 狀態在特殊的 ``Status:`` 標頭中。" #: ../../library/wsgiref.rst:740 msgid "" "This attribute's default value is true in :class:`BaseHandler`, but false " "in :class:`BaseCGIHandler` and :class:`CGIHandler`." msgstr "" -"這個屬性在 :class:`BaseCGIHandler` 默認值為 true,但是在 :class:" +"這個屬性在 :class:`BaseCGIHandler` 預設值為 true,但是在 :class:" "`BaseCGIHandler` 和 :class:`CGIHandler` 為 false。" #: ../../library/wsgiref.rst:746 @@ -1079,7 +1083,7 @@ msgid "" "If :attr:`origin_server` is true, this string attribute is used to set the " "HTTP version of the response set to the client. It defaults to ``\"1.0\"``." msgstr "" -"如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給客戶端的回應的 " +"如果 :attr:`origin_server` 為 true,則此字串屬性用於設定傳送給用戶端的回應的 " "HTTP 版本。預設為 ``\"1.0\"``。" #: ../../library/wsgiref.rst:752 @@ -1106,18 +1110,18 @@ msgid "" "to use this routine instead of just copying values out of ``os.environ`` " "directly." msgstr "" -"如果你自己正在實作 CGI-based 處置器,你可能想要使用這個函式來替換單純直接從 " -"``os.environ`` 中複製值。" +"如果你自己正在實作 CGI-based 處理程式(handler),你可能想要使用這個函式來替" +"換單純直接從 ``os.environ`` 中複製值。" #: ../../library/wsgiref.rst:769 msgid ":mod:`wsgiref.types` -- WSGI types for static type checking" -msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 種類。" +msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 型別。" #: ../../library/wsgiref.rst:775 msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." -msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態類型檢查的種類。" +msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態類型檢查的型別。" #: ../../library/wsgiref.rst:783 msgid "" @@ -1125,7 +1129,7 @@ msgid "" "org/pep-3333/#the-start-response-callable>`_ callables (:pep:`3333`)." msgstr "" "一個描述 `start_response() `_ 可呼叫物件的 :class:`typing.Protocol`(:pep:`3333`)。" +"response-callable>`_ 可呼叫物件的 :class:`typing.Protocol` (:pep:`3333`)。" #: ../../library/wsgiref.rst:789 msgid "A type alias describing a WSGI environment dictionary." @@ -1140,16 +1144,16 @@ msgid "" "A :class:`typing.Protocol` describing a `WSGI Input Stream `_." msgstr "" -"一個描述 `WSGI Input Stream `_ 的 :class:`typing.Protocol`。" +"一個描述 `WSGI 輸入串流 `_\\ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:802 msgid "" "A :class:`typing.Protocol` describing a `WSGI Error Stream `_." msgstr "" -"一個描述 `WSGI Error Stream `_ 的 :class:`typing.Protocol`。" +"一個描述 `WSGI 錯誤串流 `_\\ 的 :class:`typing.Protocol`。" #: ../../library/wsgiref.rst:807 msgid "" @@ -1157,8 +1161,8 @@ msgid "" "org/pep-3333/#optional-platform-specific-file-handling>`_. See :class:" "`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." msgstr "" -"一個描述 `file wrapper `_ 的 :class:`typing.Protocol`。請參閱 :class:" +"一個描述 `檔案包裝器 `_\\ 的 :class:`typing.Protocol`。請參閱 :class:" "`wsgiref.util.FileWrapper` 來瞭解此協議的具體實作。" #: ../../library/wsgiref.rst:814 @@ -1174,5 +1178,5 @@ msgid "" "Example of a WSGI application serving the current directory, accept optional " "directory and port number (default: 8000) on the command line::" msgstr "" -"WSGI 應用程式的範例服務的當前目錄,並接受命令行上的可選目錄和埠號(預設:" +"提供當前目錄的 WSGI 應用程式範例,並接受命令列上的可選目錄和埠號(預設:" "8000): ::" From 45e4402343a72110ad995accb97830d95638dca3 Mon Sep 17 00:00:00 2001 From: neochang Date: Sun, 5 Nov 2023 18:30:49 +0800 Subject: [PATCH 6/6] docs(wsgiref): modified simplified chinese word to traditional chinese word and correcting rst syntax issue part 2 --- library/wsgiref.po | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/library/wsgiref.po b/library/wsgiref.po index 931299f34e..599513b00f 100644 --- a/library/wsgiref.po +++ b/library/wsgiref.po @@ -240,8 +240,8 @@ msgid "" "`read` returns an empty bytestring, iteration is ended and is not resumable." msgstr "" ":class:`wsgiref.types.FileWrapper` 協議的具體實作,用於將類檔案物件轉換" -"為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將重複" -"並可選的 *blksize* 引數傳遞給 *filelike* 物件的 :meth:`read` 方法去獲得與產生" +"為 :term:`iterator`。產生的物件是 :term:`iterable`。當物件進行疊代時,將可選" +"的 *blksize* 引數重複傳遞給 *filelike* 物件的 :meth:`read` 方法來獲得將產生(yield)的" "位元組字串。當 :meth:`read` 回傳一個空位元組字串,代表疊代已結束且無法回復。" #: ../../library/wsgiref.rst:166 @@ -332,7 +332,7 @@ msgid "" msgstr "" "對 :class:`Header` 物件呼叫 ``bytes()`` 會回傳適合作為 HTTP 傳輸回應標頭的格" "式化的位元組字串。每個標頭都與其值一起置於一行上,由冒號與空格分隔。每行以回" -"車和換行結束,而該位元組字串則以空行結束。" +"車(carriage return)和換行(line feed)結束,而該位元組字串則以空行結束。" #: ../../library/wsgiref.rst:230 msgid "" @@ -406,7 +406,7 @@ msgid "" msgstr "" "這個模組實作一個簡單的的 HTTP 伺服器(基於 :mod:`http.server`)用於提供 WSGI " "應用程式。每個伺服器執行個體在特定的主機與埠提供單一的 WSGI 應用程式。如果你" -"想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI應用程式以剖析 " +"想要在單一主機與埠上提供多個應用程式,你應該建立一個 WSGI 應用程式以剖析 " "``PATH_INFO`` 去選擇為每個請求呼叫哪個應用程式。(例如,使用來自 :mod:" "`wsgiref.util` 的 :func:`shift_path_info` 函式。)" @@ -450,7 +450,7 @@ msgid "" "You do not normally need to call this constructor, as the :func:" "`make_server` function can handle all the details for you." msgstr "" -"通常你不需要呼叫這個建構器,因為 :func:`make_server` 函式可以為你處理所有細" +"通常你不需要呼叫這個建構函式(constructor),因為 :func:`make_server` 函式可以為你處理所有細" "節。" #: ../../library/wsgiref.rst:325 @@ -501,8 +501,8 @@ msgid "" "`make_server` function. Some possibly relevant methods for overriding in " "subclasses:" msgstr "" -"你不需要直接建立這個類的實例;它們會在需要時由 :class:`WSGIServer` 物件自動建" -"立。不過,你可以建立這個類的子類別並將其作為 *handler_class* 提供給 :func:" +"你不需要直接建立這個類別的實例;它們會在需要時由 :class:`WSGIServer` 物件自動建" +"立。不過,你可以建立這個類別的子類別並將其作為 *handler_class* 提供給 :func:" "`make_server` 函式。一些可能相關的方法可以在子類別中進行覆寫:" #: ../../library/wsgiref.rst:359 @@ -580,7 +580,7 @@ msgid "" "will check that both the *application* and the server invoking it are " "conforming to the WSGI specification and to :rfc:`2616`." msgstr "" -"封裝 *application* 並回傳一個新的 WSGI 應用程式物件。回傳的應用程式將轉發所有" +"包裝 *application* 並回傳一個新的 WSGI 應用程式物件。回傳的應用程式將轉發所有" "請求給原始的 *application*,並檢查 *application* 和呼叫它的伺服器是否符合 " "WSGI 規範和 :rfc:`2616`。" @@ -625,7 +625,7 @@ msgid "" "a WSGI application, as long as they are given a CGI-like environment, along " "with input, output, and error streams." msgstr "" -"這個模組提供實作 WSGI 伺服器和閘道的基礎處理程式(handler)類別。這些基礎類別" +"這個模組提供實作 WSGI 伺服器和閘道的基礎處理程式(handler)類別。這些基底類別" "處理程式大部分與 WSGI 應用程式通訊的工作,只要它們被提供 CGI-like 環境,以及" "輸入、輸出和錯誤串流。" @@ -669,7 +669,7 @@ msgid "" "routing. This handler strips any such duplicated path." msgstr "" "預設情況下,IIS 提供的 ``PATH_INFO`` 會在前面複製 ``SCRIPT_NAME``,對於希望實" -"現路由的 WSGI 應用程式造成問題。這個處理程式(handler)會移除任何這樣的重複路" +"作路由的 WSGI 應用程式造成問題。這個處理程式(handler)會移除任何這樣的重複路" "徑。" #: ../../library/wsgiref.rst:485 @@ -696,7 +696,7 @@ msgid "" "is the WSGI application object you wish to invoke." msgstr "" "CGI 程式碼無法知道是否已設置該選項,因此提供了一個獨立的處理程式(handler)類" -"別。它的使用方式與 :class:`CGIHandler` 相同,即,通過呼叫 ``IISCGIHandler()." +"別。它的使用方式與 :class:`CGIHandler` 相同,即透過呼叫 ``IISCGIHandler()." "run(app)`` 來使用,其中 ``app`` 是你希望呼叫的 WSGI 應用程式物件。" #: ../../library/wsgiref.rst:503 @@ -731,7 +731,7 @@ msgid "" "probably want to subclass this instead of :class:`BaseCGIHandler`." msgstr "" "類似於 :class:`BaseCGIHandler`,但是被設計使用在 HTTP origin 伺服器。如果你正" -"在撰寫 HTTP 伺服器的實作,你可能會想要子類化這個類別來替代 :class:" +"在撰寫 HTTP 伺服器的實作,你可能會想要子類別化這個類別來替代 :class:" "`BaseCGIHandler`。" #: ../../library/wsgiref.rst:522 @@ -754,7 +754,7 @@ msgid "" "The :meth:`~io.BufferedIOBase.write` method of *stdout* should write each " "chunk in full, like :class:`io.BufferedIOBase`." msgstr "" -"*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊,像是 :" +"*stdout* 的 :meth:`~io.BufferedIOBase.write` 方法應該完整地寫入每個塊(chunk),像是 :" "class:`io.BufferedIOBase`。" #: ../../library/wsgiref.rst:535 @@ -763,7 +763,7 @@ msgid "" "will handle a single HTTP request, although in principle you could create a " "subclass that was reusable for multiple requests." msgstr "" -"這是一個運行 WSGI 應用程式的抽象基礎類別。每個實例將處理單個 HTTP 請求,儘管" +"這是一個運行 WSGI 應用程式的抽象基底類別。每個實例將處理單個 HTTP 請求,儘管" "原則上你可以建立一個可重用於多個請求的子類別。" #: ../../library/wsgiref.rst:539 @@ -855,7 +855,7 @@ msgid "" "(or be set by the constructor) in the other subclasses." msgstr "" "用於 ``wsgi.multithread`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " -"true,但在其他子類別中可能有不同的預設值(或由建構器設置)。" +"true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" #: ../../library/wsgiref.rst:603 msgid "" @@ -864,7 +864,7 @@ msgid "" "(or be set by the constructor) in the other subclasses." msgstr "" "用於 ``wsgi.multiprocess`` 環境變數的值。在 :class:`BaseHandler` 中預設為 " -"true,但在其他子類別中可能有不同的預設值(或由建構器設置)。" +"true,但在其他子類別中可能有不同的預設值(或由建構函式設置)。" #: ../../library/wsgiref.rst:610 msgid "" @@ -886,7 +886,7 @@ msgid "" msgstr "" "預設環境變數包含在每一個請求的 WSGI 環境中。預設情況下,這是在載入 :mod:" "`wsgiref.handlers` 時的 `os.environ` 副本,但子類別可以在類別或實例層級建立自" -"己的副本。注意字典應該被視為只讀,因為預設值在多個類別與實例中共享。" +"己的副本。注意字典應該被視為唯讀,因為預設值在多個類別與實例中共享。" #: ../../library/wsgiref.rst:627 msgid "" @@ -974,7 +974,7 @@ msgid "" "should pass that information to *start_response* when calling it (as " "described in the \"Error Handling\" section of :pep:`3333`)." msgstr "" -"此方法使用 ``sys.exception()`` 訪問當前的錯誤,當呼叫它(如 :pep:`3333` 的 " +"此方法使用 ``sys.exception()`` 存取當前的錯誤,當呼叫它(如 :pep:`3333` 的 " "\"Error Handling\" 部分所描述)時應該傳遞資訊給 *start_response*。" #: ../../library/wsgiref.rst:681 @@ -1021,7 +1021,7 @@ msgid "" "the administrator.\"" msgstr "" "錯誤回應的主體。這應該是一個 HTTP 回應內容的位元組字串。預設為純文字 \"A " -"servererror occurred. Please contact the administrator.\"" +"server error occurred. Please contact the administrator.\"" #: ../../library/wsgiref.rst:710 msgid "" @@ -1121,7 +1121,7 @@ msgstr ":mod:`wsgiref.types` -- 用於靜態型別檢查的 WSGI 型別。" msgid "" "This module provides various types for static type checking as described in :" "pep:`3333`." -msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態類型檢查的型別。" +msgstr "這個模組提供在 :pep:`3333` 中所描述的各種用於靜態型別檢查的型別。" #: ../../library/wsgiref.rst:783 msgid "" @@ -1161,7 +1161,7 @@ msgid "" "org/pep-3333/#optional-platform-specific-file-handling>`_. See :class:" "`wsgiref.util.FileWrapper` for a concrete implementation of this protocol." msgstr "" -"一個描述 `檔案包裝器 `_\\ 的 :class:`typing.Protocol`。請參閱 :class:" "`wsgiref.util.FileWrapper` 來瞭解此協議的具體實作。"