@@ -307,26 +307,26 @@ msgid ""
307307"The interface consists of two simple methods. Using the methods you can "
308308"process form data in a generic way, without the need to worry whether only "
309309"one or more values were posted under one name."
310- msgstr ""
310+ msgstr "此接口由两个简单的方法组成。 你可以使用这两个方法以通用的方式处理表单数据,而无需担心在一个名称下提交的值是只有一个还是有多个。 "
311311
312312#: ../../library/cgi.rst:208
313313msgid ""
314314"In the previous section, you learned to write following code anytime you "
315315"expected a user to post more than one value under one name::"
316- msgstr ""
316+ msgstr "在前面的部分中,你已学会当你预期用户在一个名称下提交超过一个值的时候编写以下代码:: "
317317
318318#: ../../library/cgi.rst:217
319319msgid ""
320320"This situation is common for example when a form contains a group of "
321321"multiple checkboxes with the same name::"
322- msgstr ""
322+ msgstr "这种情况很常见,例如当一个表单包含具有相同名称的一组复选框的时候:: "
323323
324324#: ../../library/cgi.rst:223
325325msgid ""
326326"In most situations, however, there's only one form control with a particular"
327327" name in a form and then you expect and need only one value associated with "
328328"this name. So you write a script containing for example this code::"
329- msgstr ""
329+ msgstr "但是在多数情况下,一个表单中的一个特定名称只对应一个表单控件。 因此你可能会编写包含以下代码的脚本:: "
330330
331331#: ../../library/cgi.rst:229
332332msgid ""
@@ -338,13 +338,16 @@ msgid ""
338338"on a list is not valid (since lists do not have a method of this name) and "
339339"results in an :exc:`AttributeError` exception."
340340msgstr ""
341+ "这段代码的问题在于你绝不能预期客户端会向你的脚本提供合法的输入。 举例来说,如果一个好奇的用户向查询字符串添加了另一个 ``user=foo`` "
342+ "对,则该脚本将会崩溃,因为在这种情况下 ``getvalue(\" user\" )`` 方法调用将返回一个列表而不是字符串。 在一个列表上调用 "
343+ ":meth:`~str.upper` 方法是不合法的(因为列表并没有这个方法)因而会引发 :exc:`AttributeError` 异常。"
341344
342345#: ../../library/cgi.rst:237
343346msgid ""
344347"Therefore, the appropriate way to read form data values was to always use "
345348"the code which checks whether the obtained value is a single value or a list"
346349" of values. That's annoying and leads to less readable scripts."
347- msgstr ""
350+ msgstr "因此,读取表单数据值的正确方式应当总是使用检查所获取的值是单一值还是值列表的代码。 这很麻烦并且会使脚本缺乏可读性。 "
348351
349352#: ../../library/cgi.rst:241
350353msgid ""
0 commit comments