1
1
# SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2024, Python Software Foundation
2
+ # Copyright (C) 2001 Python Software Foundation
3
3
# This file is distributed under the same license as the Python package.
4
4
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
5
#
6
6
# Translators:
7
7
# ww song <sww4718168@gmail.com>, 2021
8
8
# Freesand Leo <yuqinju@163.com>, 2024
9
+ # 汇民 王 <whuim@qq.com>, 2025
9
10
#
10
11
#, fuzzy
11
12
msgid ""
12
13
msgstr ""
13
- "Project-Id-Version :Python 3.13 \n "
14
+ "Project-Id-Version :Python 3.14 \n "
14
15
"Report-Msgid-Bugs-To :\n "
15
- "POT-Creation-Date :2024-10-04 14:17+0000 \n "
16
+ "POT-Creation-Date :2025-05-08 02:53-0300 \n "
16
17
"PO-Revision-Date :2021-06-28 01:06+0000\n "
17
- "Last-Translator :Freesand Leo <yuqinju@163 .com>,2024 \n "
18
+ "Last-Translator :汇民 王 <whuim@qq .com>,2025 \n "
18
19
"Language-Team :Chinese (China) (https://app.transifex.com/python-doc/teams/5390/zh_CN/)\n "
19
20
"MIME-Version :1.0\n "
20
21
"Content-Type :text/plain; charset=UTF-8\n "
@@ -207,7 +208,21 @@ msgstr ""
207
208
":meth:`~TopologicalSorter.get_ready` 仍可被用来获取尽可能多的节点直到环阻塞了操作过程。 "
208
209
"在调用此函数后,图将无法再修改,因此不能再使用 :meth:`~TopologicalSorter.add` 添加更多的节点。"
209
210
210
- #: ../../library/graphlib.rst:111
211
+ #: ../../library/graphlib.rst:109
212
+ msgid ""
213
+ "A :exc:`ValueError` will be raised if the sort has been started by "
214
+ ":meth:`~.static_order` or :meth:`~.get_ready`."
215
+ msgstr ""
216
+ "如果排序是通过 :meth:`~.static_order` 方法或 "
217
+ ":meth:`~.get_ready`方法开始的,将会引发一个:exc:`ValueError`异常。"
218
+
219
+ #: ../../library/graphlib.rst:114
220
+ msgid ""
221
+ "``prepare()`` can now be called more than once as long as the sort has not "
222
+ "started. Previously this raised :exc:`ValueError`."
223
+ msgstr "现在,只要排序还没有开始,就可以多次调用 ``prepare()``。以前,这种情况下会引发异常:exc:`ValueError`。"
224
+
225
+ #: ../../library/graphlib.rst:119
211
226
msgid ""
212
227
"Returns ``True`` if more progress can be made and ``False`` otherwise. "
213
228
"Progress can be made if cycles do not block the resolution and either there "
@@ -221,40 +236,40 @@ msgstr ""
221
236
":meth:`TopologicalSorter.done` 的节点数量少于已被 :meth:`TopologicalSorter.get_ready`"
222
237
" 所返回的节点数量则还可以取得进展。"
223
238
224
- #: ../../library/graphlib.rst:118
239
+ #: ../../library/graphlib.rst:126
225
240
msgid ""
226
241
"The :meth:`~object.__bool__` method of this class defers to this function, "
227
242
"so instead of::"
228
243
msgstr "该类的 :meth:`~object.__bool__` 方法要使用此函数,因此除了::"
229
244
230
- #: ../../library/graphlib.rst:121
245
+ #: ../../library/graphlib.rst:129
231
246
msgid ""
232
247
"if ts.is_active():\n"
233
248
" ..."
234
249
msgstr ""
235
250
"if ts.is_active():\n"
236
251
" ..."
237
252
238
- #: ../../library/graphlib.rst:124
253
+ #: ../../library/graphlib.rst:132
239
254
msgid "it is possible to simply do::"
240
255
msgstr "可能会简单地执行::"
241
256
242
- #: ../../library/graphlib.rst:126
257
+ #: ../../library/graphlib.rst:134
243
258
msgid ""
244
259
"if ts:\n"
245
260
" ..."
246
261
msgstr ""
247
262
"if ts:\n"
248
263
" ..."
249
264
250
- #: ../../library/graphlib.rst:129 ../../library/graphlib.rst:152
265
+ #: ../../library/graphlib.rst:137 ../../library/graphlib.rst:160
251
266
msgid ""
252
267
"Raises :exc:`ValueError` if called without calling "
253
268
":meth:`~TopologicalSorter.prepare` previously."
254
269
msgstr ""
255
270
"如果之前未调用 :meth:`~TopologicalSorter.prepare` 就调用此函数则会引发 :exc:`ValueError`。"
256
271
257
- #: ../../library/graphlib.rst:134
272
+ #: ../../library/graphlib.rst:142
258
273
msgid ""
259
274
"Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as "
260
275
"processed, unblocking any successor of each node in *nodes* for being "
@@ -263,7 +278,7 @@ msgstr ""
263
278
"将 :meth:`TopologicalSorter.get_ready` 所返回的节点集合标记为已处理,解除对 *nodes* "
264
279
"中每个节点的后续节点的阻塞以便在将来通过对 :meth:`TopologicalSorter.get_ready` 的调用来返回它们。"
265
280
266
- #: ../../library/graphlib.rst:138
281
+ #: ../../library/graphlib.rst:146
267
282
msgid ""
268
283
"Raises :exc:`ValueError` if any node in *nodes* has already been marked as "
269
284
"processed by a previous call to this method or if a node was not added to "
@@ -275,7 +290,7 @@ msgstr ""
275
290
"将一个节点添加到图中,如果未调用 :meth:`~TopologicalSorter.prepare` 即调用此方法或者如果节点尚未被 "
276
291
":meth:`~TopologicalSorter.get_ready` 所返回则将引发 :exc:`ValueError`。"
277
292
278
- #: ../../library/graphlib.rst:146
293
+ #: ../../library/graphlib.rst:154
279
294
msgid ""
280
295
"Returns a ``tuple`` with all the nodes that are ready. Initially it returns "
281
296
"all nodes with no predecessors, and once those are marked as processed by "
@@ -287,7 +302,7 @@ msgstr ""
287
302
":meth:`TopologicalSorter.done` 将它们标记为已处理,之后的调用将返回所有上级节点已被处理的新节点。 "
288
303
"一旦无法再取得进展,则会返回空元组。"
289
304
290
- #: ../../library/graphlib.rst:157
305
+ #: ../../library/graphlib.rst:165
291
306
msgid ""
292
307
"Returns an iterator object which will iterate over nodes in a topological "
293
308
"order. When using this method, :meth:`~TopologicalSorter.prepare` and "
@@ -297,7 +312,7 @@ msgstr ""
297
312
"返回一个迭代器,它将按照拓扑顺序来迭代所有节点。 当使用此方法时,:meth:`~TopologicalSorter.prepare` 和 "
298
313
":meth:`~TopologicalSorter.done` 不应被调用。 此方法等价于::"
299
314
300
- #: ../../library/graphlib.rst:162
315
+ #: ../../library/graphlib.rst:170
301
316
msgid ""
302
317
"def static_order(self):\n"
303
318
" self.prepare()\n"
@@ -313,13 +328,13 @@ msgstr ""
313
328
" yield from node_group\n"
314
329
" self.done(*node_group)"
315
330
316
- #: ../../library/graphlib.rst:169
331
+ #: ../../library/graphlib.rst:177
317
332
msgid ""
318
333
"The particular order that is returned may depend on the specific order in "
319
334
"which the items were inserted in the graph. For example:"
320
335
msgstr "所返回的特定顺序可能取决于条目被插入图中的顺序。 例如:"
321
336
322
- #: ../../library/graphlib.rst:172
337
+ #: ../../library/graphlib.rst:180
323
338
msgid ""
324
339
">>> ts = TopologicalSorter()\n"
325
340
">>> ts.add(3, 2, 1)\n"
@@ -345,7 +360,7 @@ msgstr ""
345
360
">>> print([*ts2.static_order()])\n"
346
361
"[0, 2, 1, 3]"
347
362
348
- #: ../../library/graphlib.rst:186
363
+ #: ../../library/graphlib.rst:194
349
364
msgid ""
350
365
"This is due to the fact that\" 0\" and\" 2\" are in the same level in the "
351
366
"graph (they would have been returned in the same call to "
@@ -355,19 +370,19 @@ msgstr ""
355
370
"这是由于实际上\" 0\" 和\" 2\" 在图中的级别相同(它们将在对 :meth:`~TopologicalSorter.get_ready` "
356
371
"的同一次调用中被返回) 并且它们之间的顺序是由插入顺序决定的。"
357
372
358
- #: ../../library/graphlib.rst:192
373
+ #: ../../library/graphlib.rst:200
359
374
msgid "If any cycle is detected, :exc:`CycleError` will be raised."
360
375
msgstr "如果检测到任何环,则将引发 :exc:`CycleError`。"
361
376
362
- #: ../../library/graphlib.rst:198
377
+ #: ../../library/graphlib.rst:206
363
378
msgid "Exceptions"
364
379
msgstr "异常"
365
380
366
- #: ../../library/graphlib.rst:199
381
+ #: ../../library/graphlib.rst:207
367
382
msgid "The :mod:`graphlib` module defines the following exception classes:"
368
383
msgstr ":mod:`graphlib` 模块定义了以下异常类:"
369
384
370
- #: ../../library/graphlib.rst:203
385
+ #: ../../library/graphlib.rst:211
371
386
msgid ""
372
387
"Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if"
373
388
" cycles exist in the working graph. If multiple cycles exist, only one "
@@ -376,7 +391,7 @@ msgstr ""
376
391
":exc:`ValueError` 的子类,当特定的图中存在环时将由 :meth:`TopologicalSorter.prepare` 引发。 "
377
392
"如果存在多个环,则将只报告其中一个未定义的选项并将其包括在异常中。"
378
393
379
- #: ../../library/graphlib.rst:207
394
+ #: ../../library/graphlib.rst:215
380
395
msgid ""
381
396
"The detected cycle can be accessed via the second element in the "
382
397
":attr:`~BaseException.args` attribute of the exception instance and consists"