3
3
# This file is distributed under the same license as the Python package.
4
4
#
5
5
# Translators:
6
+ # Adrian Liaw <adrianliaw2000@gmail.com>, 2018
7
+ # Dr-XYZ <dr.xyz.tw@gmail.com>, 2025
6
8
msgid ""
7
9
msgstr ""
8
10
"Project-Id-Version :Python 3.13\n "
9
11
"Report-Msgid-Bugs-To :\n "
10
12
"POT-Creation-Date :2024-09-23 07:52+0800\n "
11
- "PO-Revision-Date :2018 -05-23 16:13+0000 \n "
12
- "Last-Translator :Adrian Liaw <adrianliaw2000 @gmail.com>\n "
13
+ "PO-Revision-Date :2025 -05-28 14:00+0800 \n "
14
+ "Last-Translator :Dr-XYZ <dr.xyz.tw @gmail.com>\n "
13
15
"Language-Team :Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
16
"tw)\n "
15
17
"Language :zh_TW\n "
@@ -33,6 +35,9 @@ msgid ""
33
35
"list functions executed during a program run. It can be used in another "
34
36
"program or from the command line."
35
37
msgstr ""
38
+ ":mod:`trace` 模組可用來追蹤程式執行過程、產生帶註解的陳述式涵蓋範圍清單、輸出"
39
+ "呼叫者/被呼叫者的關係,以及在程式執行期間被執行的函式串列。它可以在其他程式"
40
+ "中使用,也可以從命令列啟動。"
36
41
37
42
#: ../../library/trace.rst:18
38
43
msgid "`Coverage.py <https://coverage.readthedocs.io/>`_"
@@ -42,17 +47,17 @@ msgstr "`Coverage.py <https://coverage.readthedocs.io/>`_"
42
47
msgid ""
43
48
"A popular third-party coverage tool that provides HTML output along with "
44
49
"advanced features such as branch coverage."
45
- msgstr ""
50
+ msgstr "一款受歡迎的第三方涵蓋範圍工具,提供 HTML 輸出與分支涵蓋等進階功能。 "
46
51
47
52
#: ../../library/trace.rst:25
48
53
msgid "Command-Line Usage"
49
- msgstr ""
54
+ msgstr "命令列用法 "
50
55
51
56
#: ../../library/trace.rst:27
52
57
msgid ""
53
58
"The :mod:`trace` module can be invoked from the command line. It can be as "
54
59
"simple as ::"
55
- msgstr ""
60
+ msgstr ":mod:`trace` 模組可從命令列執行,用法可以非常簡單,如::: "
56
61
57
62
#: ../../library/trace.rst:30
58
63
msgid "python -m trace --count -C . somefile.py ..."
@@ -64,22 +69,24 @@ msgid ""
64
69
"of all Python modules imported during the execution into the current "
65
70
"directory."
66
71
msgstr ""
72
+ "上述命令會執行 :file:`somefile.py`,並將產生執行期間所引入的所有 Python 模組"
73
+ "的帶註解串列,輸出至目前目錄。"
67
74
68
75
#: ../../library/trace.rst:39
69
76
msgid "Display usage and exit."
70
- msgstr ""
77
+ msgstr "顯示用法並結束程式。 "
71
78
72
79
#: ../../library/trace.rst:43
73
80
msgid "Display the version of the module and exit."
74
- msgstr ""
81
+ msgstr "顯示模組版本並結束程式。 "
75
82
76
83
#: ../../library/trace.rst:45
77
84
msgid "Added ``--module`` option that allows to run an executable module."
78
- msgstr ""
85
+ msgstr "新增 ``--module`` 選項,允許執行可執行模組。 "
79
86
80
87
#: ../../library/trace.rst:49
81
88
msgid "Main options"
82
- msgstr ""
89
+ msgstr "主要選項 "
83
90
84
91
#: ../../library/trace.rst:51
85
92
msgid ""
@@ -89,97 +96,117 @@ msgid ""
89
96
"`--listfuncs <-l>` is provided, neither :option:`--count <-c>` nor :option:"
90
97
"`--trace <-t>` are accepted, and vice versa."
91
98
msgstr ""
99
+ "執行 :mod:`trace` 時,至少必須指定以下選項之一。:option:`--listfuncs <-l>` 選"
100
+ "項與 :option:`--trace <-t>` 及 :option:`--count <-c>` 選項互斥。當提供 :"
101
+ "option:`--listfuncs <-l>` 時,將不接受 :option:`--count <-c>` 或 :option:`--"
102
+ "trace <-t>`,反之亦然。"
92
103
93
104
#: ../../library/trace.rst:61
94
105
msgid ""
95
106
"Produce a set of annotated listing files upon program completion that shows "
96
107
"how many times each statement was executed. See also :option:`--coverdir <-"
97
108
"C>`, :option:`--file <-f>` and :option:`--no-report <-R>` below."
98
109
msgstr ""
110
+ "在程式執行結束時產生一組帶註解串列檔案,顯示每個陳述式被執行的次數。參見下方"
111
+ "的 :option:`--coverdir <-C>`、:option:`--file <-f>` 及 :option:`--no-report "
112
+ "<-R>`。"
99
113
100
114
#: ../../library/trace.rst:68
101
115
msgid "Display lines as they are executed."
102
- msgstr ""
116
+ msgstr "執行時即時顯示每一行。 "
103
117
104
118
#: ../../library/trace.rst:72
105
119
msgid "Display the functions executed by running the program."
106
- msgstr ""
120
+ msgstr "顯示程式執行過程中被呼叫的函式。 "
107
121
108
122
#: ../../library/trace.rst:76
109
123
msgid ""
110
124
"Produce an annotated list from an earlier program run that used the :option:"
111
125
"`--count <-c>` and :option:`--file <-f>` option. This does not execute any "
112
126
"code."
113
127
msgstr ""
128
+ "從先前使用 :option:`--count <-c>` 與 :option:`--file <-f>` 選項執行過的程式生"
129
+ "成帶註解的串列,不會執行任何程式碼。"
114
130
115
131
#: ../../library/trace.rst:82
116
132
msgid "Display the calling relationships exposed by running the program."
117
- msgstr ""
133
+ msgstr "顯示程式執行時產生的呼叫關係。 "
118
134
119
135
#: ../../library/trace.rst:85
120
136
msgid "Modifiers"
121
- msgstr ""
137
+ msgstr "修飾子(Modifier) "
122
138
123
139
#: ../../library/trace.rst:91
124
140
msgid ""
125
141
"Name of a file to accumulate counts over several tracing runs. Should be "
126
142
"used with the :option:`--count <-c>` option."
127
143
msgstr ""
144
+ "指定用來累積多次追蹤結果的檔案之名稱。應與 :option:`--count <-c>` 選項搭配使"
145
+ "用。"
128
146
129
147
#: ../../library/trace.rst:96
130
148
msgid ""
131
149
"Directory where the report files go. The coverage report for ``package."
132
150
"module`` is written to file :file:`{dir}/{package}/{module}.cover`."
133
151
msgstr ""
152
+ "報告檔案的輸出目錄。``package.module`` 的涵蓋範圍報告將寫入檔案::file:"
153
+ "`{dir}/{package}/{module}.cover`。"
134
154
135
155
#: ../../library/trace.rst:101
136
156
msgid ""
137
157
"When generating annotated listings, mark lines which were not executed with "
138
158
"``>>>>>>``."
139
- msgstr ""
159
+ msgstr "在產生帶註解的串列時,使用 ``>>>>>>`` 標記未被執行的程式碼行。 "
140
160
141
161
#: ../../library/trace.rst:106
142
162
msgid ""
143
163
"When using :option:`--count <-c>` or :option:`--report <-r>`, write a brief "
144
164
"summary to stdout for each file processed."
145
165
msgstr ""
166
+ "使用 :option:`--count <-c>` 或 :option:`--report <-r>` 時,會將每個處理過的檔"
167
+ "案摘要輸出至 stdout。"
146
168
147
169
#: ../../library/trace.rst:111
148
170
msgid ""
149
171
"Do not generate annotated listings. This is useful if you intend to make "
150
172
"several runs with :option:`--count <-c>`, and then produce a single set of "
151
173
"annotated listings at the end."
152
174
msgstr ""
175
+ "不產生帶註解的串列。若你打算多次使用 :option:`--count <-c>` 執行程式,並在最"
176
+ "後再統一產生串列,這會很有幫助。"
153
177
154
178
#: ../../library/trace.rst:117
155
179
msgid ""
156
180
"Prefix each line with the time since the program started. Only used while "
157
181
"tracing."
158
- msgstr ""
182
+ msgstr "在每一行前加上自程式啟動以來的經過時間。僅在追蹤時使用。 "
159
183
160
184
#: ../../library/trace.rst:121
161
185
msgid "Filters"
162
- msgstr ""
186
+ msgstr "篩選子(Filter) "
163
187
164
188
#: ../../library/trace.rst:123
165
189
msgid "These options may be repeated multiple times."
166
- msgstr ""
190
+ msgstr "這些選項可以重複使用多次。 "
167
191
168
192
#: ../../library/trace.rst:129
169
193
msgid ""
170
194
"Ignore each of the given module names and its submodules (if it is a "
171
195
"package). The argument can be a list of names separated by a comma."
172
196
msgstr ""
197
+ "忽略所指定的模組名稱及其子模組(若為套件)。引數可以是以逗號分隔的名稱串列。"
173
198
174
199
#: ../../library/trace.rst:134
175
200
msgid ""
176
201
"Ignore all modules and packages in the named directory and subdirectories. "
177
202
"The argument can be a list of directories separated by :data:`os.pathsep`."
178
203
msgstr ""
204
+ "忽略指定目錄及其子目錄中的所有模組與套件。引數可以是以 :data:`os.pathsep` 分"
205
+ "隔的目錄串列。"
179
206
180
207
#: ../../library/trace.rst:140
181
208
msgid "Programmatic Interface"
182
- msgstr ""
209
+ msgstr "程式介面 "
183
210
184
211
#: ../../library/trace.rst:145
185
212
msgid ""
@@ -194,43 +221,60 @@ msgid ""
194
221
"count information. *timing* enables a timestamp relative to when tracing "
195
222
"was started to be displayed."
196
223
msgstr ""
224
+ "建立一個物件以追蹤單一陳述式或運算式的執行。所有參數皆為可選的。*count* 啟用"
225
+ "行數統計,*trace* 啟用逐行追蹤執行,*countfuncs* 可列出執行期間呼叫的函式,"
226
+ "*countcallers* 追蹤呼叫關係,*ignoremods* 是要忽略的模組或套件名稱串列,"
227
+ "*ignoredirs* 是其模組或套件應被忽略的目錄串列,*infile* 是讀取儲存計數資料的"
228
+ "檔案名稱,*outfile* 是要寫入更新後計數資料的檔案名稱,*timing* 則會顯示自開始"
229
+ "追蹤以來的時間戳記。"
197
230
198
231
#: ../../library/trace.rst:158
199
232
msgid ""
200
233
"Execute the command and gather statistics from the execution with the "
201
234
"current tracing parameters. *cmd* must be a string or code object, suitable "
202
235
"for passing into :func:`exec`."
203
236
msgstr ""
237
+ "執行命令,並依目前追蹤參數收集執行統計資料。*cmd* 必須是可傳入 :func:`exec` "
238
+ "的字串或程式碼物件。"
204
239
205
240
#: ../../library/trace.rst:164
206
241
msgid ""
207
242
"Execute the command and gather statistics from the execution with the "
208
243
"current tracing parameters, in the defined global and local environments. "
209
244
"If not defined, *globals* and *locals* default to empty dictionaries."
210
245
msgstr ""
246
+ "在指定的全域與區域命名空間中,根據目前的追蹤參數執行命令並收集統計資料。若未"
247
+ "指定,*globals* 與 *locals* 預設為空字典。"
211
248
212
249
#: ../../library/trace.rst:171
213
250
msgid ""
214
251
"Call *func* with the given arguments under control of the :class:`Trace` "
215
252
"object with the current tracing parameters."
216
253
msgstr ""
254
+ "在目前的追蹤參數下,使用 :class:`Trace` 物件控制呼叫 *func*,並傳入指定的引"
255
+ "數。"
217
256
218
257
#: ../../library/trace.rst:176
219
258
msgid ""
220
259
"Return a :class:`CoverageResults` object that contains the cumulative "
221
260
"results of all previous calls to ``run``, ``runctx`` and ``runfunc`` for the "
222
261
"given :class:`Trace` instance. Does not reset the accumulated trace results."
223
262
msgstr ""
263
+ "回傳一個 :class:`CoverageResults` 物件,包含指定 :class:`Trace` 實例中所有先"
264
+ "前對 ``run``、``runctx`` 與 ``runfunc`` 呼叫的累積結果。不會重設累積的追蹤結"
265
+ "果。"
224
266
225
267
#: ../../library/trace.rst:183
226
268
msgid ""
227
269
"A container for coverage results, created by :meth:`Trace.results`. Should "
228
270
"not be created directly by the user."
229
271
msgstr ""
272
+ "一個用來儲存涵蓋範圍結果的容器,由 :meth:`Trace.results` 建立。不應由使用者直"
273
+ "接建立。"
230
274
231
275
#: ../../library/trace.rst:188
232
276
msgid "Merge in data from another :class:`CoverageResults` object."
233
- msgstr ""
277
+ msgstr "合併來自另一個 :class:`CoverageResults` 物件的資料。 "
234
278
235
279
#: ../../library/trace.rst:193
236
280
msgid ""
@@ -240,21 +284,27 @@ msgid ""
240
284
"be output. If ``None``, the results for each source file are placed in its "
241
285
"directory."
242
286
msgstr ""
287
+ "寫入涵蓋範圍結果。將 *show_missing* 設為真可顯示未被執行的程式碼行;將 "
288
+ "*summary* 設為真則會在輸出中加入每個模組的涵蓋範圍摘要。*coverdir* 指定輸出涵"
289
+ "蓋範圍結果檔案的目錄,若為 ``None``,則每個原始檔案的結果會輸出至其所在目錄"
290
+ "中。"
243
291
244
292
#: ../../library/trace.rst:199
245
293
msgid ""
246
294
"If *ignore_missing_files* is ``True``, coverage counts for files that no "
247
295
"longer exist are silently ignored. Otherwise, a missing file will raise a :"
248
296
"exc:`FileNotFoundError`."
249
297
msgstr ""
298
+ "若 *ignore_missing_files* 為 ``True``,則會忽略那些已不存在的檔案的涵蓋範圍資"
299
+ "料,不會顯示任何錯誤。否則,缺少的檔案將會引發 :exc:`FileNotFoundError`。"
250
300
251
301
#: ../../library/trace.rst:203
252
302
msgid "Added *ignore_missing_files* parameter."
253
- msgstr ""
303
+ msgstr "新增 *ignore_missing_files* 參數。 "
254
304
255
305
#: ../../library/trace.rst:206
256
306
msgid "A simple example demonstrating the use of the programmatic interface::"
257
- msgstr ""
307
+ msgstr "以下是一個簡單範例,展示如何使用程式介面: "
258
308
259
309
#: ../../library/trace.rst:208
260
310
msgid ""
@@ -275,3 +325,19 @@ msgid ""
275
325
"r = tracer.results()\n"
276
326
"r.write_results(show_missing=True, coverdir=\" .\" )"
277
327
msgstr ""
328
+ "import sys\n"
329
+ "import trace\n"
330
+ "\n"
331
+ "# 建立一個 Trace 物件,指定要忽略的目錄,\n"
332
+ "# 並設定是否進行追蹤、行數統計或兩者皆做。\n"
333
+ "tracer = trace.Trace(\n"
334
+ " ignoredirs=[sys.prefix, sys.exec_prefix],\n"
335
+ " trace=0,\n"
336
+ " count=1)\n"
337
+ "\n"
338
+ "# 使用該 tracer 執行新的命令\n"
339
+ "tracer.run('main()')\n"
340
+ "\n"
341
+ "# 建立報告,將輸出放在目前目錄中\n"
342
+ "r = tracer.results()\n"
343
+ "r.write_results(show_missing=True, coverdir=\" .\" )"