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

Skip to content

Commit 866401d

Browse files
[po] auto sync
1 parent 695fd98 commit 866401d

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

howto/urllib2.po

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,8 @@ msgid ""
498498
"fetch urls in the same way as the ``urlopen`` function: there's no need to "
499499
"call ``install_opener``, except as a convenience."
500500
msgstr ""
501+
"opener 对象带有一个 ```open`` 方法,可供直接调用以获取 url,方式与 ``urlopen`` "
502+
"函数相同。除非是为了调用方便,否则没必要去调用 ``install_opener`` 。"
501503

502504
#: ../../howto/urllib2.rst:455
503505
msgid "Basic Authentication"
@@ -519,6 +521,9 @@ msgid ""
519521
"authentication scheme and a 'realm'. The header looks like: ``WWW-"
520522
"Authenticate: SCHEME realm=\"REALM\"``."
521523
msgstr ""
524+
"如果需要身份认证,服务器会发送一条请求身份认证的头部信息(以及 401 "
525+
"错误代码)。这条信息中指明了身份认证方式和“安全区域(realm)”。格式如下所示:``WWW-Authenticate: SCHEME "
526+
"realm=\"REALM\"`` 。 "
522527

523528
#: ../../howto/urllib2.rst:468
524529
msgid "e.g."
@@ -531,6 +536,8 @@ msgid ""
531536
"authentication'. In order to simplify this process we can create an instance"
532537
" of ``HTTPBasicAuthHandler`` and an opener to use this handler."
533538
msgstr ""
539+
"然后,客户端应重试发起请求,请求数据中的头部信息应包含安全区域对应的用户名和密码。这就是“基本身份认证”。为了简化此过程,可以创建 "
540+
"``HTTPBasicAuthHandler`` 的一个实例及使用它的 opener。"
534541

535542
#: ../../howto/urllib2.rst:480
536543
msgid ""
@@ -544,6 +551,11 @@ msgid ""
544551
" providing an alternative combination for a specific realm. We indicate this"
545552
" by providing ``None`` as the realm argument to the ``add_password`` method."
546553
msgstr ""
554+
"``HTTPBasicAuthHandler`` 用一个名为密码管理器的对象来管理 "
555+
"URL、安全区域与密码、用户名之间的映射关系。如果知道确切的安全区域(来自服务器发送的身份认证头部信息),那就可以用到 "
556+
"``HTTPPasswordMgr`` 。通常人们并不关心安全区域是什么,这时用``HTTPPasswordMgrWithDefaultRealm`` "
557+
"就很方便,允许为 URL 指定默认的用户名和密码。当没有为某个安全区域提供用户名和密码时,就会用到默认值。下面用 ``None`` 作为 "
558+
"``add_password`` 方法的安全区域参数,表明采用默认用户名和密码。"
547559

548560
#: ../../howto/urllib2.rst:490
549561
msgid ""

library/xml.dom.minidom.po

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,31 @@ msgid ""
3838
"Users who are not already proficient with the DOM should consider using the "
3939
":mod:`xml.etree.ElementTree` module for their XML processing instead."
4040
msgstr ""
41+
":mod:`xml.dom.minidom` 是文档对象模型接口的最小化实现,具有与其他语言类似的 API。 它的目标是比完整 DOM "
42+
"更简单并且更为小巧。 对于 DOM 还不十分熟悉的用户则应当考虑改用 :mod:`xml.etree.ElementTree` 模块来进行 XML "
43+
"处理。"
4144

4245
#: ../../library/xml.dom.minidom.rst:24
4346
msgid ""
4447
"The :mod:`xml.dom.minidom` module is not secure against maliciously "
4548
"constructed data. If you need to parse untrusted or unauthenticated data "
4649
"see :ref:`xml-vulnerabilities`."
4750
msgstr ""
51+
":mod:`xml.dom.minidom` 模块对于恶意构建的数据是不安全的。 如果你需要解析不受信任或未经身份验证的数据,请参阅 :ref"
52+
":`xml-vulnerabilities`。"
4853

4954
#: ../../library/xml.dom.minidom.rst:29
5055
msgid ""
5156
"DOM applications typically start by parsing some XML into a DOM. With "
5257
":mod:`xml.dom.minidom`, this is done through the parse functions::"
5358
msgstr ""
59+
"DOM 应用程序通常会从将某个 XML 解析为 DOM 开始。 使用 :mod:`xml.dom.minidom` 时,这是通过各种解析函数来完成的::"
5460

5561
#: ../../library/xml.dom.minidom.rst:41
5662
msgid ""
5763
"The :func:`parse` function can take either a filename or an open file "
5864
"object."
59-
msgstr ""
65+
msgstr ":func:`parse` 函数可接受一个文件名或者打开的文件对象。"
6066

6167
#: ../../library/xml.dom.minidom.rst:46
6268
msgid ""
@@ -66,6 +72,9 @@ msgid ""
6672
"parser and activate namespace support; other parser configuration (like "
6773
"setting an entity resolver) must have been done in advance."
6874
msgstr ""
75+
"根据给定的输入返回一个 :class:`Document`。 *filename_or_file* 可以是一个文件名,或是一个文件类对象。 如果给定 "
76+
"*parser* 则它必须是一个 SAX2 解析器对象。 "
77+
"此函数将修改解析器的处理程序并激活命名空间支持;其他解析器配置(例如设置一个实体求解器)必须已经提前完成。"
6978

7079
#: ../../library/xml.dom.minidom.rst:52
7180
msgid ""
@@ -79,12 +88,16 @@ msgid ""
7988
" an :class:`io.StringIO` object for the string and passes that on to "
8089
":func:`parse`."
8190
msgstr ""
91+
"返回一个代表 *string* 的 :class:`Document`。 此方法会为指定字符串创建一个 :class:`io.StringIO` "
92+
"对象并将其传递给 :func:`parse`。"
8293

8394
#: ../../library/xml.dom.minidom.rst:61
8495
msgid ""
8596
"Both functions return a :class:`Document` object representing the content of"
8697
" the document."
8798
msgstr ""
99+
"两个函数均返回一个代表文档内容的 :class:`Document` 对象。object representing the content of the"
100+
" document."
88101

89102
#: ../../library/xml.dom.minidom.rst:64
90103
msgid ""
@@ -96,6 +109,9 @@ msgid ""
96109
"it's simply that these functions do not provide a parser implementation "
97110
"themselves."
98111
msgstr ""
112+
":func:`parse` 和 :func:`parseString` 函数所做的是将 XML 解析器连接到一个 \"DOM 构建器\",它可以从任意 "
113+
"SAX 解析器接收解析事件并将其转换为 DOM 树结构。 这两个函数的名称可能有些误导性,但在学习此接口时是很容易掌握的。 "
114+
"文档解析操作将在这两个函数返回之前完成;简单地说这两个函数本身并不提供解析器实现。"
99115

100116
#: ../../library/xml.dom.minidom.rst:71
101117
msgid ""
@@ -105,6 +121,9 @@ msgid ""
105121
":mod:`xml.dom.minidom` module. Once you have a :class:`Document`, you can "
106122
"add child nodes to it to populate the DOM::"
107123
msgstr ""
124+
"你也可以通过在一个 \"DOM 实现\" 对象上调用方法来创建 :class:`Document`。 此对象可通过调用 :mod:`xml.dom` "
125+
"包或者 :mod:`xml.dom.minidom` 模块中的 :func:`getDOMImplementation` 函数来获取。 一旦你获得了一个"
126+
" :class:`Document`,你就可以向它添加子节点来填充 DOM::"
108127

109128
#: ../../library/xml.dom.minidom.rst:86
110129
msgid ""

0 commit comments

Comments
 (0)