1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) 2001-2022, Python Software Foundation
1
+ # Copyright (C) 2001-2024, Python Software Foundation
3
2
# This file is distributed under the same license as the Python package.
4
3
#
5
4
# Translators:
5
+ # Matt Wang <[email protected] >, 2024
6
6
msgid ""
7
7
msgstr ""
8
8
"Project-Id-Version : Python 3.12\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
10
"POT-Creation-Date : 2024-05-09 00:03+0000\n "
11
- "PO-Revision-Date : 2018 -05-23 16:09+0000\n "
12
- "Last-Translator : Adrian Liaw <adrianliaw2000 @gmail.com>\n "
11
+ "PO-Revision-Date : 2024 -05-09 16:09+0000\n "
12
+ "Last-Translator : Matt Wang <mattwang44 @gmail.com>\n "
13
13
"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
14
14
"tw)\n "
15
15
"Language : zh_TW\n "
@@ -30,7 +30,7 @@ msgstr "**原始碼:**\\ :source:`Lib/sched.py`"
30
30
msgid ""
31
31
"The :mod:`sched` module defines a class which implements a general purpose "
32
32
"event scheduler:"
33
- msgstr ""
33
+ msgstr ":mod:`sched` 模組定義了一個有實作通用事件排程器的類別: "
34
34
35
35
#: ../../library/sched.rst:20
36
36
msgid ""
@@ -43,30 +43,32 @@ msgid ""
43
43
"argument ``0`` after each event is run to allow other threads an opportunity "
44
44
"to run in multi-threaded applications."
45
45
msgstr ""
46
+ ":class:`scheduler` 類別定義了事件排程的泛用介面。它需要兩個函式來和「外部世"
47
+ "界」作用 —— *timefunc* 應不帶引數地被呼叫,並回傳一個數字(為「時間」,可為任"
48
+ "何單位)。*delayfunc* 函式應以一個引數呼叫,並與 *timefunc* 的輸出相容,且應"
49
+ "延遲其指定的時間單位。每個事件運行後,也會以引數 ``0`` 呼叫 *delayfunc*,來使"
50
+ "得其他執行緒有機會在多執行緒應用程式中運行。"
46
51
47
52
#: ../../library/sched.rst:29
48
53
msgid "*timefunc* and *delayfunc* parameters are optional."
49
- msgstr ""
54
+ msgstr "*timefunc* 和 *delayfunc* 參數是可選的。 "
50
55
51
56
#: ../../library/sched.rst:32
52
57
msgid ""
53
58
":class:`scheduler` class can be safely used in multi-threaded environments."
54
- msgstr ""
59
+ msgstr ":class:`scheduler` 類別可以安全地在多執行緒環境中使用。 "
55
60
56
61
#: ../../library/sched.rst:36
57
62
msgid "Example::"
58
- msgstr ""
59
- "範例:\n"
60
- "\n"
61
- "::"
63
+ msgstr "範例: ::"
62
64
63
65
#: ../../library/sched.rst:67
64
66
msgid "Scheduler Objects"
65
- msgstr ""
67
+ msgstr "排程器物件 "
66
68
67
69
#: ../../library/sched.rst:69
68
70
msgid ":class:`scheduler` instances have the following methods and attributes:"
69
- msgstr ""
71
+ msgstr ":class:`scheduler` 實例具有以下方法和屬性: "
70
72
71
73
#: ../../library/sched.rst:74
72
74
msgid ""
@@ -75,23 +77,28 @@ msgid ""
75
77
"constructor. Events scheduled for the same *time* will be executed in the "
76
78
"order of their *priority*. A lower number represents a higher priority."
77
79
msgstr ""
80
+ "為一個新事件排程。*time* 引數應該是與傳遞給建構函式的 *timefunc* 函式回傳值相"
81
+ "容的數字型別。安排在相同 *time* 的事件將按照其 *priority* 的順序執行。數字越"
82
+ "小代表優先順序越高。"
78
83
79
84
#: ../../library/sched.rst:79
80
85
msgid ""
81
86
"Executing the event means executing ``action(*argument, **kwargs)``. "
82
87
"*argument* is a sequence holding the positional arguments for *action*. "
83
88
"*kwargs* is a dictionary holding the keyword arguments for *action*."
84
89
msgstr ""
90
+ "執行事件意味著執行 ``action(*argument, **kwargs)``。*argument* 是一個包含 "
91
+ "*action* 之位置引數的序列。*kwargs* 是一個字典,帶有 *action* 的關鍵字引數。"
85
92
86
93
#: ../../library/sched.rst:83
87
94
msgid ""
88
95
"Return value is an event which may be used for later cancellation of the "
89
96
"event (see :meth:`cancel`)."
90
- msgstr ""
97
+ msgstr "回傳值是一個事件,可用於後續取消該事件(請見 :meth:`cancel`)。 "
91
98
92
99
#: ../../library/sched.rst:86 ../../library/sched.rst:99
93
100
msgid "*argument* parameter is optional."
94
- msgstr ""
101
+ msgstr "*argument* 參數是可選的。 "
95
102
96
103
#: ../../library/sched.rst:89 ../../library/sched.rst:102
97
104
msgid "*kwargs* parameter was added."
@@ -103,30 +110,38 @@ msgid ""
103
110
"the other arguments, the effect and the return value are the same as those "
104
111
"for :meth:`enterabs`."
105
112
msgstr ""
113
+ "為一個排程事件延期 *delay* 時間單位。除了相對時間之外,其他引數、效果和回傳值"
114
+ "皆與 :meth:`enterabs` 的相同。"
106
115
107
116
#: ../../library/sched.rst:107
108
117
msgid ""
109
118
"Remove the event from the queue. If *event* is not an event currently in the "
110
119
"queue, this method will raise a :exc:`ValueError`."
111
120
msgstr ""
121
+ "從佇列中刪除該事件。如果 *event* 不是目前佇列中的事件,此方法將引發 :exc:"
122
+ "`ValueError`。"
112
123
113
124
#: ../../library/sched.rst:113
114
125
msgid "Return ``True`` if the event queue is empty."
115
- msgstr ""
126
+ msgstr "如果事件佇列為空,則回傳 ``True``。 "
116
127
117
128
#: ../../library/sched.rst:118
118
129
msgid ""
119
130
"Run all scheduled events. This method will wait (using the *delayfunc* "
120
131
"function passed to the constructor) for the next event, then execute it and "
121
132
"so on until there are no more scheduled events."
122
133
msgstr ""
134
+ "運行所有已排程的事件。此方法將會等待(使用傳遞給建構函式的 *delayfunc* 函式)"
135
+ "下一個事件,然後執行它,並依此類推,直到不再有排程好的事件。"
123
136
124
137
#: ../../library/sched.rst:122
125
138
msgid ""
126
139
"If *blocking* is false executes the scheduled events due to expire soonest "
127
140
"(if any) and then return the deadline of the next scheduled call in the "
128
141
"scheduler (if any)."
129
142
msgstr ""
143
+ "如果 *blocking* 為 false,則執行最快到期的已排程事件(如存在),然後回傳排程"
144
+ "器中下一個排程呼叫(如存在)的截止時間。"
130
145
131
146
#: ../../library/sched.rst:126
132
147
msgid ""
@@ -135,6 +150,9 @@ msgid ""
135
150
"an exception is raised by *action*, the event will not be attempted in "
136
151
"future calls to :meth:`run`."
137
152
msgstr ""
153
+ "*action* 或 *delayfunc* 都可能引發例外。無論哪種情況,排程器都將保持一致的狀"
154
+ "態並傳遞例外。如果是由 *action* 引發例外,則後續呼叫 :meth:`run` 時將不會嘗試"
155
+ "運行該事件。"
138
156
139
157
#: ../../library/sched.rst:131
140
158
msgid ""
@@ -143,6 +161,9 @@ msgid ""
143
161
"dropped; the calling code is responsible for canceling events which are no "
144
162
"longer pertinent."
145
163
msgstr ""
164
+ "如果一系列事件的運行時長比執行下一個事件前的可用時長 (available time) 更長,"
165
+ "那麼排程器就單純會落後。不會有事件被丟棄;呼叫程式碼也要負責取消不再相關的事"
166
+ "件。"
146
167
147
168
#: ../../library/sched.rst:136
148
169
msgid "*blocking* parameter was added."
@@ -154,6 +175,9 @@ msgid ""
154
175
"will be run. Each event is shown as a :term:`named tuple` with the "
155
176
"following fields: time, priority, action, argument, kwargs."
156
177
msgstr ""
178
+ "會按事件運行順序回傳即將發生的事件串列的唯讀屬性。每個事件都以\\ :term:`附名"
179
+ "元組 (named tuple) <named tuple>` 表示,並包含以下欄位:時間、優先順序、操"
180
+ "作、引數、kwargs。"
157
181
158
182
#: ../../library/sched.rst:11
159
183
msgid "event scheduling"
0 commit comments