1111# 1lin24 <[email protected] >, 20191212# ppcfish <[email protected] >, 20191313# ww song <[email protected] >, 202214- # Freesand Leo <[email protected] >, 2022 14+ # Freesand Leo <[email protected] >, 2023 1515#
1616#, fuzzy
1717msgid ""
1818msgstr ""
1919"Project-Id-Version : Python 3.7\n "
2020"Report-Msgid-Bugs-To : \n "
21- "POT-Creation-Date : 2023-02-24 14:40 +0000\n "
21+ "POT-Creation-Date : 2023-04-14 14:38 +0000\n "
2222"PO-Revision-Date : 2019-09-01 02:40+0000\n "
23- "
Last-Translator :
Freesand Leo <[email protected] >, 2022 \n "
24- "Language-Team : Chinese (China) (https://www .transifex.com/python-doc/teams/5390/zh_CN/)\n "
23+ "
Last-Translator :
Freesand Leo <[email protected] >, 2023 \n "
24+ "Language-Team : Chinese (China) (https://app .transifex.com/python-doc/teams/5390/zh_CN/)\n "
2525"MIME-Version : 1.0\n "
2626"Content-Type : text/plain; charset=UTF-8\n "
2727"Content-Transfer-Encoding : 8bit\n "
@@ -57,6 +57,11 @@ msgid ""
5757"install other module distributions. The Distutils' own setup script, shown "
5858"here, is used to install the package into Python 1.5.2.) ::"
5959msgstr ""
60+ "(请记住,虽然distutils包含在Python 1.6及更高版本中,但它们也有独立的存在,因此Python "
61+ "1.5.2用户可以使用它们来安装其他模块发行版。这里显示的distutils自己的setup脚本用于将该软件包安装到Python 1.5.2中。) "
62+ "这是一个略微复杂一点的例子,我们将在接下来的几节中继续追踪它:Distutils 本身的安装脚本。 (请记住虽然 Distutils 被包括在 "
63+ "Python 1.6 及之后的版本中,但它们也仍保存独立存在因此 Python 1.5.2 用户可以使用它们来安装其他模块分发版。 这里所演示的 "
64+ "Distutils 本身的安装脚本,是用来将该软件包安装到 Python 1.5.2 中。) ::"
6065
6166#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:35
6267msgid ""
@@ -68,6 +73,10 @@ msgid ""
6873" module would be tedious to generate and difficult to maintain. For more "
6974"information on the additional meta-data, see section :ref:`meta-data`."
7075msgstr ""
76+ "这里与 :ref:`distutils-simple-example` 一节中介绍的最简版单文件分发包只有两处差异:更多的元数据,以及按包列出纯 "
77+ "Python 模块,而非按模块列出。 这一点很重要因为 Distutils "
78+ "是由(目前)分成两个包的几十个模块组成的;显式地列出每个模块将十分繁琐并且难以维护。 有关额外元数据的更多信息,请参阅 :ref:`meta-data`"
79+ " 一节。"
7180
7281#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:43
7382msgid ""
@@ -79,6 +88,9 @@ msgid ""
7988"systems, which of course is one of the major goals of the Distutils. In "
8089"this spirit, all pathnames in this document are slash-separated."
8190msgstr ""
91+ "请注意在 setup 脚本中提供的任何路径名称(文件或目录)都应当使用 Unix 约定来书写,即以斜杠分隔。 Distutils "
92+ "会负责在实际使用该路径名称之前将这个与平台无关的表示形式转换为适用于你的当前平台的形式 。 这使得你的 setup "
93+ "脚本可以在跨操作系统进行移植,这当然是 Distutils 的主要目标之一。 基于此精神,在本文档中的所有路径名称都是以斜杠分隔的。"
8294
8395#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:51
8496msgid ""
@@ -87,6 +99,8 @@ msgid ""
8799"or :func:`os.listdir` to specify files, you should be careful to write "
88100"portable code instead of hardcoding path separators::"
89101msgstr ""
102+ "当然,这仅适用于提供给 Distutils 函数的路径名称。 举例来说,如果你使用标准 Python 函数例如 :func:`glob.glob` 或 "
103+ ":func:`os.listdir` 来指定文件,则你应当小心地编写可移植的代码而不是硬编码路径分隔符::"
90104
91105#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:63
92106msgid "Listing whole packages"
@@ -107,6 +121,12 @@ msgid ""
107121"lives. If you break this promise, the Distutils will issue a warning but "
108122"still process the broken package anyway."
109123msgstr ""
124+ "``packages`` 选项通知 Distutils 处理(构建、分发、安装等)在 ``packages`` 列表中提及的每个包中找到的所有纯 "
125+ "Python 模块。 当然,为做到这一点,包名称和文件系统的目录之间必须保持对应关系。 默认的对应关系是很显然的,即 :mod:`distutils` "
126+ "包即相对于分发包根目录的 :file:`distutils` 目录。 因此,当你在你的 setup 脚本中写 ``packages = "
127+ "['foo']`` 时,你就承诺了 Distutils 将在相对于你的 setup 脚本所在目录下找到一个文件 "
128+ ":file:`foo/__init__.py` (在你的目录上可能会有不同的拼写形式,但意思已经很明白了)。 如果你违反此承诺,Distutils "
129+ "将发出警告但无论如何仍会处理损坏的包。"
110130
111131#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:77
112132msgid ""
@@ -117,6 +137,10 @@ msgid ""
117137" in any package at all) are in :file:`lib`, modules in the :mod:`foo` "
118138"package are in :file:`lib/foo`, and so forth. Then you would put ::"
119139msgstr ""
140+ "如果你使用不同的约定来布局你的源目录,那也没有问题:你只需提供 ``package_dir`` 选项来告知 Distutils 你的约定。 "
141+ "例如,假设你将所有For example, say you keep all Python 源代码保存在 :file:`lib` "
142+ "下,以便“根包”中的模块(即不属于任何包的模块)位于 :file:`lib` 中,:mod:`foo` 包中的模块位于 :file:`lib/foo` "
143+ "中,依此类推。 那么你应当编写::"
120144
121145#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:86
122146msgid ""
@@ -126,13 +150,17 @@ msgid ""
126150"``packages = ['foo']``, you are promising that the file "
127151":file:`lib/foo/__init__.py` exists."
128152msgstr ""
153+ "在你的 setup 脚本中。 这个字典的键是包名,空的包名代表根包。 字典的值是相对于你的发布包根目录的目录名。 在本例中,当你声明 "
154+ "``packages = ['foo']`` 时,你将承诺存在 :file:`lib/foo/__init__.py` 这个文件。"
129155
130156#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:91
131157msgid ""
132158"Another possible convention is to put the :mod:`foo` package right in "
133159":file:`lib`, the :mod:`foo.bar` package in :file:`lib/bar`, etc. This would"
134160" be written in the setup script as ::"
135161msgstr ""
162+ "另一种可能的约定是将 :mod:`foo` 包直接放在 :file:`lib` 中,将 :mod:`foo.bar` 包放在 "
163+ ":file:`lib/bar` 中等等。 这可以在 setup 脚本中写为 ::"
136164
137165#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:97
138166msgid ""
@@ -145,6 +173,11 @@ msgid ""
145173"the Distutils will *not* recursively scan your source tree looking for any "
146174"directory with an :file:`__init__.py` file.)"
147175msgstr ""
176+ "``package_dir`` 字典中的 ``package: dir`` 条目隐式地应用于 *package* 以下的所有包,因而在这里 "
177+ ":mod:`foo.bar` 的情况会被自动地处理。 在这个示例中,使用 ``packages = ['foo', 'foo.bar']`` 告知 "
178+ "Distutils 要查找 :file:`lib/__init__.py` 和 :file:`lib/bar/__init__.py`。 (请记住虽然 "
179+ "``package_dir`` 会递归地应用,但你必须在 ``packages`` 中显式地列出所有的包:Distutils *不会* "
180+ "递归地扫描你的源代码树来查找任何带有 :file:`__init__.py` 文件的目录。)"
148181
149182#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:110
150183msgid "Listing individual modules"
@@ -158,6 +191,8 @@ msgid ""
158191"shown in section :ref:`distutils-simple-example`; here is a slightly more "
159192"involved example::"
160193msgstr ""
194+ "对于一个小型的模块分发包,你可能会倾向于列出所有的模块而不是只列出包 --- 特别是在“根包”中只有一个模块(即根本不存在包)的情况下。 "
195+ "这种最简单的情况见 :ref:`distutils-simple-example` 一节;下面是一个稍微复杂一点的例子::"
161196
162197#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:119
163198msgid ""
0 commit comments