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,27 +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
63
msgstr "範例: ::"
59
64
60
65
#: ../../library/sched.rst:67
61
66
msgid "Scheduler Objects"
62
- msgstr ""
67
+ msgstr "排程器物件 "
63
68
64
69
#: ../../library/sched.rst:69
65
70
msgid ":class:`scheduler` instances have the following methods and attributes:"
66
- msgstr ""
71
+ msgstr ":class:`scheduler` 實例具有以下方法和屬性: "
67
72
68
73
#: ../../library/sched.rst:74
69
74
msgid ""
@@ -72,23 +77,28 @@ msgid ""
72
77
"constructor. Events scheduled for the same *time* will be executed in the "
73
78
"order of their *priority*. A lower number represents a higher priority."
74
79
msgstr ""
80
+ "為一個新事件排程。*time* 引數應該是與傳遞給建構函式的 *timefunc* 函式回傳值相"
81
+ "容的數字型別。安排在相同 *time* 的事件將按照其 *priority* 的順序執行。數字越"
82
+ "小代表優先順序越高。"
75
83
76
84
#: ../../library/sched.rst:79
77
85
msgid ""
78
86
"Executing the event means executing ``action(*argument, **kwargs)``. "
79
87
"*argument* is a sequence holding the positional arguments for *action*. "
80
88
"*kwargs* is a dictionary holding the keyword arguments for *action*."
81
89
msgstr ""
90
+ "執行事件意味著執行 ``action(*argument, **kwargs)``。*argument* 是一個包含 "
91
+ "*action* 之位置引數的序列。*kwargs* 是一個字典,帶有 *action* 的關鍵字引數。"
82
92
83
93
#: ../../library/sched.rst:83
84
94
msgid ""
85
95
"Return value is an event which may be used for later cancellation of the "
86
96
"event (see :meth:`cancel`)."
87
- msgstr ""
97
+ msgstr "回傳值是一個事件,可用於後續取消該事件(請見 :meth:`cancel`)。 "
88
98
89
99
#: ../../library/sched.rst:86 ../../library/sched.rst:99
90
100
msgid "*argument* parameter is optional."
91
- msgstr ""
101
+ msgstr "*argument* 參數是可選的。 "
92
102
93
103
#: ../../library/sched.rst:89 ../../library/sched.rst:102
94
104
msgid "*kwargs* parameter was added."
@@ -100,30 +110,38 @@ msgid ""
100
110
"the other arguments, the effect and the return value are the same as those "
101
111
"for :meth:`enterabs`."
102
112
msgstr ""
113
+ "為一個排程事件延期 *delay* 個時間單位。除了相對時間之外,其他引數、效果和回傳值"
114
+ "皆與 :meth:`enterabs` 的相同。"
103
115
104
116
#: ../../library/sched.rst:107
105
117
msgid ""
106
118
"Remove the event from the queue. If *event* is not an event currently in the "
107
119
"queue, this method will raise a :exc:`ValueError`."
108
120
msgstr ""
121
+ "從佇列中刪除該事件。如果 *event* 不是目前佇列中的事件,此方法將引發 :exc:"
122
+ "`ValueError`。"
109
123
110
124
#: ../../library/sched.rst:113
111
125
msgid "Return ``True`` if the event queue is empty."
112
- msgstr ""
126
+ msgstr "如果事件佇列為空,則回傳 ``True``。 "
113
127
114
128
#: ../../library/sched.rst:118
115
129
msgid ""
116
130
"Run all scheduled events. This method will wait (using the *delayfunc* "
117
131
"function passed to the constructor) for the next event, then execute it and "
118
132
"so on until there are no more scheduled events."
119
133
msgstr ""
134
+ "運行所有已排程的事件。此方法將會等待(使用傳遞給建構函式的 *delayfunc* 函式)"
135
+ "下一個事件,然後執行它,並依此類推,直到不再有排程好的事件。"
120
136
121
137
#: ../../library/sched.rst:122
122
138
msgid ""
123
139
"If *blocking* is false executes the scheduled events due to expire soonest "
124
140
"(if any) and then return the deadline of the next scheduled call in the "
125
141
"scheduler (if any)."
126
142
msgstr ""
143
+ "如果 *blocking* 為 false,則執行最快到期的已排程事件(如存在),然後回傳排程"
144
+ "器中下一個排程呼叫(如存在)的截止時間。"
127
145
128
146
#: ../../library/sched.rst:126
129
147
msgid ""
@@ -132,6 +150,9 @@ msgid ""
132
150
"an exception is raised by *action*, the event will not be attempted in "
133
151
"future calls to :meth:`run`."
134
152
msgstr ""
153
+ "*action* 或 *delayfunc* 都可能引發例外。無論哪種情況,排程器都將保持一致的狀"
154
+ "態並傳遞例外。如果是由 *action* 引發例外,則後續呼叫 :meth:`run` 時將不會嘗試"
155
+ "運行該事件。"
135
156
136
157
#: ../../library/sched.rst:131
137
158
msgid ""
@@ -140,6 +161,9 @@ msgid ""
140
161
"dropped; the calling code is responsible for canceling events which are no "
141
162
"longer pertinent."
142
163
msgstr ""
164
+ "如果一系列事件的運行時長比執行下一個事件前的可用時長 (available time) 更長,"
165
+ "那麼排程器就單純會落後。不會有事件被丟棄;呼叫程式碼也要負責取消不再相關的事"
166
+ "件。"
143
167
144
168
#: ../../library/sched.rst:136
145
169
msgid "*blocking* parameter was added."
@@ -151,6 +175,9 @@ msgid ""
151
175
"will be run. Each event is shown as a :term:`named tuple` with the "
152
176
"following fields: time, priority, action, argument, kwargs."
153
177
msgstr ""
178
+ "會按事件運行順序回傳即將發生的事件串列的唯讀屬性。每個事件都以\\ :term:`附名"
179
+ "元組 (named tuple) <named tuple>` 表示,並包含以下欄位:時間、優先順序、動作 "
180
+ "(action)、引數、kwargs。"
154
181
155
182
#: ../../library/sched.rst:11
156
183
msgid "event scheduling"
0 commit comments