Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64f8366

Browse files
authored
Translate library/trace.po (#1052)
1 parentf8ef476 commit64f8366

File tree

1 file changed

+87
-21
lines changed

1 file changed

+87
-21
lines changed

‎library/trace.po

Lines changed: 87 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
# This file is distributed under the same license as the Python package.
44
#
55
# Translators:
6+
# Adrian Liaw <adrianliaw2000@gmail.com>, 2018
7+
# Dr-XYZ <dr.xyz.tw@gmail.com>, 2025
68
msgid ""
79
msgstr ""
810
"Project-Id-Version:Python 3.13\n"
911
"Report-Msgid-Bugs-To:\n"
1012
"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"
1315
"Language-Team:Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
1416
"tw)\n"
1517
"Language:zh_TW\n"
@@ -33,6 +35,9 @@ msgid ""
3335
"list functions executed during a program run. It can be used in another "
3436
"program or from the command line."
3537
msgstr""
38+
":mod:`trace` 模組可用來追蹤程式執行過程、產生帶註解的陳述式涵蓋範圍清單、輸出"
39+
"呼叫者/被呼叫者的關係,以及在程式執行期間被執行的函式串列。它可以在其他程式"
40+
"中使用,也可以從命令列啟動。"
3641

3742
#:../../library/trace.rst:18
3843
msgid"`Coverage.py <https://coverage.readthedocs.io/>`_"
@@ -42,17 +47,17 @@ msgstr "`Coverage.py <https://coverage.readthedocs.io/>`_"
4247
msgid""
4348
"A popular third-party coverage tool that provides HTML output along with "
4449
"advanced features such as branch coverage."
45-
msgstr""
50+
msgstr"一款受歡迎的第三方涵蓋範圍工具,提供 HTML 輸出與分支涵蓋等進階功能。"
4651

4752
#:../../library/trace.rst:25
4853
msgid"Command-Line Usage"
49-
msgstr""
54+
msgstr"命令列用法"
5055

5156
#:../../library/trace.rst:27
5257
msgid""
5358
"The :mod:`trace` module can be invoked from the command line. It can be as "
5459
"simple as ::"
55-
msgstr""
60+
msgstr":mod:`trace` 模組可從命令列執行,用法可以非常簡單,如:::"
5661

5762
#:../../library/trace.rst:30
5863
msgid"python -m trace --count -C . somefile.py ..."
@@ -64,22 +69,24 @@ msgid ""
6469
"of all Python modules imported during the execution into the current "
6570
"directory."
6671
msgstr""
72+
"上述命令會執行 :file:`somefile.py`,並將產生執行期間所引入的所有 Python 模組"
73+
"的帶註解串列,輸出至目前目錄。"
6774

6875
#:../../library/trace.rst:39
6976
msgid"Display usage and exit."
70-
msgstr""
77+
msgstr"顯示用法並結束程式。"
7178

7279
#:../../library/trace.rst:43
7380
msgid"Display the version of the module and exit."
74-
msgstr""
81+
msgstr"顯示模組版本並結束程式。"
7582

7683
#:../../library/trace.rst:45
7784
msgid"Added ``--module`` option that allows to run an executable module."
78-
msgstr""
85+
msgstr"新增 ``--module`` 選項,允許執行可執行模組。"
7986

8087
#:../../library/trace.rst:49
8188
msgid"Main options"
82-
msgstr""
89+
msgstr"主要選項"
8390

8491
#:../../library/trace.rst:51
8592
msgid""
@@ -89,97 +96,117 @@ msgid ""
8996
"`--listfuncs <-l>` is provided, neither :option:`--count <-c>` nor :option:"
9097
"`--trace <-t>` are accepted, and vice versa."
9198
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>`,反之亦然。"
92103

93104
#:../../library/trace.rst:61
94105
msgid""
95106
"Produce a set of annotated listing files upon program completion that shows "
96107
"how many times each statement was executed. See also :option:`--coverdir <-"
97108
"C>`, :option:`--file <-f>` and :option:`--no-report <-R>` below."
98109
msgstr""
110+
"在程式執行結束時產生一組帶註解串列檔案,顯示每個陳述式被執行的次數。參見下方"
111+
"的 :option:`--coverdir <-C>`、:option:`--file <-f>` 及 :option:`--no-report "
112+
"<-R>`。"
99113

100114
#:../../library/trace.rst:68
101115
msgid"Display lines as they are executed."
102-
msgstr""
116+
msgstr"執行時即時顯示每一行。"
103117

104118
#:../../library/trace.rst:72
105119
msgid"Display the functions executed by running the program."
106-
msgstr""
120+
msgstr"顯示程式執行過程中被呼叫的函式。"
107121

108122
#:../../library/trace.rst:76
109123
msgid""
110124
"Produce an annotated list from an earlier program run that used the :option:"
111125
"`--count <-c>` and :option:`--file <-f>` option. This does not execute any "
112126
"code."
113127
msgstr""
128+
"從先前使用 :option:`--count <-c>` 與 :option:`--file <-f>` 選項執行過的程式生"
129+
"成帶註解的串列,不會執行任何程式碼。"
114130

115131
#:../../library/trace.rst:82
116132
msgid"Display the calling relationships exposed by running the program."
117-
msgstr""
133+
msgstr"顯示程式執行時產生的呼叫關係。"
118134

119135
#:../../library/trace.rst:85
120136
msgid"Modifiers"
121-
msgstr""
137+
msgstr"修飾子(Modifier)"
122138

123139
#:../../library/trace.rst:91
124140
msgid""
125141
"Name of a file to accumulate counts over several tracing runs. Should be "
126142
"used with the :option:`--count <-c>` option."
127143
msgstr""
144+
"指定用來累積多次追蹤結果的檔案之名稱。應與 :option:`--count <-c>` 選項搭配使"
145+
"用。"
128146

129147
#:../../library/trace.rst:96
130148
msgid""
131149
"Directory where the report files go. The coverage report for ``package."
132150
"module`` is written to file :file:`{dir}/{package}/{module}.cover`."
133151
msgstr""
152+
"報告檔案的輸出目錄。``package.module`` 的涵蓋範圍報告將寫入檔案::file:"
153+
"`{dir}/{package}/{module}.cover`。"
134154

135155
#:../../library/trace.rst:101
136156
msgid""
137157
"When generating annotated listings, mark lines which were not executed with "
138158
"``>>>>>>``."
139-
msgstr""
159+
msgstr"在產生帶註解的串列時,使用 ``>>>>>>`` 標記未被執行的程式碼行。"
140160

141161
#:../../library/trace.rst:106
142162
msgid""
143163
"When using :option:`--count <-c>` or :option:`--report <-r>`, write a brief "
144164
"summary to stdout for each file processed."
145165
msgstr""
166+
"使用 :option:`--count <-c>` 或 :option:`--report <-r>` 時,會將每個處理過的檔"
167+
"案摘要輸出至 stdout。"
146168

147169
#:../../library/trace.rst:111
148170
msgid""
149171
"Do not generate annotated listings. This is useful if you intend to make "
150172
"several runs with :option:`--count <-c>`, and then produce a single set of "
151173
"annotated listings at the end."
152174
msgstr""
175+
"不產生帶註解的串列。若你打算多次使用 :option:`--count <-c>` 執行程式,並在最"
176+
"後再統一產生串列,這會很有幫助。"
153177

154178
#:../../library/trace.rst:117
155179
msgid""
156180
"Prefix each line with the time since the program started. Only used while "
157181
"tracing."
158-
msgstr""
182+
msgstr"在每一行前加上自程式啟動以來的經過時間。僅在追蹤時使用。"
159183

160184
#:../../library/trace.rst:121
161185
msgid"Filters"
162-
msgstr""
186+
msgstr"篩選子(Filter)"
163187

164188
#:../../library/trace.rst:123
165189
msgid"These options may be repeated multiple times."
166-
msgstr""
190+
msgstr"這些選項可以重複使用多次。"
167191

168192
#:../../library/trace.rst:129
169193
msgid""
170194
"Ignore each of the given module names and its submodules (if it is a "
171195
"package). The argument can be a list of names separated by a comma."
172196
msgstr""
197+
"忽略所指定的模組名稱及其子模組(若為套件)。引數可以是以逗號分隔的名稱串列。"
173198

174199
#:../../library/trace.rst:134
175200
msgid""
176201
"Ignore all modules and packages in the named directory and subdirectories. "
177202
"The argument can be a list of directories separated by :data:`os.pathsep`."
178203
msgstr""
204+
"忽略指定目錄及其子目錄中的所有模組與套件。引數可以是以 :data:`os.pathsep` 分"
205+
"隔的目錄串列。"
179206

180207
#:../../library/trace.rst:140
181208
msgid"Programmatic Interface"
182-
msgstr""
209+
msgstr"程式介面"
183210

184211
#:../../library/trace.rst:145
185212
msgid""
@@ -194,43 +221,60 @@ msgid ""
194221
"count information. *timing* enables a timestamp relative to when tracing "
195222
"was started to be displayed."
196223
msgstr""
224+
"建立一個物件以追蹤單一陳述式或運算式的執行。所有參數皆為可選的。*count* 啟用"
225+
"行數統計,*trace* 啟用逐行追蹤執行,*countfuncs* 可列出執行期間呼叫的函式,"
226+
"*countcallers* 追蹤呼叫關係,*ignoremods* 是要忽略的模組或套件名稱串列,"
227+
"*ignoredirs* 是其模組或套件應被忽略的目錄串列,*infile* 是讀取儲存計數資料的"
228+
"檔案名稱,*outfile* 是要寫入更新後計數資料的檔案名稱,*timing* 則會顯示自開始"
229+
"追蹤以來的時間戳記。"
197230

198231
#:../../library/trace.rst:158
199232
msgid""
200233
"Execute the command and gather statistics from the execution with the "
201234
"current tracing parameters. *cmd* must be a string or code object, suitable "
202235
"for passing into :func:`exec`."
203236
msgstr""
237+
"執行命令,並依目前追蹤參數收集執行統計資料。*cmd* 必須是可傳入 :func:`exec` "
238+
"的字串或程式碼物件。"
204239

205240
#:../../library/trace.rst:164
206241
msgid""
207242
"Execute the command and gather statistics from the execution with the "
208243
"current tracing parameters, in the defined global and local environments. "
209244
"If not defined, *globals* and *locals* default to empty dictionaries."
210245
msgstr""
246+
"在指定的全域與區域命名空間中,根據目前的追蹤參數執行命令並收集統計資料。若未"
247+
"指定,*globals* 與 *locals* 預設為空字典。"
211248

212249
#:../../library/trace.rst:171
213250
msgid""
214251
"Call *func* with the given arguments under control of the :class:`Trace` "
215252
"object with the current tracing parameters."
216253
msgstr""
254+
"在目前的追蹤參數下,使用 :class:`Trace` 物件控制呼叫 *func*,並傳入指定的引"
255+
"數。"
217256

218257
#:../../library/trace.rst:176
219258
msgid""
220259
"Return a :class:`CoverageResults` object that contains the cumulative "
221260
"results of all previous calls to ``run``, ``runctx`` and ``runfunc`` for the "
222261
"given :class:`Trace` instance. Does not reset the accumulated trace results."
223262
msgstr""
263+
"回傳一個 :class:`CoverageResults` 物件,包含指定 :class:`Trace` 實例中所有先"
264+
"前對 ``run``、``runctx`` 與 ``runfunc`` 呼叫的累積結果。不會重設累積的追蹤結"
265+
"果。"
224266

225267
#:../../library/trace.rst:183
226268
msgid""
227269
"A container for coverage results, created by :meth:`Trace.results`. Should "
228270
"not be created directly by the user."
229271
msgstr""
272+
"一個用來儲存涵蓋範圍結果的容器,由 :meth:`Trace.results` 建立。不應由使用者直"
273+
"接建立。"
230274

231275
#:../../library/trace.rst:188
232276
msgid"Merge in data from another :class:`CoverageResults` object."
233-
msgstr""
277+
msgstr"合併來自另一個 :class:`CoverageResults` 物件的資料。"
234278

235279
#:../../library/trace.rst:193
236280
msgid""
@@ -240,21 +284,27 @@ msgid ""
240284
"be output. If ``None``, the results for each source file are placed in its "
241285
"directory."
242286
msgstr""
287+
"寫入涵蓋範圍結果。將 *show_missing* 設為真可顯示未被執行的程式碼行;將 "
288+
"*summary* 設為真則會在輸出中加入每個模組的涵蓋範圍摘要。*coverdir* 指定輸出涵"
289+
"蓋範圍結果檔案的目錄,若為 ``None``,則每個原始檔案的結果會輸出至其所在目錄"
290+
"中。"
243291

244292
#:../../library/trace.rst:199
245293
msgid""
246294
"If *ignore_missing_files* is ``True``, coverage counts for files that no "
247295
"longer exist are silently ignored. Otherwise, a missing file will raise a :"
248296
"exc:`FileNotFoundError`."
249297
msgstr""
298+
"若 *ignore_missing_files* 為 ``True``,則會忽略那些已不存在的檔案的涵蓋範圍資"
299+
"料,不會顯示任何錯誤。否則,缺少的檔案將會引發 :exc:`FileNotFoundError`。"
250300

251301
#:../../library/trace.rst:203
252302
msgid"Added *ignore_missing_files* parameter."
253-
msgstr""
303+
msgstr"新增 *ignore_missing_files* 參數。"
254304

255305
#:../../library/trace.rst:206
256306
msgid"A simple example demonstrating the use of the programmatic interface::"
257-
msgstr""
307+
msgstr"以下是一個簡單範例,展示如何使用程式介面:"
258308

259309
#:../../library/trace.rst:208
260310
msgid""
@@ -275,3 +325,19 @@ msgid ""
275325
"r = tracer.results()\n"
276326
"r.write_results(show_missing=True, coverdir=\".\")"
277327
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=\".\")"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp