Skip to content

Translate library/sched.po #894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 39 additions & 12 deletions library/sched.po
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2022, Python Software Foundation
# Copyright (C) 2001-2024, Python Software Foundation
# This file is distributed under the same license as the Python package.
#
# Translators:
# Matt Wang <[email protected]>, 2024
msgid ""
msgstr ""
"Project-Id-Version: Python 3.12\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-09 00:03+0000\n"
"PO-Revision-Date: 2018-05-23 16:09+0000\n"
"Last-Translator: Adrian Liaw <adrianliaw2000@gmail.com>\n"
"PO-Revision-Date: 2024-05-09 16:09+0000\n"
"Last-Translator: Matt Wang <mattwang44@gmail.com>\n"
"Language-Team: Chinese - TAIWAN (https://github.com/python/python-docs-zh-"
"tw)\n"
"Language: zh_TW\n"
Expand All @@ -30,7 +30,7 @@ msgstr "**原始碼:**\\ :source:`Lib/sched.py`"
msgid ""
"The :mod:`sched` module defines a class which implements a general purpose "
"event scheduler:"
msgstr ""
msgstr ":mod:`sched` 模組定義了一個有實作通用事件排程器的類別:"

#: ../../library/sched.rst:20
msgid ""
Expand All @@ -43,27 +43,32 @@ msgid ""
"argument ``0`` after each event is run to allow other threads an opportunity "
"to run in multi-threaded applications."
msgstr ""
":class:`scheduler` 類別定義了事件排程的泛用介面。它需要兩個函式來和「外部世"
"界」作用 —— *timefunc* 應不帶引數地被呼叫,並回傳一個數字(為「時間」,可為任"
"何單位)。*delayfunc* 函式應以一個引數呼叫,並與 *timefunc* 的輸出相容,且應"
"延遲其指定的時間單位。每個事件運行後,也會以引數 ``0`` 呼叫 *delayfunc*,來使"
"得其他執行緒有機會在多執行緒應用程式中運行。"

#: ../../library/sched.rst:29
msgid "*timefunc* and *delayfunc* parameters are optional."
msgstr ""
msgstr "*timefunc* 和 *delayfunc* 參數是可選的。"

#: ../../library/sched.rst:32
msgid ""
":class:`scheduler` class can be safely used in multi-threaded environments."
msgstr ""
msgstr ":class:`scheduler` 類別可以安全地在多執行緒環境中使用。"

#: ../../library/sched.rst:36
msgid "Example::"
msgstr "範例: ::"

#: ../../library/sched.rst:67
msgid "Scheduler Objects"
msgstr ""
msgstr "排程器物件"

#: ../../library/sched.rst:69
msgid ":class:`scheduler` instances have the following methods and attributes:"
msgstr ""
msgstr ":class:`scheduler` 實例具有以下方法和屬性:"

#: ../../library/sched.rst:74
msgid ""
Expand All @@ -72,23 +77,28 @@ msgid ""
"constructor. Events scheduled for the same *time* will be executed in the "
"order of their *priority*. A lower number represents a higher priority."
msgstr ""
"為一個新事件排程。*time* 引數應該是與傳遞給建構函式的 *timefunc* 函式回傳值相"
"容的數字型別。安排在相同 *time* 的事件將按照其 *priority* 的順序執行。數字越"
"小代表優先順序越高。"

#: ../../library/sched.rst:79
msgid ""
"Executing the event means executing ``action(*argument, **kwargs)``. "
"*argument* is a sequence holding the positional arguments for *action*. "
"*kwargs* is a dictionary holding the keyword arguments for *action*."
msgstr ""
"執行事件意味著執行 ``action(*argument, **kwargs)``。*argument* 是一個包含 "
"*action* 之位置引數的序列。*kwargs* 是一個字典,帶有 *action* 的關鍵字引數。"

#: ../../library/sched.rst:83
msgid ""
"Return value is an event which may be used for later cancellation of the "
"event (see :meth:`cancel`)."
msgstr ""
msgstr "回傳值是一個事件,可用於後續取消該事件(請見 :meth:`cancel`)。"

#: ../../library/sched.rst:86 ../../library/sched.rst:99
msgid "*argument* parameter is optional."
msgstr ""
msgstr "*argument* 參數是可選的。"

#: ../../library/sched.rst:89 ../../library/sched.rst:102
msgid "*kwargs* parameter was added."
Expand All @@ -100,30 +110,38 @@ msgid ""
"the other arguments, the effect and the return value are the same as those "
"for :meth:`enterabs`."
msgstr ""
"為一個排程事件延期 *delay* 個時間單位。除了相對時間之外,其他引數、效果和回傳值"
"皆與 :meth:`enterabs` 的相同。"

#: ../../library/sched.rst:107
msgid ""
"Remove the event from the queue. If *event* is not an event currently in the "
"queue, this method will raise a :exc:`ValueError`."
msgstr ""
"從佇列中刪除該事件。如果 *event* 不是目前佇列中的事件,此方法將引發 :exc:"
"`ValueError`。"

#: ../../library/sched.rst:113
msgid "Return ``True`` if the event queue is empty."
msgstr ""
msgstr "如果事件佇列為空,則回傳 ``True``。"

#: ../../library/sched.rst:118
msgid ""
"Run all scheduled events. This method will wait (using the *delayfunc* "
"function passed to the constructor) for the next event, then execute it and "
"so on until there are no more scheduled events."
msgstr ""
"運行所有已排程的事件。此方法將會等待(使用傳遞給建構函式的 *delayfunc* 函式)"
"下一個事件,然後執行它,並依此類推,直到不再有排程好的事件。"

#: ../../library/sched.rst:122
msgid ""
"If *blocking* is false executes the scheduled events due to expire soonest "
"(if any) and then return the deadline of the next scheduled call in the "
"scheduler (if any)."
msgstr ""
"如果 *blocking* 為 false,則執行最快到期的已排程事件(如存在),然後回傳排程"
"器中下一個排程呼叫(如存在)的截止時間。"

#: ../../library/sched.rst:126
msgid ""
Expand All @@ -132,6 +150,9 @@ msgid ""
"an exception is raised by *action*, the event will not be attempted in "
"future calls to :meth:`run`."
msgstr ""
"*action* 或 *delayfunc* 都可能引發例外。無論哪種情況,排程器都將保持一致的狀"
"態並傳遞例外。如果是由 *action* 引發例外,則後續呼叫 :meth:`run` 時將不會嘗試"
"運行該事件。"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

這邊這句 the event will not be attempted in future calls to :meth:run
我看不太出來他是連傳都不會傳 還是是傳了但不會運行
如果沒想法就維持這個翻譯吧(畢竟原文就沒寫清楚)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

實測發現還是會嘗試運行 🤔
anyway 可能我會錯意,還是先維持這個翻譯好了
image


#: ../../library/sched.rst:131
msgid ""
Expand All @@ -140,6 +161,9 @@ msgid ""
"dropped; the calling code is responsible for canceling events which are no "
"longer pertinent."
msgstr ""
"如果一系列事件的運行時長比執行下一個事件前的可用時長 (available time) 更長,"
"那麼排程器就單純會落後。不會有事件被丟棄;呼叫程式碼也要負責取消不再相關的事"
"件。"

#: ../../library/sched.rst:136
msgid "*blocking* parameter was added."
Expand All @@ -151,6 +175,9 @@ msgid ""
"will be run. Each event is shown as a :term:`named tuple` with the "
"following fields: time, priority, action, argument, kwargs."
msgstr ""
"會按事件運行順序回傳即將發生的事件串列的唯讀屬性。每個事件都以\\ :term:`附名"
"元組 (named tuple) <named tuple>` 表示,並包含以下欄位:時間、優先順序、動作 "
"(action)、引數、kwargs。"

#: ../../library/sched.rst:11
msgid "event scheduling"
Expand Down
Loading