@@ -49,6 +49,9 @@ msgid ""
4949"option, which the installer can then override either on the command-line or "
5050"by editing the config file."
5151msgstr ""
52+ "通常,在 *事前* 就写出构建发布包所需的一切是不可能的:你可能需要从用户或者用户的系统获取一些信息,才能继续下去。 只要这些信息相当简单 —— "
53+ "例如一个用于搜索 C 头文件或库的目录列表 —— 那么提供配置文件 :file:`setup.cfg` 供用户配置就是一个低成本且方便的解决方式。 "
54+ "配置文件还允许你为任何命令选项提供默认值,而安装器可以通过命令行或编辑配置文件来覆盖这些默认值。"
5255
5356#: ../../distutils/configfile.rst:18
5457msgid ""
@@ -60,28 +63,31 @@ msgid ""
6063"after the contents of the setup script, but before the command-line. This "
6164"has several useful consequences:"
6265msgstr ""
66+ "安装配置文件是在安装脚本和安装脚本命令行之间一个适当的折衷方式 --- 安装脚本在理想情况下应当不受安装者的控制 [#]_ --- "
67+ "而安装脚本命令行则在你的控制范围之外且完全取决于安装者的选择。 实际上,:file:`setup.cfg` (以及目标系统上的其他任何 "
68+ "Distutils 配置文件) 是在配置脚本之后、命令行之前被处理。 这导致了几个有用的后果:"
6369
6470#: ../../distutils/configfile.rst:32
6571msgid ""
6672"installers can override some of what you put in :file:`setup.py` by editing "
6773":file:`setup.cfg`"
68- msgstr ""
74+ msgstr "安装者可以通过编辑 :file:`setup.cfg` 来覆盖你放在 :file:`setup.py` 中的配置 "
6975
7076#: ../../distutils/configfile.rst:35
7177msgid ""
7278"you can provide non-standard defaults for options that are not easily set in"
7379" :file:`setup.py`"
74- msgstr ""
80+ msgstr "你可以为无法在 :file:`setup.py` 中方便设置的选项提供非标准的默认值 "
7581
7682#: ../../distutils/configfile.rst:38
7783msgid ""
7884"installers can override anything in :file:`setup.cfg` using the command-line"
7985" options to :file:`setup.py`"
80- msgstr ""
86+ msgstr "安装者可以使用 :file:`setup.py` 的命令行选项来覆盖 :file:`setup.cfg` 中的一切 "
8187
8288#: ../../distutils/configfile.rst:41
8389msgid "The basic syntax of the configuration file is simple:"
84- msgstr ""
90+ msgstr "配置文件的基本语法很简单: "
8591
8692#: ../../distutils/configfile.rst:49
8793msgid ""
@@ -93,18 +99,21 @@ msgid ""
9399"of the line. Long option values can be split across multiple lines simply "
94100"by indenting the continuation lines."
95101msgstr ""
102+ "其中 *command* 是一个 Distutils 命令 (例如 :command:`build_py`, :command:`install`),而"
103+ " *option* 是该命令所支持的某个选项。 可以为每个命令提供任意数量的选项,并且可以在文件中包括任意数量的命令组。 空白行会被忽略,以一个 "
104+ "``'#'`` 开始的注释行也是如此。 长选项值可以简单地通过缩进后续行的方式被拆分为多行。"
96105
97106#: ../../distutils/configfile.rst:57
98107msgid ""
99108"You can find out the list of options supported by a particular command with "
100109"the universal :option:`!--help` option, e.g."
101- msgstr ""
110+ msgstr "你可以用通用的 :option:`!--help` 选项找出特定命令所支持的选项列表,例如 "
102111
103112#: ../../distutils/configfile.rst:75
104113msgid ""
105114"Note that an option spelled :option:`!--foo-bar` on the command-line is "
106115"spelled ``foo_bar`` in configuration files."
107- msgstr ""
116+ msgstr "请注意在命令行中拼写为 :option:`!--foo-bar` 的选项在配置文件中会拼写为 ``foo_bar``。 "
108117
109118#: ../../distutils/configfile.rst:80
110119msgid ""
@@ -115,6 +124,9 @@ msgid ""
115124"You can always use the :option:`!--inplace` option on the command-line to "
116125"ensure this:"
117126msgstr ""
127+ "例如,假设你希望你的扩展在“原地”构建 --- 就是说你有一个扩展 :mod:`pkg.ext`,你希望编译出的扩展文件 (例如在 Unix 上为 "
128+ ":file:`ext.so`) 放在与你的纯 Python 模块 :mod:`pkg.mod1` 和 :mod:`pkg.mod2` 相同的源目录中。 "
129+ "你总是可以在命令行中使用 :option:`!--inplace` 选项来确保这一点:"
118130
119131#: ../../distutils/configfile.rst:90
120132msgid ""
@@ -123,6 +135,8 @@ msgid ""
123135"to \" set and forget\" this option, by encoding it in :file:`setup.cfg`, the "
124136"configuration file for this distribution:"
125137msgstr ""
138+ "但是这要求你总是显式地指定 :command:`build_ext` 命令,并且记得提供 :option:`!--inplace`。 "
139+ "一个更容易的方式是通过将其编码在此发布包的配置文件 :file:`setup.cfg` 中,“设置并忘记”该选项。"
126140
127141#: ../../distutils/configfile.rst:100
128142msgid ""
@@ -136,6 +150,9 @@ msgid ""
136150"extensions that expect to be built in their installation directory is almost"
137151" always a bad idea, though.)"
138152msgstr ""
153+ "这将影响此模块发布包的所有构建,不论你是否显式指定 :command:`build_ext`。 如果你在你的源发布包中包括了 "
154+ ":file:`setup.cfg`,它还将影响最终用户的构建 --- 对此选项来说这可能不是个好主意,因为总是原地构建扩展会破坏模块发布包的安装。 "
155+ "不过在某些特殊情况下,模块是在其安装目录中被构建的,因此这可能会是个有用的功能。 (但是,发布预期在其安装目录中被构建的扩展几乎总是一个坏主意。)"
139156
140157#: ../../distutils/configfile.rst:109
141158msgid ""
@@ -148,22 +165,26 @@ msgid ""
148165"very tedious to do on the command-line for every run. Hence, here is a "
149166"snippet from the Distutils' own :file:`setup.cfg`:"
150167msgstr ""
168+ "另一个例子:特定的命令会接受许多在多次运行中都不发生变化的选项;例如,:command:`bdist_rpm` 需要知道为创建 RPM 发布包生成 "
169+ "\" spec\" 文件所要求的所有信息。 这些信息有的来自安装脚本,有的由 Distutils 自动生成(例如已安装文件列表)。 但有的则必须作为 "
170+ ":command:`bdist_rpm` 的选项提供,每次运行时都在命令行中完成将会非常繁琐。 因此,这里提供 Distutils 本身的 "
171+ ":file:`setup.cfg` 中的一段代码:"
151172
152173#: ../../distutils/configfile.rst:129
153174msgid ""
154175"Note that the ``doc_files`` option is simply a whitespace-separated string "
155176"split across multiple lines for readability."
156- msgstr ""
177+ msgstr "请注意 ``doc_files`` 选项只是一个空格分隔以提高可读性的多行字符串。 "
157178
158179#: ../../distutils/configfile.rst:136
159180msgid ":ref:`inst-config-syntax` in \" Installing Python Modules\" "
160- msgstr ""
181+ msgstr "\" 安装 Python 模块 \" 中的 :ref:`inst-config-syntax` "
161182
162183#: ../../distutils/configfile.rst:136
163184msgid ""
164185"More information on the configuration files is available in the manual for "
165186"system administrators."
166- msgstr ""
187+ msgstr "有关配置文件的更多信息可在系统管理员手册中查看。 "
167188
168189#: ../../distutils/configfile.rst:141
169190msgid "Footnotes"
@@ -173,4 +194,4 @@ msgstr "脚注"
173194msgid ""
174195"This ideal probably won't be achieved until auto-configuration is fully "
175196"supported by the Distutils."
176- msgstr ""
197+ msgstr "在 Distutils 完全支持自动配置之前,这一理想可能是无法实现的。 "
0 commit comments