-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathextending.po
More file actions
163 lines (150 loc) · 9.18 KB
/
extending.po
File metadata and controls
163 lines (150 loc) · 9.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2025, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.9\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-01-03 16:35+0000\n"
"PO-Revision-Date: 2025-09-22 17:54+0000\n"
"Last-Translator: python-doc bot, 2025\n"
"Language-Team: Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: zh_CN\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../distutils/extending.rst:5
msgid "Extending Distutils"
msgstr "扩展 Distutils"
#: ../../distutils/_setuptools_disclaimer.rst:3
msgid ""
"This document is being retained solely until the ``setuptools`` "
"documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html"
" independently covers all of the relevant information currently included "
"here."
msgstr ""
"这篇文档是历史遗留文档,在 https://setuptools.readthedocs.io/en/latest/setuptools.html 上的"
" ``setuptools`` 文档独立涵盖此处包含的所有相关信息之后,将不再单独作为正式文档保留。"
#: ../../distutils/extending.rst:9
msgid ""
"Distutils can be extended in various ways. Most extensions take the form of"
" new commands or replacements for existing commands. New commands may be "
"written to support new types of platform-specific packaging, for example, "
"while replacements for existing commands may be made to modify details of "
"how the command operates on a package."
msgstr ""
"Distutils 可以通过各种方式扩展。 大多数扩展都采用新命令或现有命令的替换形式。 "
"例如,可以编写新命令以支持新的特定于平台的包格式,但是可以修改现有命令的替换,以修改命令在包上的操作细节。"
#: ../../distutils/extending.rst:15
msgid ""
"Most extensions of the distutils are made within :file:`setup.py` scripts "
"that want to modify existing commands; many simply add a few file extensions"
" that should be copied into packages in addition to :file:`.py` files as a "
"convenience."
msgstr ""
"distutils 的大多数扩展都在想要修改现有命令的 :file:`setup.py` 脚本中编写;其中许多只是简单地在 :file:`.py` "
"文件以外添加了一些应当被拷贝到包中的文件后缀以便使用。"
#: ../../distutils/extending.rst:20
msgid ""
"Most distutils command implementations are subclasses of the "
":class:`distutils.cmd.Command` class. New commands may directly inherit "
"from :class:`Command`, while replacements often derive from :class:`Command`"
" indirectly, directly subclassing the command they are replacing. Commands "
"are required to derive from :class:`Command`."
msgstr ""
"大多部 distutils 命令的实现都是 :class:`distutils.cmd.Command` 类的子类。 新增命令可直接继承自 "
":class:`Command`,而替换命令往往间接派生自 :class:`Command`, 直接子类化它们所替换的命令。 所有命令都要求自 "
":class:`Command` 派生。"
#: ../../distutils/extending.rst:35
msgid "Integrating new commands"
msgstr "集成新的命令"
#: ../../distutils/extending.rst:37
msgid ""
"There are different ways to integrate new command implementations into "
"distutils. The most difficult is to lobby for the inclusion of the new "
"features in distutils itself, and wait for (and require) a version of Python"
" that provides that support. This is really hard for many reasons."
msgstr ""
"有多种方法可将新的命令实现集成到 distutils 中。 最困难的一种是鼓动在 distutils 自身内部包含新特性,并等待(以及要求)某个 "
"Python 版本提供该支持。 出于多种原因,这确实是相当难的。"
#: ../../distutils/extending.rst:42
msgid ""
"The most common, and possibly the most reasonable for most needs, is to "
"include the new implementations with your :file:`setup.py` script, and cause"
" the :func:`distutils.core.setup` function use them::"
msgstr ""
"对于大多数需求来说最为常见并且可能最为合理的一种则是通过你自己的 :file:`setup.py` 脚本来包含新的实现,然后让 "
":func:`distutils.core.setup` 函数使用它们::"
#: ../../distutils/extending.rst:57
msgid ""
"This approach is most valuable if the new implementations must be used to "
"use a particular package, as everyone interested in the package will need to"
" have the new command implementation."
msgstr "如果新的实现必须通过特定的包来使用则此方式最为适宜,因为每个对这个包感兴趣的人都将会需要有新的命令实现。"
#: ../../distutils/extending.rst:61
msgid ""
"Beginning with Python 2.4, a third option is available, intended to allow "
"new commands to be added which can support existing :file:`setup.py` scripts"
" without requiring modifications to the Python installation. This is "
"expected to allow third-party extensions to provide support for additional "
"packaging systems, but the commands can be used for anything distutils "
"commands can be used for. A new configuration option, ``command_packages`` "
"(command-line option :option:`!--command-packages`), can be used to specify "
"additional packages to be searched for modules implementing commands. Like "
"all distutils options, this can be specified on the command line or in a "
"configuration file. This option can only be set in the ``[global]`` section"
" of a configuration file, or before any commands on the command line. If "
"set in a configuration file, it can be overridden from the command line; "
"setting it to an empty string on the command line causes the default to be "
"used. This should never be set in a configuration file provided with a "
"package."
msgstr ""
"从 Python 2.4 开始,还有第三个选项可用,其目标是允许添加支持现有 :file:`setup.py` 脚本的新命令,而不需要修改 Python"
" 安装包。 这预计可允许第三方扩展提供对附加打包系统的支持,而相应命令又可用于任何 distutils 命令可被使用的地方。 新的配置选项 "
"``command_packages`` (命令行选项为 :option:`!--command-packages`) "
"可用来指定附加包,以在其中查找实现新增命令的模块。 像所有 distutils 选项一样,这可以通过命令行或配置文件来指定。 此选项只能在配置文件的 "
"``[global]`` 小节之中或在命令行的任何命令之前设置。 "
"如果是设置在配置文件中,则它可被命令行设置重载;如果在命令行中将其设为空字符串则将会使用默认值。 此选项绝不应当在随特定包提供的配置文件中设置。"
#: ../../distutils/extending.rst:76
msgid ""
"This new option can be used to add any number of packages to the list of "
"packages searched for command implementations; multiple package names should"
" be separated by commas. When not specified, the search is only performed "
"in the :mod:`distutils.command` package. When :file:`setup.py` is run with "
"the option ``--command-packages distcmds,buildcmds``, however, the packages "
":mod:`distutils.command`, :mod:`distcmds`, and :mod:`buildcmds` will be "
"searched in that order. New commands are expected to be implemented in "
"modules of the same name as the command by classes sharing the same name. "
"Given the example command line option above, the command "
":command:`bdist_openpkg` could be implemented by the class "
":class:`distcmds.bdist_openpkg.bdist_openpkg` or "
":class:`buildcmds.bdist_openpkg.bdist_openpkg`."
msgstr ""
"这个新选项可被用来添加任意数量的包到查找命令实现的包列表;多个包名应当以逗号分隔。 当未指明时,查找将只在 "
":mod:`distutils.command` 包中进行。 但是当 :file:`setup.py` 附带 ``--command-packages "
"distcmds,buildcmds`` 选项运行时,:mod:`distutils.command`, :mod:`distcmds` 和 "
":mod:`buildcmds` 包将按此顺序被查找。 新的命令应当在与命名同名的模块中由同名的类来实现。 给定上述示例命令行选项,则命令 "
":command:`bdist_openpkg` 可由类 :class:`distcmds.bdist_openpkg.bdist_openpkg` 或"
" :class:`buildcmds.bdist_openpkg.bdist_openpkg` 来实现。"
#: ../../distutils/extending.rst:90
msgid "Adding new distribution types"
msgstr "添加新的发布类型"
#: ../../distutils/extending.rst:92
msgid ""
"Commands that create distributions (files in the :file:`dist/` directory) "
"need to add ``(command, filename)`` pairs to "
"``self.distribution.dist_files`` so that :command:`upload` can upload it to "
"PyPI. The *filename* in the pair contains no path information, only the "
"name of the file itself. In dry-run mode, pairs should still be added to "
"represent what would have been created."
msgstr ""
"创建发布(在 :file:`dist/` 目录中的文件)的命令需要将 ``(command, filename)`` 二元组添加到 "
"``self.distribution.dist_files`` 以便 :command:`upload` 可以将其上传到 PyPI。 二元组中的 "
"*filename* 不包含路径信息而只有文件名本身。 在 dry-run 模式下,二元组仍然应当被添加以表示必须创建的内容。"