File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,6 +141,10 @@ msgid ""
141141"environment variables set according to the CGI standard). Since it may "
142142"consume standard input, it should be instantiated only once."
143143msgstr ""
144+ "要获取提交的表单数据,请使用 :class:`FieldStorage` 类。 如果表单包含非 ASCII 字符,请使用 *encoding* "
145+ "关键字参数并设置为文档所定义的编码格式值。 它通常包含在 HTML 文档的 HEAD 部分的 META 标签中或者由 :mailheader"
146+ ":`Content-Type` 标头所指明。 这会从标准输入或环境读取表单内容(取决于根据 CGI 标准设置的多个环境变量的值)。 "
147+ "由于它可能会消耗标准输入,它应当只被实例化一次。"
144148
145149#: ../../library/cgi.rst:97
146150msgid ""
@@ -152,13 +156,19 @@ msgid ""
152156"for the optional *keep_blank_values* keyword parameter when creating the "
153157":class:`FieldStorage` instance."
154158msgstr ""
159+ ":class:`FieldStorage` 实例可以像 Python 字典一样来检索。 它允许通过 :keyword:`in` "
160+ "运算符进行成员检测,也支持标准字典方法 :meth:`~dict.keys` 和内置函数 :func:`len`。 "
161+ "包含空字符串的表单字段会被忽略而不会出现在字典中;要保留这样的值,请在创建 :class:`FieldStorage` 实例时为可选的 "
162+ "*keep_blank_values* 关键字形参提供一个真值。"
155163
156164#: ../../library/cgi.rst:105
157165msgid ""
158166"For instance, the following code (which assumes that the :mailheader"
159167":`Content-Type` header and blank line have already been printed) checks that"
160168" the fields ``name`` and ``addr`` are both set to a non-empty string::"
161169msgstr ""
170+ "举例来说,下面的代码(假定 :mailheader:`Content-Type` 标头和空行已经被打印)会检查字段 ``name`` 和 "
171+ "``addr`` 是否均被设为非空字符串::"
162172
163173#: ../../library/cgi.rst:119
164174msgid ""
You can’t perform that action at this time.
0 commit comments