forked from AFPy/python-docs-fr
473 lines
13 KiB
Plaintext
473 lines
13 KiB
Plaintext
# Copyright (C) 2001-2018, Python Software Foundation
|
||
# For licence information, see README file.
|
||
#
|
||
msgid ""
|
||
msgstr ""
|
||
"Project-Id-Version: Python 3\n"
|
||
"Report-Msgid-Bugs-To: \n"
|
||
"POT-Creation-Date: 2022-05-22 23:13+0200\n"
|
||
"PO-Revision-Date: 2018-10-15 00:46+0200\n"
|
||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
|
||
"Language: fr\n"
|
||
"MIME-Version: 1.0\n"
|
||
"Content-Type: text/plain; charset=UTF-8\n"
|
||
"Content-Transfer-Encoding: 8bit\n"
|
||
|
||
#: library/asyncio-sync.rst:7
|
||
#, fuzzy
|
||
msgid "Synchronization Primitives"
|
||
msgstr "Primitives de synchronisation"
|
||
|
||
#: library/asyncio-sync.rst:9
|
||
msgid "**Source code:** :source:`Lib/asyncio/locks.py`"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:13
|
||
msgid ""
|
||
"asyncio synchronization primitives are designed to be similar to those of "
|
||
"the :mod:`threading` module with two important caveats:"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:16
|
||
msgid ""
|
||
"asyncio primitives are not thread-safe, therefore they should not be used "
|
||
"for OS thread synchronization (use :mod:`threading` for that);"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:20
|
||
msgid ""
|
||
"methods of these synchronization primitives do not accept the *timeout* "
|
||
"argument; use the :func:`asyncio.wait_for` function to perform operations "
|
||
"with timeouts."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:24
|
||
msgid "asyncio has the following basic synchronization primitives:"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:26
|
||
msgid ":class:`Lock`"
|
||
msgstr ":class:`Lock`"
|
||
|
||
#: library/asyncio-sync.rst:27
|
||
msgid ":class:`Event`"
|
||
msgstr ":class:`Event`"
|
||
|
||
#: library/asyncio-sync.rst:28
|
||
msgid ":class:`Condition`"
|
||
msgstr ":class:`Condition`"
|
||
|
||
#: library/asyncio-sync.rst:29
|
||
msgid ":class:`Semaphore`"
|
||
msgstr ":class:`Semaphore`"
|
||
|
||
#: library/asyncio-sync.rst:30
|
||
msgid ":class:`BoundedSemaphore`"
|
||
msgstr ":class:`BoundedSemaphore`"
|
||
|
||
#: library/asyncio-sync.rst:31
|
||
#, fuzzy
|
||
msgid ":class:`Barrier`"
|
||
msgstr ":class:`Semaphore`"
|
||
|
||
#: library/asyncio-sync.rst:38
|
||
msgid "Lock"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:42
|
||
msgid "Implements a mutex lock for asyncio tasks. Not thread-safe."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:44
|
||
msgid ""
|
||
"An asyncio lock can be used to guarantee exclusive access to a shared "
|
||
"resource."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:47
|
||
msgid "The preferred way to use a Lock is an :keyword:`async with` statement::"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:199 library/asyncio-sync.rst:298
|
||
msgid "which is equivalent to::"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:112 library/asyncio-sync.rst:286
|
||
#: library/asyncio-sync.rst:341
|
||
#, fuzzy
|
||
msgid "Removed the *loop* parameter."
|
||
msgstr "Le paramètre *loop*."
|
||
|
||
#: library/asyncio-sync.rst:72
|
||
msgid "Acquire the lock."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:74
|
||
msgid ""
|
||
"This method waits until the lock is *unlocked*, sets it to *locked* and "
|
||
"returns ``True``."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:77
|
||
msgid ""
|
||
"When more than one coroutine is blocked in :meth:`acquire` waiting for the "
|
||
"lock to be unlocked, only one coroutine eventually proceeds."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:81
|
||
msgid ""
|
||
"Acquiring a lock is *fair*: the coroutine that proceeds will be the first "
|
||
"coroutine that started waiting on the lock."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:86
|
||
msgid "Release the lock."
|
||
msgstr "Libère un verrou."
|
||
|
||
#: library/asyncio-sync.rst:88
|
||
msgid "When the lock is *locked*, reset it to *unlocked* and return."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:90
|
||
msgid "If the lock is *unlocked*, a :exc:`RuntimeError` is raised."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:94
|
||
msgid "Return ``True`` if the lock is *locked*."
|
||
msgstr "Donne ``True`` si le verrou est verrouillé."
|
||
|
||
#: library/asyncio-sync.rst:98
|
||
msgid "Event"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:102
|
||
msgid "An event object. Not thread-safe."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:104
|
||
msgid ""
|
||
"An asyncio event can be used to notify multiple asyncio tasks that some "
|
||
"event has happened."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:107
|
||
msgid ""
|
||
"An Event object manages an internal flag that can be set to *true* with the :"
|
||
"meth:`~Event.set` method and reset to *false* with the :meth:`clear` "
|
||
"method. The :meth:`~Event.wait` method blocks until the flag is set to "
|
||
"*true*. The flag is set to *false* initially."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:365
|
||
msgid "Example::"
|
||
msgstr "Exemple ::"
|
||
|
||
#: library/asyncio-sync.rst:142
|
||
msgid "Wait until the event is set."
|
||
msgstr "Attend que l'évènement ait une valeur."
|
||
|
||
#: library/asyncio-sync.rst:144
|
||
msgid ""
|
||
"If the event is set, return ``True`` immediately. Otherwise block until "
|
||
"another task calls :meth:`~Event.set`."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:149
|
||
msgid "Set the event."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:151
|
||
msgid "All tasks waiting for event to be set will be immediately awakened."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:156
|
||
msgid "Clear (unset) the event."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:158
|
||
msgid ""
|
||
"Tasks awaiting on :meth:`~Event.wait` will now block until the :meth:`~Event."
|
||
"set` method is called again."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:163
|
||
msgid "Return ``True`` if the event is set."
|
||
msgstr "Renvoie ``True`` si l'évènement a une valeur."
|
||
|
||
#: library/asyncio-sync.rst:167
|
||
msgid "Condition"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:171
|
||
msgid "A Condition object. Not thread-safe."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:173
|
||
msgid ""
|
||
"An asyncio condition primitive can be used by a task to wait for some event "
|
||
"to happen and then get exclusive access to a shared resource."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:177
|
||
msgid ""
|
||
"In essence, a Condition object combines the functionality of an :class:"
|
||
"`Event` and a :class:`Lock`. It is possible to have multiple Condition "
|
||
"objects share one Lock, which allows coordinating exclusive access to a "
|
||
"shared resource between different tasks interested in particular states of "
|
||
"that shared resource."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:183
|
||
msgid ""
|
||
"The optional *lock* argument must be a :class:`Lock` object or ``None``. In "
|
||
"the latter case a new Lock object is created automatically."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:190
|
||
msgid ""
|
||
"The preferred way to use a Condition is an :keyword:`async with` statement::"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:212
|
||
msgid "Acquire the underlying lock."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:214
|
||
msgid ""
|
||
"This method waits until the underlying lock is *unlocked*, sets it to "
|
||
"*locked* and returns ``True``."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:219
|
||
msgid ""
|
||
"Wake up at most *n* tasks (1 by default) waiting on this condition. The "
|
||
"method is no-op if no tasks are waiting."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:237
|
||
msgid ""
|
||
"The lock must be acquired before this method is called and released shortly "
|
||
"after. If called with an *unlocked* lock a :exc:`RuntimeError` error is "
|
||
"raised."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:228
|
||
msgid "Return ``True`` if the underlying lock is acquired."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:232
|
||
msgid "Wake up all tasks waiting on this condition."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:234
|
||
msgid "This method acts like :meth:`notify`, but wakes up all waiting tasks."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:243
|
||
msgid "Release the underlying lock."
|
||
msgstr "Libère le verrou sous-jacent."
|
||
|
||
#: library/asyncio-sync.rst:245
|
||
msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:250
|
||
msgid "Wait until notified."
|
||
msgstr "Attends d'être notifié."
|
||
|
||
#: library/asyncio-sync.rst:252
|
||
msgid ""
|
||
"If the calling task has not acquired the lock when this method is called, a :"
|
||
"exc:`RuntimeError` is raised."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:255
|
||
msgid ""
|
||
"This method releases the underlying lock, and then blocks until it is "
|
||
"awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the "
|
||
"Condition re-acquires its lock and this method returns ``True``."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:262
|
||
msgid "Wait until a predicate becomes *true*."
|
||
msgstr "Attends jusqu'à ce qu'un prédicat devienne vrai."
|
||
|
||
#: library/asyncio-sync.rst:264
|
||
msgid ""
|
||
"The predicate must be a callable which result will be interpreted as a "
|
||
"boolean value. The final value is the return value."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:270
|
||
msgid "Semaphore"
|
||
msgstr "Sémaphore"
|
||
|
||
#: library/asyncio-sync.rst:274
|
||
msgid "A Semaphore object. Not thread-safe."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:276
|
||
msgid ""
|
||
"A semaphore manages an internal counter which is decremented by each :meth:"
|
||
"`acquire` call and incremented by each :meth:`release` call. The counter can "
|
||
"never go below zero; when :meth:`acquire` finds that it is zero, it blocks, "
|
||
"waiting until some task calls :meth:`release`."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:282
|
||
msgid ""
|
||
"The optional *value* argument gives the initial value for the internal "
|
||
"counter (``1`` by default). If the given value is less than ``0`` a :exc:"
|
||
"`ValueError` is raised."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:289
|
||
msgid ""
|
||
"The preferred way to use a Semaphore is an :keyword:`async with` statement::"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:311
|
||
msgid "Acquire a semaphore."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:313
|
||
msgid ""
|
||
"If the internal counter is greater than zero, decrement it by one and return "
|
||
"``True`` immediately. If it is zero, wait until a :meth:`release` is called "
|
||
"and return ``True``."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:319
|
||
msgid "Returns ``True`` if semaphore can not be acquired immediately."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:323
|
||
msgid ""
|
||
"Release a semaphore, incrementing the internal counter by one. Can wake up a "
|
||
"task waiting to acquire the semaphore."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:326
|
||
msgid ""
|
||
"Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more "
|
||
"``release()`` calls than ``acquire()`` calls."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:331
|
||
msgid "BoundedSemaphore"
|
||
msgstr "BoundedSemaphore"
|
||
|
||
#: library/asyncio-sync.rst:335
|
||
msgid "A bounded semaphore object. Not thread-safe."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:337
|
||
msgid ""
|
||
"Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:"
|
||
"`ValueError` in :meth:`~Semaphore.release` if it increases the internal "
|
||
"counter above the initial *value*."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:346
|
||
msgid "Barrier"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:350
|
||
msgid "A barrier object. Not thread-safe."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:352
|
||
msgid ""
|
||
"A barrier is a simple synchronization primitive that allows to block until "
|
||
"*parties* number of tasks are waiting on it. Tasks can wait on the :meth:"
|
||
"`~Barrier.wait` method and would be blocked until the specified number of "
|
||
"tasks end up waiting on :meth:`~Barrier.wait`. At that point all of the "
|
||
"waiting tasks would unblock simultaneously."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:358
|
||
msgid ""
|
||
":keyword:`async with` can be used as an alternative to awaiting on :meth:"
|
||
"`~Barrier.wait`."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:361
|
||
msgid "The barrier can be reused any number of times."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:388
|
||
msgid "Result of this example is::"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:399
|
||
msgid ""
|
||
"Pass the barrier. When all the tasks party to the barrier have called this "
|
||
"function, they are all unblocked simultaneously."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:402
|
||
msgid ""
|
||
"When a waiting or blocked task in the barrier is cancelled, this task exits "
|
||
"the barrier which stays in the same state. If the state of the barrier is "
|
||
"\"filling\", the number of waiting task decreases by 1."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:407
|
||
msgid ""
|
||
"The return value is an integer in the range of 0 to ``parties-1``, different "
|
||
"for each task. This can be used to select a task to do some special "
|
||
"housekeeping, e.g.::"
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:417
|
||
msgid ""
|
||
"This method may raise a :class:`BrokenBarrierError` exception if the barrier "
|
||
"is broken or reset while a task is waiting. It could raise a :exc:"
|
||
"`CancelledError` if a task is cancelled."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:423
|
||
msgid ""
|
||
"Return the barrier to the default, empty state. Any tasks waiting on it "
|
||
"will receive the :class:`BrokenBarrierError` exception."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:426
|
||
msgid ""
|
||
"If a barrier is broken it may be better to just leave it and create a new "
|
||
"one."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:430
|
||
msgid ""
|
||
"Put the barrier into a broken state. This causes any active or future calls "
|
||
"to :meth:`wait` to fail with the :class:`BrokenBarrierError`. Use this for "
|
||
"example if one of the taks needs to abort, to avoid infinite waiting tasks."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:437
|
||
msgid "The number of tasks required to pass the barrier."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:441
|
||
msgid "The number of tasks currently waiting in the barrier while filling."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:445
|
||
msgid "A boolean that is ``True`` if the barrier is in the broken state."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:450
|
||
msgid ""
|
||
"This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:"
|
||
"`Barrier` object is reset or broken."
|
||
msgstr ""
|
||
|
||
#: library/asyncio-sync.rst:458
|
||
msgid ""
|
||
"Acquiring a lock using ``await lock`` or ``yield from lock`` and/or :keyword:"
|
||
"`with` statement (``with await lock``, ``with (yield from lock)``) was "
|
||
"removed. Use ``async with lock`` instead."
|
||
msgstr ""
|