@@ -42,20 +42,27 @@ msgid ""
4242"There is a `third party interface "
4343"<https://www.jcea.es/programacion/pybsddb.htm>`_ to the Oracle Berkeley DB."
4444msgstr ""
45+ ":mod:`dbm` 是一种泛用接口,针对各种 DBM 数据库 --- 包括 :mod:`dbm.gnu` 或 :mod:`dbm.ndbm`。 "
46+ "如果未安装这些模块中的任何一种,则将使用 :mod:`dbm.dumb` 模块中慢速但简单的实现。 还有一个适用于 Oracle Berkeley DB"
47+ " 的 `第三方接口 <https://www.jcea.es/programacion/pybsddb.htm>`_。"
4548
4649#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:20
4750msgid ""
4851"A tuple containing the exceptions that can be raised by each of the "
4952"supported modules, with a unique exception also named :exc:`dbm.error` as "
5053"the first item --- the latter is used when :exc:`dbm.error` is raised."
5154msgstr ""
55+ "一个元组,其中包含每个受支持的模块可引发的异常,另外还有一个名为 :exc:`dbm.error` 的特殊异常作为第一项 --- 后者最在引发 "
56+ ":exc:`dbm.error` 时被使用。"
5257
5358#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:27
5459msgid ""
5560"This function attempts to guess which of the several simple database modules"
5661" available --- :mod:`dbm.gnu`, :mod:`dbm.ndbm` or :mod:`dbm.dumb` --- should"
5762" be used to open a given file."
5863msgstr ""
64+ "此函数会猜测各种简单数据库模块中的哪一个是可用的 --- :mod:`dbm.gnu`, :mod:`dbm.ndbm` 还是 "
65+ ":mod:`dbm.dumb` --- 应该被用来打开给定的文件。"
5966
6067#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:31
6168msgid ""
@@ -64,17 +71,20 @@ msgid ""
6471"file's format can't be guessed; or a string containing the required module "
6572"name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``."
6673msgstr ""
74+ "返回下列值中的一个:如果文件由于不可读或不存在而无法打开则返回 ``None``;如果文件的格式无法猜测则返回空字符串 "
75+ "(``''``);或是包含所需模块名称的字符串,例如 ``'dbm.ndbm'`` 或 ``'dbm.gnu'``。"
6776
6877#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:39
6978msgid "Open the database file *file* and return a corresponding object."
70- msgstr ""
79+ msgstr "打开数据库文件 *file* 并返回一个相应的对象。 "
7180
7281#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:41
7382msgid ""
7483"If the database file already exists, the :func:`whichdb` function is used to"
7584" determine its type and the appropriate module is used; if it does not "
7685"exist, the first module listed above that can be imported is used."
7786msgstr ""
87+ "如果数据库文件已存在,则使用 :func:`whichdb` 函数来确定其类型和要使用的适当模块;如果文件不存在,则会使用上述可导入模块中的第一个。"
7888
7989#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:45
8090#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:161
@@ -162,6 +172,8 @@ msgid ""
162172"the database has to be created. It defaults to octal ``0o666`` (and will be"
163173" modified by the prevailing umask)."
164174msgstr ""
175+ "可选的 *mode* 参数是文件的 Unix 模式,仅在要创建数据库时才会被使用。 其默认值为八进制数 ``0o666`` (并将被当前的 umask "
176+ "所修改)。"
165177
166178#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:68
167179msgid ""
@@ -170,18 +182,20 @@ msgid ""
170182"retrieved, and deleted, and the :keyword:`in` operator and the :meth:`keys` "
171183"method are available, as well as :meth:`get` and :meth:`setdefault`."
172184msgstr ""
185+ ":func:`.open` 所返回的对象支持与字典相同的基本功能;可以存储、获取和删除键及其对应的值,并可使用 :keyword:`in` 运算符和 "
186+ ":meth:`keys` 方法,以及 :meth:`get` 和 :meth:`setdefault`。"
173187
174188#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:73
175189msgid ""
176190":meth:`get` and :meth:`setdefault` are now available in all database "
177191"modules."
178- msgstr ""
192+ msgstr "现在 :meth:`get` 和 :meth:`setdefault` 在所有数据库模块中均可用。 "
179193
180194#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:76
181195msgid ""
182196"Deleting a key from a read-only database raises database module specific "
183197"error instead of :exc:`KeyError`."
184- msgstr ""
198+ msgstr "从只读数据库中删除键将引发数据库模块专属的错误而不是 :exc:`KeyError`。 "
185199
186200#: /home/travis/build/python/cpython-doc-catalog/Doc/library/dbm.rst:80
187201msgid ""
0 commit comments