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

Skip to content

Commit 0cf79df

Browse files
[po] auto sync
1 parent 9a32c06 commit 0cf79df

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

library/cgi.po

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ msgid ""
179179
"returns this string value directly; it also accepts an optional second "
180180
"argument as a default to return if the requested key is not present."
181181
msgstr ""
182+
"在这里的字段通过 ``form[key]`` 来访问,它们本身就是 :class:`FieldStorage` (或 "
183+
":class:`MiniFieldStorage`,取决于表单的编码格式) 的实例。 实例的 :attr:`~FieldStorage.value` "
184+
"属性会产生字段的字符串值。 :meth:`~FieldStorage.getvalue` "
185+
"方法直接返回这个字符串;它还接受可选的第二个参数作为当请求的键不存在时要返回的默认值。"
182186

183187
#: ../../library/cgi.rst:126
184188
msgid ""
@@ -192,6 +196,11 @@ msgid ""
192196
" single item case). For example, this code concatenates any number of "
193197
"username fields, separated by commas::"
194198
msgstr ""
199+
"如果提交的表单数据包含一个以上的同名字段,由 ``form[key]`` 所提取的对象将不是一个 :class:`FieldStorage` 或 "
200+
":class:`MiniFieldStorage` 实例而是由这种实例组成的列表。 类似地,在这种情况下,``form.getvalue(key)`` "
201+
"将会返回一个字符串列表。 如果你预计到这种可能性(当你的 HTML 表单包含多个同名字段时),请使用 "
202+
":meth:`~FieldStorage.getlist` 方法,它总是返回一个值的列表(这样你就不需要对只有单个项的情况进行特别处理)。 "
203+
"例如,这段代码拼接了任意数量的 username 字段,以逗号进行分隔::"
195204

196205
#: ../../library/cgi.rst:139
197206
msgid ""
@@ -205,12 +214,17 @@ msgid ""
205214
":class:`FieldStorage` instance (the :func:`~io.RawIOBase.read` and "
206215
":func:`~io.IOBase.readline` methods will return bytes)::"
207216
msgstr ""
217+
"如果一个字段是代表上传的文件,请通过 :attr:`~FieldStorage.value` 属性访问该值或是通过 "
218+
":meth:`~FieldStorage.getvalue` 方法以字节形式将整个文件读入内存。 这可能不是你想要的结果。 你可以通过测试 "
219+
":attr:`~FieldStorage.filename` 属性或 :attr:`~FieldStorage.file` 属性来检测上传的文件。 "
220+
"然后你可以从 :attr:`!file` 属性读取数据,直到它作为 :class:`FieldStorage` 实例的垃圾回收的一部分被自动关闭 "
221+
"(:func:`~io.RawIOBase.read` 和 :func:`~io.IOBase.readline` 方法将返回字节数据)::"
208222

209223
#: ../../library/cgi.rst:159
210224
msgid ""
211225
":class:`FieldStorage` objects also support being used in a :keyword:`with` "
212226
"statement, which will automatically close them when done."
213-
msgstr ""
227+
msgstr ":class:`FieldStorage` 对象还支持在 :keyword:`with` 语句中使用,该语句结束时将自动关闭它们。"
214228

215229
#: ../../library/cgi.rst:162
216230
msgid ""

0 commit comments

Comments
 (0)