11
11
# 1lin24 <[email protected] >, 2019
12
12
# ppcfish <[email protected] >, 2019
13
13
# ww song <[email protected] >, 2022
14
- # Freesand Leo <[email protected] >, 2022
14
+ # Freesand Leo <[email protected] >, 2023
15
15
#
16
16
#, fuzzy
17
17
msgid ""
18
18
msgstr ""
19
19
"Project-Id-Version : Python 3.7\n "
20
20
"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 "
22
22
"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 "
25
25
"MIME-Version : 1.0\n "
26
26
"Content-Type : text/plain; charset=UTF-8\n "
27
27
"Content-Transfer-Encoding : 8bit\n "
@@ -57,6 +57,11 @@ msgid ""
57
57
"install other module distributions. The Distutils' own setup script, shown "
58
58
"here, is used to install the package into Python 1.5.2.) ::"
59
59
msgstr ""
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 中。) ::"
60
65
61
66
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:35
62
67
msgid ""
@@ -68,6 +73,10 @@ msgid ""
68
73
" module would be tedious to generate and difficult to maintain. For more "
69
74
"information on the additional meta-data, see section :ref:`meta-data`."
70
75
msgstr ""
76
+ "这里与 :ref:`distutils-simple-example` 一节中介绍的最简版单文件分发包只有两处差异:更多的元数据,以及按包列出纯 "
77
+ "Python 模块,而非按模块列出。 这一点很重要因为 Distutils "
78
+ "是由(目前)分成两个包的几十个模块组成的;显式地列出每个模块将十分繁琐并且难以维护。 有关额外元数据的更多信息,请参阅 :ref:`meta-data`"
79
+ " 一节。"
71
80
72
81
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:43
73
82
msgid ""
@@ -79,6 +88,9 @@ msgid ""
79
88
"systems, which of course is one of the major goals of the Distutils. In "
80
89
"this spirit, all pathnames in this document are slash-separated."
81
90
msgstr ""
91
+ "请注意在 setup 脚本中提供的任何路径名称(文件或目录)都应当使用 Unix 约定来书写,即以斜杠分隔。 Distutils "
92
+ "会负责在实际使用该路径名称之前将这个与平台无关的表示形式转换为适用于你的当前平台的形式 。 这使得你的 setup "
93
+ "脚本可以在跨操作系统进行移植,这当然是 Distutils 的主要目标之一。 基于此精神,在本文档中的所有路径名称都是以斜杠分隔的。"
82
94
83
95
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:51
84
96
msgid ""
@@ -87,6 +99,8 @@ msgid ""
87
99
"or :func:`os.listdir` to specify files, you should be careful to write "
88
100
"portable code instead of hardcoding path separators::"
89
101
msgstr ""
102
+ "当然,这仅适用于提供给 Distutils 函数的路径名称。 举例来说,如果你使用标准 Python 函数例如 :func:`glob.glob` 或 "
103
+ ":func:`os.listdir` 来指定文件,则你应当小心地编写可移植的代码而不是硬编码路径分隔符::"
90
104
91
105
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:63
92
106
msgid "Listing whole packages"
@@ -107,6 +121,12 @@ msgid ""
107
121
"lives. If you break this promise, the Distutils will issue a warning but "
108
122
"still process the broken package anyway."
109
123
msgstr ""
124
+ "``packages`` 选项通知 Distutils 处理(构建、分发、安装等)在 ``packages`` 列表中提及的每个包中找到的所有纯 "
125
+ "Python 模块。 当然,为做到这一点,包名称和文件系统的目录之间必须保持对应关系。 默认的对应关系是很显然的,即 :mod:`distutils` "
126
+ "包即相对于分发包根目录的 :file:`distutils` 目录。 因此,当你在你的 setup 脚本中写 ``packages = "
127
+ "['foo']`` 时,你就承诺了 Distutils 将在相对于你的 setup 脚本所在目录下找到一个文件 "
128
+ ":file:`foo/__init__.py` (在你的目录上可能会有不同的拼写形式,但意思已经很明白了)。 如果你违反此承诺,Distutils "
129
+ "将发出警告但无论如何仍会处理损坏的包。"
110
130
111
131
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:77
112
132
msgid ""
@@ -117,6 +137,10 @@ msgid ""
117
137
" in any package at all) are in :file:`lib`, modules in the :mod:`foo` "
118
138
"package are in :file:`lib/foo`, and so forth. Then you would put ::"
119
139
msgstr ""
140
+ "如果你使用不同的约定来布局你的源目录,那也没有问题:你只需提供 ``package_dir`` 选项来告知 Distutils 你的约定。 "
141
+ "例如,假设你将所有For example, say you keep all Python 源代码保存在 :file:`lib` "
142
+ "下,以便“根包”中的模块(即不属于任何包的模块)位于 :file:`lib` 中,:mod:`foo` 包中的模块位于 :file:`lib/foo` "
143
+ "中,依此类推。 那么你应当编写::"
120
144
121
145
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:86
122
146
msgid ""
@@ -126,13 +150,17 @@ msgid ""
126
150
"``packages = ['foo']``, you are promising that the file "
127
151
":file:`lib/foo/__init__.py` exists."
128
152
msgstr ""
153
+ "在你的 setup 脚本中。 这个字典的键是包名,空的包名代表根包。 字典的值是相对于你的发布包根目录的目录名。 在本例中,当你声明 "
154
+ "``packages = ['foo']`` 时,你将承诺存在 :file:`lib/foo/__init__.py` 这个文件。"
129
155
130
156
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:91
131
157
msgid ""
132
158
"Another possible convention is to put the :mod:`foo` package right in "
133
159
":file:`lib`, the :mod:`foo.bar` package in :file:`lib/bar`, etc. This would"
134
160
" be written in the setup script as ::"
135
161
msgstr ""
162
+ "另一种可能的约定是将 :mod:`foo` 包直接放在 :file:`lib` 中,将 :mod:`foo.bar` 包放在 "
163
+ ":file:`lib/bar` 中等等。 这可以在 setup 脚本中写为 ::"
136
164
137
165
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:97
138
166
msgid ""
@@ -145,6 +173,11 @@ msgid ""
145
173
"the Distutils will *not* recursively scan your source tree looking for any "
146
174
"directory with an :file:`__init__.py` file.)"
147
175
msgstr ""
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` 文件的目录。)"
148
181
149
182
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:110
150
183
msgid "Listing individual modules"
@@ -158,6 +191,8 @@ msgid ""
158
191
"shown in section :ref:`distutils-simple-example`; here is a slightly more "
159
192
"involved example::"
160
193
msgstr ""
194
+ "对于一个小型的模块分发包,你可能会倾向于列出所有的模块而不是只列出包 --- 特别是在“根包”中只有一个模块(即根本不存在包)的情况下。 "
195
+ "这种最简单的情况见 :ref:`distutils-simple-example` 一节;下面是一个稍微复杂一点的例子::"
161
196
162
197
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/distutils/setupscript.rst:119
163
198
msgid ""
0 commit comments