3
3
# This file is distributed under the same license as the Python package.
4
4
#
5
5
# Translators:
6
+ # Dr-XYZ <dr.xyz.tw@gmail.com>, 2025
6
7
msgid ""
7
8
msgstr ""
8
9
"Project-Id-Version : Python 3.13\n "
9
10
"Report-Msgid-Bugs-To : \n "
10
11
"POT-Creation-Date : 2024-09-23 07:52+0800\n "
11
- "PO-Revision-Date : 2018 -05-23 14:40+0000 \n "
12
- "Last-Translator : Adrian Liaw <adrianliaw2000 @gmail.com>\n "
12
+ "PO-Revision-Date : 2025 -05-14 14:32+0800 \n "
13
+ "Last-Translator : Dr-XYZ <dr.xyz.tw @gmail.com>\n "
13
14
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
15
"tw)\n "
15
16
"Language : zh_TW\n "
@@ -33,6 +34,8 @@ msgid ""
33
34
"administrative tools, and prototypes that will later be wrapped in a more "
34
35
"sophisticated interface."
35
36
msgstr ""
37
+ ":class:`Cmd` 類別提供了一個簡單的架構,用於撰寫行導向的命令直譯器。這類直譯器"
38
+ "常用於測試控制工具、管理工具以及日後將包裝於更高階介面的原型中。"
36
39
37
40
#: ../../library/cmd.rst:20
38
41
msgid ""
@@ -42,6 +45,9 @@ msgid ""
42
45
"yourself in order to inherit :class:`Cmd`'s methods and encapsulate action "
43
46
"methods."
44
47
msgstr ""
48
+ ":class:`Cmd` 實例或其子類別實例是一種行導向的直譯器架構。通常沒有必要直接實例"
49
+ "化 :class:`Cmd` 本身;它更適合作為你自定義的直譯器類別的父類別,讓你能繼承 :"
50
+ "class:`Cmd` 的方法,並封裝動作方法。"
45
51
46
52
#: ../../library/cmd.rst:25
47
53
msgid ""
@@ -50,6 +56,9 @@ msgid ""
50
56
"`None` and :mod:`readline` is available, command completion is done "
51
57
"automatically."
52
58
msgstr ""
59
+ "可選引數 *completekey* 是 :mod:`readline` 模組中用於自動完成的按鍵名稱;預設"
60
+ "為 :kbd:`Tab`。若 *completekey* 不為 :const:`None` 且 :mod:`readline` 可用,"
61
+ "則會自動啟用命令自動完成功能。"
53
62
54
63
#: ../../library/cmd.rst:29
55
64
msgid ""
@@ -59,6 +68,10 @@ msgid ""
59
68
"``'tab'``. Note that other values are not treated this way, and might only "
60
69
"work with a specific backend."
61
70
msgstr ""
71
+ "預設值 ``'tab'`` 會被特殊處理,使其在所有的 :data:`readline.backend` 中皆代"
72
+ "表 :kbd:`Tab` 鍵。具體來說,若 :data:`readline.backend` 為 ``editline``,則 "
73
+ "``Cmd`` 會改用 ``'^I'`` 取代 ``'tab'``。請注意,其他值不會有此處理方式,且可"
74
+ "能僅能在特定的後端中適用。"
62
75
63
76
#: ../../library/cmd.rst:36
64
77
msgid ""
@@ -67,38 +80,46 @@ msgid ""
67
80
"and output. If not specified, they will default to :data:`sys.stdin` and :"
68
81
"data:`sys.stdout`."
69
82
msgstr ""
83
+ "可選引數 *stdin* 與 *stdout* 用來指定 Cmd 實例或其子類別實例所使用的輸入與輸"
84
+ "出檔案物件。若未指定,預設為 :data:`sys.stdin` 與 :data:`sys.stdout`。"
70
85
71
86
#: ../../library/cmd.rst:41
72
87
msgid ""
73
88
"If you want a given *stdin* to be used, make sure to set the instance's :"
74
89
"attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be "
75
90
"ignored."
76
91
msgstr ""
92
+ "若你希望使用指定的 *stdin*,請務必將該實例的 :attr:`use_rawinput` 屬性設為 "
93
+ "``False``,否則 *stdin* 會被忽略。"
77
94
78
95
#: ../../library/cmd.rst:45
79
96
msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``."
80
- msgstr ""
97
+ msgstr "對於 ``editline``,``completekey='tab'`` 會被替換為 ``'^I'``。 "
81
98
82
99
#: ../../library/cmd.rst:52
83
100
msgid "Cmd Objects"
84
101
msgstr "Cmd 物件"
85
102
86
103
#: ../../library/cmd.rst:54
87
104
msgid "A :class:`Cmd` instance has the following methods:"
88
- msgstr ""
105
+ msgstr ":class:`Cmd` 實例具有以下方法: "
89
106
90
107
#: ../../library/cmd.rst:59
91
108
msgid ""
92
109
"Repeatedly issue a prompt, accept input, parse an initial prefix off the "
93
110
"received input, and dispatch to action methods, passing them the remainder "
94
111
"of the line as argument."
95
112
msgstr ""
113
+ "重複顯示提示字元、接收輸入、剖析接收到的輸入字串前綴,並派發給動作方法,將其"
114
+ "餘部分作為引數傳遞給它們"
96
115
97
116
#: ../../library/cmd.rst:63
98
117
msgid ""
99
118
"The optional argument is a banner or intro string to be issued before the "
100
119
"first prompt (this overrides the :attr:`intro` class attribute)."
101
120
msgstr ""
121
+ "此可選引數為橫幅或導言字串,會在首次顯示提示字元前輸出(此值會覆寫 :attr:"
122
+ "`intro` 類別屬性)。"
102
123
103
124
#: ../../library/cmd.rst:66
104
125
msgid ""
@@ -108,10 +129,14 @@ msgid ""
108
129
"`Control-F` moves the cursor to the right non-destructively, :kbd:`Control-"
109
130
"B` moves the cursor to the left non-destructively, etc.)."
110
131
msgstr ""
132
+ "如果已載入 :mod:`readline` 模組,輸入行將自動繼承類似 :program:`bash` 的歷史"
133
+ "紀錄編輯功能(例如 :kbd:`Control-P` 可向上捲動至上一個指令,:kbd:`Control-N` "
134
+ "向下捲動至下一個指令,:kbd:`Control-F` 非破壞性地將游標向右移動,:kbd:"
135
+ "`Control-B` 非破壞性地將游標向左移動等)。"
111
136
112
137
#: ../../library/cmd.rst:72
113
138
msgid "An end-of-file on input is passed back as the string ``'EOF'``."
114
- msgstr ""
139
+ msgstr "當輸入為檔案結尾(EOF)時,會傳回字串 ``'EOF'``。 "
115
140
116
141
#: ../../library/cmd.rst:78
117
142
msgid ""
@@ -121,13 +146,19 @@ msgid ""
121
146
"another special case, a line beginning with the character ``'!'`` is "
122
147
"dispatched to the method :meth:`!do_shell` (if such a method is defined)."
123
148
msgstr ""
149
+ "直譯器實例僅當存在 :meth:`!do_foo` 方法時,才會識別命令名稱 ``foo``。作為特殊"
150
+ "情況,以字元 ``'?'`` 開頭的行會被派發至 :meth:`do_help` 方法;另一個特殊情況"
151
+ "是,以字元 ``'!'`` 開頭的行會被派發至 :meth:`!do_shell` 方法(若該方法已定"
152
+ "義)。"
124
153
125
154
#: ../../library/cmd.rst:84
126
155
msgid ""
127
156
"This method will return when the :meth:`postcmd` method returns a true "
128
157
"value. The *stop* argument to :meth:`postcmd` is the return value from the "
129
158
"command's corresponding :meth:`!do_\\ *` method."
130
159
msgstr ""
160
+ "當 :meth:`postcmd` 方法回傳真值時,此方法將會結束。傳遞給 :meth:`postcmd` 的 "
161
+ "*stop* 引數是該命令對應的 :meth:`!do_\\ *` 方法的回傳值。"
131
162
132
163
#: ../../library/cmd.rst:88
133
164
msgid ""
@@ -140,6 +171,11 @@ msgid ""
140
171
"could be used to provide different completion depending upon which position "
141
172
"the argument is in."
142
173
msgstr ""
174
+ "如果啟用了自動完成,命令的自動完成將會自動執行,而命令引數的自動完成則是透過"
175
+ "呼叫 :meth:`!complete_foo` 方法並傳入 *text*、*line*、*begidx* 和 *endidx* 引"
176
+ "數來處理。*text* 是要比對的字串前綴:所有回傳的符合項都必須以此字串開頭。"
177
+ "*line* 是目前的輸入行(前置空白會被移除),*begidx* 和 *endidx* 則分別是前綴"
178
+ "字串的起始與結束索引,可用來根據引數所在的位置提供不同的自動完成結果。"
143
179
144
180
#: ../../library/cmd.rst:99
145
181
msgid ""
@@ -151,6 +187,11 @@ msgid ""
151
187
"help_\\ *` methods or commands that have docstrings), and also lists any "
152
188
"undocumented commands."
153
189
msgstr ""
190
+ "所有 :class:`Cmd` 的子類別都會繼承預先定義的 :meth:`!do_help` 方法。當此方法"
191
+ "接收到引數 ``'bar'`` 時,會呼叫對應的 :meth:`!help_bar` 方法;若該方法不存"
192
+ "在,則會列印 :meth:`!do_bar` 的說明字串(若有的話)。若未提供任何引數,:meth:"
193
+ "`!do_help` 會列出所有可用的說明主題(也就是所有具有對應 :meth:`!help_\\ *` 方"
194
+ "法或有說明字串的命令),並且也會列出所有尚未記錄的命令。"
154
195
155
196
#: ../../library/cmd.rst:110
156
197
msgid ""
0 commit comments