-
-
Notifications
You must be signed in to change notification settings - Fork 224
Expand file tree
/
Copy pathasyncio-graph.po
More file actions
249 lines (219 loc) · 9.62 KB
/
asyncio-graph.po
File metadata and controls
249 lines (219 loc) · 9.62 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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.14\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-09-08 15:25+0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../library/asyncio-graph.rst:8
msgid "Call Graph Introspection"
msgstr "呼叫圖內省(Call Graph Introspection)"
#: ../../library/asyncio-graph.rst:10
msgid "**Source code:** :source:`Lib/asyncio/graph.py`"
msgstr "**原始碼:**\\ :source:`Lib/asyncio/graph.py`"
#: ../../library/asyncio-graph.rst:14
msgid ""
"asyncio has powerful runtime call graph introspection utilities to trace the "
"entire call graph of a running *coroutine* or *task*, or a suspended "
"*future*. These utilities and the underlying machinery can be used from "
"within a Python program or by external profilers and debuggers."
msgstr ""
"asyncio 擁有強大的 runtime 呼叫圖內省工具,可以追蹤執行中的\\ *協程*\\ 或\\ "
"*任務*,或是暫停的 *future* 的完整呼叫圖。這些工具和底層機制可以在 "
"Python 程式內部使用,或被外部分析器和偵錯器使用。"
#: ../../library/asyncio-graph.rst:25
msgid ""
"Print the async call graph for the current task or the "
"provided :class:`Task` or :class:`Future`."
msgstr ""
"印出當前任務或所提供的 :class:`Task` 或 :class:`Future` 的非同步呼叫圖。"
#: ../../library/asyncio-graph.rst:28
msgid ""
"This function prints entries starting from the top frame and going down "
"towards the invocation point."
msgstr "此函式會從頂層幀(frame)開始印出條目,然後往下到呼叫點。"
#: ../../library/asyncio-graph.rst:31
msgid ""
"The function receives an optional *future* argument. If not passed, the "
"current running task will be used."
msgstr ""
"此函式接受一個選擇性的 *future* 引數。如果未傳入,將使用當前執行中的任務。"
#: ../../library/asyncio-graph.rst:34 ../../library/asyncio-graph.rst:93
msgid ""
"If the function is called on *the current task*, the optional keyword-only "
"*depth* argument can be used to skip the specified number of frames from top "
"of the stack."
msgstr ""
"如果在\\ *目前任務*\\ 上呼叫此函式,可以使用選擇性的僅限關鍵字引數 *depth* "
"來跳過堆疊頂端指定數量的幀。"
#: ../../library/asyncio-graph.rst:38
msgid ""
"If the optional keyword-only *limit* argument is provided, each call stack "
"in the resulting graph is truncated to include at most ``abs(limit)`` "
"entries. If *limit* is positive, the entries left are the closest to the "
"invocation point. If *limit* is negative, the topmost entries are left. If "
"*limit* is omitted or ``None``, all entries are present. If *limit* is "
"``0``, the call stack is not printed at all, only \"awaited by\" information "
"is printed."
msgstr ""
"如果提供了選擇性的僅限關鍵字引數 *limit*,結果圖中的每個呼叫堆疊會被截斷"
"為最多包含 ``abs(limit)`` 個條目。如果 *limit* 為正數,保留的條目是最接近呼"
"叫點的。如果 *limit* 為負數,保留最頂層的條目。如果 *limit* 被省略或為 "
"``None``,則顯示所有條目。如果 *limit* 為 ``0``,則完全不印出呼叫堆"
"疊,只印出「awaited by」資訊。"
#: ../../library/asyncio-graph.rst:46
msgid ""
"If *file* is omitted or ``None``, the function will print "
"to :data:`sys.stdout`."
msgstr ""
"如果 *file* 被省略或為 ``None``,此函式將印出到 :data:`sys.stdout`。"
#: ../../library/asyncio-graph.rst:49
msgid "**Example:**"
msgstr "**範例:**"
#: ../../library/asyncio-graph.rst:51
msgid "The following Python code:"
msgstr "以下 Python 程式碼:"
#: ../../library/asyncio-graph.rst:53
msgid ""
"import asyncio\n"
"\n"
"async def test():\n"
" asyncio.print_call_graph()\n"
"\n"
"async def main():\n"
" async with asyncio.TaskGroup() as g:\n"
" g.create_task(test(), name='test')\n"
"\n"
"asyncio.run(main())"
msgstr ""
"import asyncio\n"
"\n"
"async def test():\n"
" asyncio.print_call_graph()\n"
"\n"
"async def main():\n"
" async with asyncio.TaskGroup() as g:\n"
" g.create_task(test(), name='test')\n"
"\n"
"asyncio.run(main())"
#: ../../library/asyncio-graph.rst:66
msgid "will print::"
msgstr "會印出: ::"
#: ../../library/asyncio-graph.rst:68
msgid ""
"* Task(name='test', id=0x1039f0fe0)\n"
"+ Call stack:\n"
"| File 't2.py', line 4, in async test()\n"
"+ Awaited by:\n"
" * Task(name='Task-1', id=0x103a5e060)\n"
" + Call stack:\n"
" | File 'taskgroups.py', line 107, in async TaskGroup.__aexit__()\n"
" | File 't2.py', line 7, in async main()"
msgstr ""
"* Task(name='test', id=0x1039f0fe0)\n"
"+ Call stack:\n"
"| File 't2.py', line 4, in async test()\n"
"+ Awaited by:\n"
" * Task(name='Task-1', id=0x103a5e060)\n"
" + Call stack:\n"
" | File 'taskgroups.py', line 107, in async TaskGroup.__aexit__()\n"
" | File 't2.py', line 7, in async main()"
#: ../../library/asyncio-graph.rst:79
msgid ""
"Like :func:`print_call_graph`, but returns a string. If *future* is ``None`` "
"and there's no current task, the function returns an empty string."
msgstr ""
"類似於 :func:`print_call_graph`,但回傳一個字串。如果 *future* 為 "
"``None`` 且沒有目前任務,此函式回傳一個空字串。"
#: ../../library/asyncio-graph.rst:86
msgid ""
"Capture the async call graph for the current task or the "
"provided :class:`Task` or :class:`Future`."
msgstr ""
"捕獲目前任務或所提供的 :class:`Task` 或 :class:`Future` 的非同步呼叫圖。"
#: ../../library/asyncio-graph.rst:89
msgid ""
"The function receives an optional *future* argument. If not passed, the "
"current running task will be used. If there's no current task, the function "
"returns ``None``."
msgstr ""
"此函式接受一個選擇性的 *future* 引數。如果未傳入,將使用目前執行中的任務。"
"如果沒有目前任務,此函式回傳 ``None``。"
#: ../../library/asyncio-graph.rst:97
msgid "Returns a ``FutureCallGraph`` data class object:"
msgstr "會回傳一個 ``FutureCallGraph`` 資料類別物件:"
#: ../../library/asyncio-graph.rst:99
msgid "``FutureCallGraph(future, call_stack, awaited_by)``"
msgstr "``FutureCallGraph(future, call_stack, awaited_by)``"
#: ../../library/asyncio-graph.rst:101
msgid ""
"Where *future* is a reference to a :class:`Future` or a :class:`Task` (or "
"their subclasses.)"
msgstr ""
"其中 *future* 是對 :class:`Future` 或 :class:`Task`\\ (或它們的子類別)的"
"參照。"
#: ../../library/asyncio-graph.rst:104
msgid "``call_stack`` is a tuple of ``FrameCallGraphEntry`` objects."
msgstr "``call_stack`` 是一個由 ``FrameCallGraphEntry`` 物件組成的元組。"
#: ../../library/asyncio-graph.rst:106
msgid "``awaited_by`` is a tuple of ``FutureCallGraph`` objects."
msgstr "``awaited_by`` 是一個由 ``FutureCallGraph`` 物件組成的元組。"
#: ../../library/asyncio-graph.rst:108
msgid "``FrameCallGraphEntry(frame)``"
msgstr "``FrameCallGraphEntry(frame)``"
#: ../../library/asyncio-graph.rst:110
msgid ""
"Where *frame* is a frame object of a regular Python function in the call "
"stack."
msgstr "其中 *frame* 是呼叫堆疊中常規 Python 函式的幀物件。"
#: ../../library/asyncio-graph.rst:115
msgid "Low level utility functions"
msgstr "低階工具函式"
#: ../../library/asyncio-graph.rst:117
msgid ""
"To introspect an async call graph asyncio requires cooperation from control "
"flow structures, such as :func:`shield` or :class:`TaskGroup`. Any time an "
"intermediate :class:`Future` object with low-level APIs "
"like :meth:`Future.add_done_callback() <asyncio.Future.add_done_callback>` "
"is involved, the following two functions should be used to inform asyncio "
"about how exactly such intermediate future objects are connected with the "
"tasks they wrap or control."
msgstr ""
"要內省非同步呼叫圖,asyncio 需要來自控制流程結構的協作,例如 :func:`shield` "
"或 :class:`TaskGroup`。任何時候涉及使用低階 API(如 :meth:`Future."
"add_done_callback() <asyncio.Future.add_done_callback>`)的中介 :class:"
"`Future` 物件時,應使用以下兩個函式來告知 asyncio 這些中介 future 物件如何"
"與它們所包裝或控制的任務連接。"
#: ../../library/asyncio-graph.rst:128
msgid "Record that *future* is awaited on by *waiter*."
msgstr "記錄 *future* 正被 *waiter* 等待。"
#: ../../library/asyncio-graph.rst:130 ../../library/asyncio-graph.rst:143
msgid ""
"Both *future* and *waiter* must be instances of :class:`Future` "
"or :class:`Task` or their subclasses, otherwise the call would have no "
"effect."
msgstr ""
"*future* 和 *waiter* 都必須是 :class:`Future` 或 :class:`Task` 或它們子類別"
"的實例,否則呼叫將不會產生任何效果。"
#: ../../library/asyncio-graph.rst:134
msgid ""
"A call to ``future_add_to_awaited_by()`` must be followed by an eventual "
"call to the :func:`future_discard_from_awaited_by` function with the same "
"arguments."
msgstr ""
"對 ``future_add_to_awaited_by()`` 的呼叫必須最終跟隨一個對 :func:"
"`future_discard_from_awaited_by` 函式的呼叫,並使用相同的引數。"
#: ../../library/asyncio-graph.rst:141
msgid "Record that *future* is no longer awaited on by *waiter*."
msgstr "記錄 *future* 不再被 *waiter* 等待。"