forked from AFPy/python-docs-fr
traduction de library/asyncio* (#151)
Co-authored-by: Christophe Nanteuil <christophe.nanteuil@gmail.com> Reviewed-on: AFPy/python-docs-fr#151 Reviewed-by: Julien Palard <julien@palard.fr> Co-authored-by: Christophe Nanteuil <christophenan@noreply.localhost> Co-committed-by: Christophe Nanteuil <christophenan@noreply.localhost>
This commit is contained in:
parent
ec4c5a06d9
commit
588cd3cc65
|
@ -6,52 +6,63 @@ msgstr ""
|
|||
"Project-Id-Version: Python 3\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
|
||||
"PO-Revision-Date: 2022-05-23 00:51+0200\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"PO-Revision-Date: 2023-06-29 21:12+0200\n"
|
||||
"Last-Translator: Christophe Nanteuil <christophe.nanteuil@gmail.com>\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"
|
||||
"X-Generator: Poedit 3.2.2\n"
|
||||
|
||||
#: library/asyncio-runner.rst:6
|
||||
msgid "Runners"
|
||||
msgstr ""
|
||||
msgstr "Exécuteurs (*runners*)"
|
||||
|
||||
#: library/asyncio-runner.rst:8
|
||||
msgid "**Source code:** :source:`Lib/asyncio/runners.py`"
|
||||
msgstr ""
|
||||
msgstr "**Code source :** :source:`Lib/asyncio/runners.py`"
|
||||
|
||||
#: library/asyncio-runner.rst:11
|
||||
msgid ""
|
||||
"This section outlines high-level asyncio primitives to run asyncio code."
|
||||
msgstr ""
|
||||
"Cette section décrit les primitives *asyncio* de haut niveau pour exécuter "
|
||||
"du code asynchrone."
|
||||
|
||||
#: library/asyncio-runner.rst:13
|
||||
msgid ""
|
||||
"They are built on top of an :ref:`event loop <asyncio-event-loop>` with the "
|
||||
"aim to simplify async code usage for common wide-spread scenarios."
|
||||
msgstr ""
|
||||
"Elles sont construites au-dessus d'une :ref:`boucle d'événements <asyncio-"
|
||||
"event-loop>` dans le but de simplifier l'utilisation du code asynchrone pour "
|
||||
"les scénarios les plus courants."
|
||||
|
||||
#: library/asyncio-runner.rst:23
|
||||
msgid "Running an asyncio Program"
|
||||
msgstr ""
|
||||
msgstr "Exécution d'un programme asynchrone"
|
||||
|
||||
#: library/asyncio-runner.rst:27
|
||||
msgid "Execute the :term:`coroutine` *coro* and return the result."
|
||||
msgstr ""
|
||||
msgstr "Exécute la :term:`coroutine` *coro* et renvoie le résultat."
|
||||
|
||||
#: library/asyncio-runner.rst:29
|
||||
msgid ""
|
||||
"This function runs the passed coroutine, taking care of managing the asyncio "
|
||||
"event loop, *finalizing asynchronous generators*, and closing the threadpool."
|
||||
msgstr ""
|
||||
"Cette fonction exécute la coroutine transmise, en s'occupant de gérer la "
|
||||
"boucle d'événements *asyncio*, de *finaliser les générateurs asynchrones* et "
|
||||
"de terminer correctement les fils d'exécution."
|
||||
|
||||
#: library/asyncio-runner.rst:103
|
||||
msgid ""
|
||||
"This function cannot be called when another asyncio event loop is running in "
|
||||
"the same thread."
|
||||
msgstr ""
|
||||
"Cette fonction ne peut pas être appelée lorsqu'une autre boucle d'événement "
|
||||
"asynchrone est en cours d'exécution dans le même fil d'exécution."
|
||||
|
||||
#: library/asyncio-runner.rst:73
|
||||
msgid ""
|
||||
|
@ -59,6 +70,10 @@ msgid ""
|
|||
"disables debug mode explicitly. ``None`` is used to respect the global :ref:"
|
||||
"`asyncio-debug-mode` settings."
|
||||
msgstr ""
|
||||
"Si *debug* vaut ``True``, la boucle d'événements est exécutée en mode "
|
||||
"débogage. ``False`` désactive explicitement le mode débogage. ``None`` est "
|
||||
"utilisée pour respecter les paramètres globaux définis par :ref:`asyncio-"
|
||||
"debug-mode`."
|
||||
|
||||
#: library/asyncio-runner.rst:40
|
||||
msgid ""
|
||||
|
@ -66,35 +81,46 @@ msgid ""
|
|||
"should be used as a main entry point for asyncio programs, and should "
|
||||
"ideally only be called once."
|
||||
msgstr ""
|
||||
"Cette fonction crée toujours une nouvelle boucle d'événements et la ferme à "
|
||||
"la fin. Elle doit être utilisée comme point d'entrée principal pour les "
|
||||
"programmes asynchrones et ne doit idéalement être appelée qu'une seule fois."
|
||||
|
||||
#: library/asyncio-runner.rst:44
|
||||
msgid "Example::"
|
||||
msgstr ""
|
||||
msgstr "Exemple ::"
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-runner.rst:54
|
||||
msgid "Updated to use :meth:`loop.shutdown_default_executor`."
|
||||
msgstr ""
|
||||
msgstr "mise à jour pour utiliser :meth:`loop.shutdown_default_executor`."
|
||||
|
||||
#: library/asyncio-runner.rst:59
|
||||
msgid ""
|
||||
"*debug* is ``None`` by default to respect the global debug mode settings."
|
||||
msgstr ""
|
||||
"*debug* vaut ``None`` par défaut pour respecter les paramètres du mode de "
|
||||
"débogage global."
|
||||
|
||||
#: library/asyncio-runner.rst:63
|
||||
msgid "Runner context manager"
|
||||
msgstr ""
|
||||
msgstr "Gestionnaire de contexte de l'exécuteur"
|
||||
|
||||
#: library/asyncio-runner.rst:67
|
||||
msgid ""
|
||||
"A context manager that simplifies *multiple* async function calls in the "
|
||||
"same context."
|
||||
msgstr ""
|
||||
"Gestionnaire de contexte englobant *plusieurs* appels de fonctions "
|
||||
"asynchrones dans le même contexte."
|
||||
|
||||
#: library/asyncio-runner.rst:70
|
||||
msgid ""
|
||||
"Sometimes several top-level async functions should be called in the same :"
|
||||
"ref:`event loop <asyncio-event-loop>` and :class:`contextvars.Context`."
|
||||
msgstr ""
|
||||
"Parfois, plusieurs fonctions asynchrones de niveau supérieur doivent être "
|
||||
"appelées dans la même :ref:`boucle d'événements <asyncio-event-loop>` et le "
|
||||
"même :class:`contextvars.Context`."
|
||||
|
||||
#: library/asyncio-runner.rst:77
|
||||
msgid ""
|
||||
|
@ -103,20 +129,29 @@ msgid ""
|
|||
"one. By default :func:`asyncio.new_event_loop` is used and set as current "
|
||||
"event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``."
|
||||
msgstr ""
|
||||
"*loop_factory* peut être utilisée pour remplacer la création de la boucle. "
|
||||
"*loop_factory* a la responsabilité de définir la boucle créée comme boucle "
|
||||
"courante. Par défaut :func:`asyncio.new_event_loop` est utilisée et définie "
|
||||
"comme boucle d'événements actuelle avec :func:`asyncio.set_event_loop` si "
|
||||
"*loop_factory* vaut ``None``."
|
||||
|
||||
#: library/asyncio-runner.rst:82
|
||||
msgid ""
|
||||
"Basically, :func:`asyncio.run()` example can be rewritten with the runner "
|
||||
"usage::"
|
||||
msgstr ""
|
||||
"Fondamentalement, l'exemple :func:`asyncio.run()` peut être réécrit avec "
|
||||
"l'utilisation de l'exécuteur suivant ::"
|
||||
|
||||
#: library/asyncio-runner.rst:95
|
||||
msgid "Run a :term:`coroutine <coroutine>` *coro* in the embedded loop."
|
||||
msgstr ""
|
||||
"Exécute la :term:`coroutine <coroutine>` *coro* dans la boucle d'événements "
|
||||
"en cours."
|
||||
|
||||
#: library/asyncio-runner.rst:97
|
||||
msgid "Return the coroutine's result or raise its exception."
|
||||
msgstr ""
|
||||
msgstr "Renvoie le résultat de la coroutine ou lève les exceptions afférentes."
|
||||
|
||||
#: library/asyncio-runner.rst:99
|
||||
msgid ""
|
||||
|
@ -124,36 +159,46 @@ msgid ""
|
|||
"class:`contextvars.Context` for the *coro* to run in. The runner's default "
|
||||
"context is used if ``None``."
|
||||
msgstr ""
|
||||
"L'argument (uniquement nommé) facultatif *context* permet de spécifier un :"
|
||||
"class:`contextvars.Context` personnalisé pour la coroutine à exécuter. Le "
|
||||
"contexte par défaut de l'exécuteur est utilisé si *context* est ``None``."
|
||||
|
||||
#: library/asyncio-runner.rst:108
|
||||
msgid "Close the runner."
|
||||
msgstr ""
|
||||
msgstr "Termine l'exécuteur."
|
||||
|
||||
#: library/asyncio-runner.rst:110
|
||||
msgid ""
|
||||
"Finalize asynchronous generators, shutdown default executor, close the event "
|
||||
"loop and release embedded :class:`contextvars.Context`."
|
||||
msgstr ""
|
||||
"Finalise les générateurs asynchrones, arrête l'exécuteur par défaut, ferme "
|
||||
"la boucle d'événements et libère le :class:`contextvars.Context` en cours."
|
||||
|
||||
#: library/asyncio-runner.rst:115
|
||||
msgid "Return the event loop associated with the runner instance."
|
||||
msgstr ""
|
||||
msgstr "Renvoie la boucle d'événements associée à l'instance de l'exécuteur."
|
||||
|
||||
#: library/asyncio-runner.rst:119
|
||||
msgid ""
|
||||
":class:`Runner` uses the lazy initialization strategy, its constructor "
|
||||
"doesn't initialize underlying low-level structures."
|
||||
msgstr ""
|
||||
":class:`Runner` utilise la stratégie d'initialisation paresseuse, son "
|
||||
"constructeur n'initialise pas les structures de bas niveau sous-jacentes."
|
||||
|
||||
#: library/asyncio-runner.rst:122
|
||||
msgid ""
|
||||
"Embedded *loop* and *context* are created at the :keyword:`with` body "
|
||||
"entering or the first call of :meth:`run` or :meth:`get_loop`."
|
||||
msgstr ""
|
||||
"La boucle d'événements *loop* et le *context* intégrés sont créés à "
|
||||
"l'entrée du corps de :keyword:`with` ou au premier appel de :meth:`run` ou :"
|
||||
"meth:`get_loop`."
|
||||
|
||||
#: library/asyncio-runner.rst:127
|
||||
msgid "Handling Keyboard Interruption"
|
||||
msgstr ""
|
||||
msgstr "Gestion de l'interruption par le clavier"
|
||||
|
||||
#: library/asyncio-runner.rst:131
|
||||
msgid ""
|
||||
|
@ -162,12 +207,19 @@ msgid ""
|
|||
"However this doesn't work with :mod:`asyncio` because it can interrupt "
|
||||
"asyncio internals and can hang the program from exiting."
|
||||
msgstr ""
|
||||
"Lorsque :const:`signal.SIGINT` est déclenché par :kbd:`Ctrl-C`, l'exception :"
|
||||
"exc:`KeyboardInterrupt` est levée par défaut dans le fils d'exécution "
|
||||
"principal. Cependant, cela ne fonctionne pas avec :mod:`asyncio` car cela "
|
||||
"peut interrompre le fonctionnement interne de *asyncio* et empêcher le "
|
||||
"programme de se terminer."
|
||||
|
||||
#: library/asyncio-runner.rst:136
|
||||
msgid ""
|
||||
"To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as "
|
||||
"follows:"
|
||||
msgstr ""
|
||||
"Pour contrer ce problème, :mod:`asyncio` gère :const:`signal.SIGINT` comme "
|
||||
"suit :"
|
||||
|
||||
#: library/asyncio-runner.rst:138
|
||||
msgid ""
|
||||
|
@ -175,12 +227,17 @@ msgid ""
|
|||
"before any user code is executed and removes it when exiting from the "
|
||||
"function."
|
||||
msgstr ""
|
||||
":meth:`asyncio.Runner.run` installe un gestionnaire :const:`signal.SIGINT` "
|
||||
"personnalisé avant l'exécution de tout code utilisateur et le supprime à la "
|
||||
"sortie de la fonction."
|
||||
|
||||
#: library/asyncio-runner.rst:140
|
||||
msgid ""
|
||||
"The :class:`~asyncio.Runner` creates the main task for the passed coroutine "
|
||||
"for its execution."
|
||||
msgstr ""
|
||||
"Le :class:`~asyncio.Runner` crée la tâche principale pour la coroutine "
|
||||
"transmise pour son exécution."
|
||||
|
||||
#: library/asyncio-runner.rst:142
|
||||
msgid ""
|
||||
|
@ -191,6 +248,13 @@ msgid ""
|
|||
"used for resource cleanup. After the main task is cancelled, :meth:`asyncio."
|
||||
"Runner.run` raises :exc:`KeyboardInterrupt`."
|
||||
msgstr ""
|
||||
"Lorsque :const:`signal.SIGINT` est déclenché par :kbd:`Ctrl-C`, le "
|
||||
"gestionnaire de signal personnalisé annule la tâche principale en appelant :"
|
||||
"meth:`asyncio.Task.cancel` qui lève :exc:`asyncio.CancelledError` à "
|
||||
"l'intérieur de la tâche principale. Cela entraîne la remontée dans la pile "
|
||||
"Python, les blocs ``try/except`` et ``try/finally`` peuvent être utilisés "
|
||||
"pour le nettoyage des ressources. Une fois la tâche principale annulée, :"
|
||||
"meth:`asyncio.Runner.run` lève :exc:`KeyboardInterrupt`."
|
||||
|
||||
#: library/asyncio-runner.rst:148
|
||||
msgid ""
|
||||
|
@ -199,3 +263,7 @@ msgid ""
|
|||
"immediately raises the :exc:`KeyboardInterrupt` without cancelling the main "
|
||||
"task."
|
||||
msgstr ""
|
||||
"Un utilisateur peut écrire une boucle tellement petite qu'elle ne peut pas "
|
||||
"être interrompue par :meth:`asyncio.Task.cancel` ; dans ce cas la seconde "
|
||||
"suivante :kbd:`Ctrl-C` lève immédiatement le :exc:`KeyboardInterrupt` sans "
|
||||
"annuler la tâche principale."
|
||||
|
|
|
@ -6,14 +6,14 @@ msgstr ""
|
|||
"Project-Id-Version: Python 3\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-04-14 13:19+0200\n"
|
||||
"PO-Revision-Date: 2020-09-22 17:11+0200\n"
|
||||
"Last-Translator: Philippe GALVAN <git.philippe.galvan@outlook.fr>\n"
|
||||
"PO-Revision-Date: 2023-06-29 21:14+0200\n"
|
||||
"Last-Translator: Christophe Nanteuil <christophe.nanteuil@gmail.com>\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"
|
||||
"X-Generator: Poedit 2.4.1\n"
|
||||
"X-Generator: Poedit 3.2.2\n"
|
||||
|
||||
#: library/asyncio-task.rst:6
|
||||
msgid "Coroutines and Tasks"
|
||||
|
@ -33,31 +33,31 @@ msgstr "Coroutines"
|
|||
|
||||
#: library/asyncio-task.rst:21
|
||||
msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`"
|
||||
msgstr ""
|
||||
msgstr "**Code source :** :source:`Lib/asyncio/coroutines.py`"
|
||||
|
||||
#: library/asyncio-task.rst:25
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
":term:`Coroutines <coroutine>` declared with the async/await syntax is the "
|
||||
"preferred way of writing asyncio applications. For example, the following "
|
||||
"snippet of code prints \"hello\", waits 1 second, and then prints \"world\"::"
|
||||
msgstr ""
|
||||
"Les :term:`coroutines <coroutine>` déclarées avec la syntaxe *async/await* "
|
||||
"sont la manière privilégiée d’écrire des applications *asyncio*. Par "
|
||||
"exemple, l’extrait de code suivant (requiert Python 3.7+) affiche « hello », "
|
||||
"attend 1 seconde et affiche ensuite « world » ::"
|
||||
"sont la manière privilégiée d’écrire des applications asynchrones. Par "
|
||||
"exemple, l’extrait de code suivant affiche « hello », attend une seconde et "
|
||||
"affiche ensuite « world » ::"
|
||||
|
||||
#: library/asyncio-task.rst:41
|
||||
msgid ""
|
||||
"Note that simply calling a coroutine will not schedule it to be executed::"
|
||||
msgstr "Appeler une coroutine ne la planifie pas pour exécution ::"
|
||||
msgstr ""
|
||||
"Remarquez que simplement appeler une coroutine ne la planifie pas pour "
|
||||
"exécution ::"
|
||||
|
||||
#: library/asyncio-task.rst:47
|
||||
#, fuzzy
|
||||
msgid "To actually run a coroutine, asyncio provides the following mechanisms:"
|
||||
msgstr ""
|
||||
"Pour réellement exécuter une coroutine, *asyncio* fournit trois mécanismes "
|
||||
"principaux :"
|
||||
"Pour réellement exécuter une coroutine, *asyncio* fournit les mécanismes "
|
||||
"suivants :"
|
||||
|
||||
#: library/asyncio-task.rst:49
|
||||
msgid ""
|
||||
|
@ -110,14 +110,18 @@ msgid ""
|
|||
"The :class:`asyncio.TaskGroup` class provides a more modern alternative to :"
|
||||
"func:`create_task`. Using this API, the last example becomes::"
|
||||
msgstr ""
|
||||
"La classe :class:`asyncio.TaskGroup` fournit une alternative plus moderne à :"
|
||||
"func:`create_task`. En utilisant cette API, le dernier exemple devient ::"
|
||||
|
||||
#: library/asyncio-task.rst:128
|
||||
msgid "The timing and output should be the same as for the previous version."
|
||||
msgstr ""
|
||||
"Le temps d'exécution et la sortie doivent être les mêmes que pour la version "
|
||||
"précédente."
|
||||
|
||||
#: library/asyncio-task.rst:130
|
||||
msgid ":class:`asyncio.TaskGroup`."
|
||||
msgstr ""
|
||||
msgstr ":class:`asyncio.TaskGroup`."
|
||||
|
||||
#: library/asyncio-task.rst:137
|
||||
msgid "Awaitables"
|
||||
|
@ -149,12 +153,13 @@ msgstr ""
|
|||
"Les coroutines sont des *awaitables* et peuvent donc être attendues par "
|
||||
"d'autres coroutines ::"
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:170
|
||||
msgid ""
|
||||
"In this documentation the term \"coroutine\" can be used for two closely "
|
||||
"related concepts:"
|
||||
msgstr ""
|
||||
"Dans cette documentation, le terme « coroutine » est utilisé pour désigner "
|
||||
"dans cette documentation, le terme « coroutine » est utilisé pour désigner "
|
||||
"deux concepts voisins :"
|
||||
|
||||
#: library/asyncio-task.rst:173
|
||||
|
@ -194,7 +199,7 @@ msgid ""
|
|||
"A :class:`Future` is a special **low-level** awaitable object that "
|
||||
"represents an **eventual result** of an asynchronous operation."
|
||||
msgstr ""
|
||||
"Un :class:`Future` est un objet *awaitable* spécial de **bas-niveau**, qui "
|
||||
"Un :class:`Future` est un objet *attendable* spécial de **bas-niveau**, qui "
|
||||
"représente le **résultat final** d'une opération asynchrone."
|
||||
|
||||
#: library/asyncio-task.rst:209
|
||||
|
@ -243,7 +248,7 @@ msgstr "Création de tâches"
|
|||
|
||||
#: library/asyncio-task.rst:237
|
||||
msgid "**Source code:** :source:`Lib/asyncio/tasks.py`"
|
||||
msgstr ""
|
||||
msgstr "**Code source :** :source:`Lib/asyncio/tasks.py`"
|
||||
|
||||
#: library/asyncio-task.rst:243
|
||||
msgid ""
|
||||
|
@ -267,6 +272,9 @@ msgid ""
|
|||
"class:`contextvars.Context` for the *coro* to run in. The current context "
|
||||
"copy is created when no *context* is provided."
|
||||
msgstr ""
|
||||
"L'argument (uniquement nommé) facultatif *context* permet de spécifier un :"
|
||||
"class:`contextvars.Context` personnalisé pour la coroutine à exécuter. La "
|
||||
"copie de contexte actuelle est créée lorsqu'aucun *context* n'est fourni."
|
||||
|
||||
#: library/asyncio-task.rst:253
|
||||
msgid ""
|
||||
|
@ -282,7 +290,10 @@ msgid ""
|
|||
":meth:`asyncio.TaskGroup.create_task` is a newer alternative that allows for "
|
||||
"convenient waiting for a group of related tasks."
|
||||
msgstr ""
|
||||
":meth:`asyncio.TaskGroup.create_task` est une alternative plus récente qui "
|
||||
"permet d'attendre facilement un groupe de tâches associées."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:264
|
||||
msgid ""
|
||||
"Save a reference to the result of this function, to avoid a task "
|
||||
|
@ -291,26 +302,35 @@ msgid ""
|
|||
"any time, even before it's done. For reliable \"fire-and-forget\" background "
|
||||
"tasks, gather them in a collection::"
|
||||
msgstr ""
|
||||
"gardez une référence au résultat de cette fonction, pour éviter qu'une tâche "
|
||||
"ne disparaisse en cours d'exécution. La boucle d'événements ne conserve que "
|
||||
"les références faibles aux tâches. Une tâche qui n'est pas référencée "
|
||||
"ailleurs peut être supprimée par le ramasse-miettes à tout moment, même "
|
||||
"avant qu'elle ne soit terminée. Pour créer des tâches d'arrière-plan fiables "
|
||||
"de type « lance et oublie », rassemblez-les dans une collection ::"
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:1011
|
||||
#, fuzzy
|
||||
msgid "Added the *name* parameter."
|
||||
msgstr "ajout du paramètre ``name``."
|
||||
msgstr "ajout du paramètre *name*."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:289
|
||||
#, fuzzy
|
||||
msgid "Added the *context* parameter."
|
||||
msgstr "ajout du paramètre ``name``."
|
||||
msgstr "ajout du paramètre *context*."
|
||||
|
||||
#: library/asyncio-task.rst:294
|
||||
msgid "Task Cancellation"
|
||||
msgstr ""
|
||||
msgstr "Annulation de tâche"
|
||||
|
||||
#: library/asyncio-task.rst:296
|
||||
msgid ""
|
||||
"Tasks can easily and safely be cancelled. When a task is cancelled, :exc:"
|
||||
"`asyncio.CancelledError` will be raised in the task at the next opportunity."
|
||||
msgstr ""
|
||||
"Les tâches peuvent être annulées facilement et en toute sécurité. Lorsqu'une "
|
||||
"tâche est annulée, :exc:`asyncio.CancelledError` est levée dans la tâche à "
|
||||
"la première occasion."
|
||||
|
||||
#: library/asyncio-task.rst:300
|
||||
msgid ""
|
||||
|
@ -320,6 +340,12 @@ msgid ""
|
|||
"`asyncio.CancelledError` directly subclasses :exc:`BaseException` so most "
|
||||
"code will not need to be aware of it."
|
||||
msgstr ""
|
||||
"Il est recommandé que les coroutines utilisent des blocs ``try/finally`` "
|
||||
"pour exécuter de manière robuste la logique de nettoyage. Dans le cas où :"
|
||||
"exc:`asyncio.CancelledError` est explicitement interceptée, elle devrait "
|
||||
"généralement être propagée lorsque le nettoyage est terminé. :exc:`asyncio."
|
||||
"CancelledError` sous-classe directement :exc:`BaseException` donc la plupart "
|
||||
"du code n'a pas besoin d'en être conscient."
|
||||
|
||||
#: library/asyncio-task.rst:306
|
||||
msgid ""
|
||||
|
@ -331,17 +357,26 @@ msgid ""
|
|||
"exc:`asyncio.CancelledError` is truly desired, it is necessary to also call "
|
||||
"``uncancel()`` to completely remove the cancellation state."
|
||||
msgstr ""
|
||||
"Les composants *asyncio* qui permettent la concurrence structurée, comme :"
|
||||
"class:`asyncio.TaskGroup` et :func:`asyncio.timeout`, sont implémentés en "
|
||||
"utilisant l'annulation en interne et peuvent mal se comporter si une "
|
||||
"coroutine ne propage pas :exc:`asyncio.CancelledError`. De même, le code "
|
||||
"utilisateur ne doit généralement pas appeler :meth:`uncancel<asyncio.Task."
|
||||
"uncancel>`. Cependant, dans les cas où la suppression de :exc:`asyncio."
|
||||
"CancelledError` est vraiment souhaitée, il est également nécessaire "
|
||||
"d'appeler ``uncancel()`` pour supprimer complètement l'état d'annulation."
|
||||
|
||||
#: library/asyncio-task.rst:318
|
||||
#, fuzzy
|
||||
msgid "Task Groups"
|
||||
msgstr "Tâches"
|
||||
msgstr "Groupes de tâches"
|
||||
|
||||
#: library/asyncio-task.rst:320
|
||||
msgid ""
|
||||
"Task groups combine a task creation API with a convenient and reliable way "
|
||||
"to wait for all tasks in the group to finish."
|
||||
msgstr ""
|
||||
"Les groupes de tâches combinent une API de création de tâches avec un moyen "
|
||||
"pratique et fiable d'attendre la fin de toutes les tâches du groupe."
|
||||
|
||||
#: library/asyncio-task.rst:325
|
||||
msgid ""
|
||||
|
@ -349,12 +384,18 @@ msgid ""
|
|||
"group of tasks. Tasks can be added to the group using :meth:`create_task`. "
|
||||
"All tasks are awaited when the context manager exits."
|
||||
msgstr ""
|
||||
":ref:`Gestionnaire de contexte asynchrone <async-context-managers>` "
|
||||
"responsable d’un groupe de tâches. Des tâches peuvent être ajoutées au "
|
||||
"groupe en utilisant :meth:`create_task`. Toutes les tâches sont attendues à "
|
||||
"la sortie du gestionnaire de contexte."
|
||||
|
||||
#: library/asyncio-task.rst:334
|
||||
msgid ""
|
||||
"Create a task in this task group. The signature matches that of :func:"
|
||||
"`asyncio.create_task`."
|
||||
msgstr ""
|
||||
"Crée une tâche dans ce groupe de tâches. La signature correspond à celle de :"
|
||||
"func:`asyncio.create_task`."
|
||||
|
||||
#: library/asyncio-task.rst:467 library/asyncio-task.rst:653
|
||||
#: library/asyncio-task.rst:722 library/asyncio-task.rst:815
|
||||
|
@ -369,6 +410,12 @@ msgid ""
|
|||
"in that coroutine). Once the last task has finished and the ``async with`` "
|
||||
"block is exited, no new tasks may be added to the group."
|
||||
msgstr ""
|
||||
"L'instruction ``async with`` attend la fin de toutes les tâches du groupe. "
|
||||
"Lors de l'attente, de nouvelles tâches peuvent encore être ajoutées au "
|
||||
"groupe (par exemple, en passant ``tg`` dans l'une des coroutines et en "
|
||||
"appelant ``tg.create_task()`` dans cette coroutine). Une fois que la "
|
||||
"dernière tâche est terminée et que le bloc ``async with`` est quitté, aucune "
|
||||
"nouvelle tâche ne peut être ajoutée au groupe."
|
||||
|
||||
#: library/asyncio-task.rst:352
|
||||
msgid ""
|
||||
|
@ -381,6 +428,14 @@ msgid ""
|
|||
"exc:`asyncio.CancelledError` will interrupt an ``await``, but it will not "
|
||||
"bubble out of the containing ``async with`` statement."
|
||||
msgstr ""
|
||||
"La première fois que l'une des tâches appartenant au groupe échoue avec une "
|
||||
"exception autre que :exc:`asyncio.CancelledError`, les tâches restantes du "
|
||||
"groupe sont annulées. Aucune autre tâche ne peut alors être ajoutée au "
|
||||
"groupe. À ce stade, si le corps de l'instruction ``async with`` est toujours "
|
||||
"actif (par exemple, :meth:`~object.__aexit__` n'a pas encore été appelé), la "
|
||||
"tâche contenant directement l'instruction ``async with`` est également "
|
||||
"annulée. Le résultat :exc:`asyncio.CancelledError` interrompt un ``await``, "
|
||||
"mais il ne sort pas de l'instruction ``async with`` englobante."
|
||||
|
||||
#: library/asyncio-task.rst:362
|
||||
msgid ""
|
||||
|
@ -389,6 +444,10 @@ msgid ""
|
|||
"an :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup` (as appropriate; see "
|
||||
"their documentation) which is then raised."
|
||||
msgstr ""
|
||||
"Une fois toutes les tâches terminées, si des tâches ont échoué avec une "
|
||||
"exception autre que :exc:`asyncio.CancelledError`, ces exceptions sont "
|
||||
"combinées dans un :exc:`ExceptionGroup` ou :exc:`BaseExceptionGroup` (selon "
|
||||
"le cas ; voir leur documentation) qui est ensuite levé."
|
||||
|
||||
#: library/asyncio-task.rst:369
|
||||
msgid ""
|
||||
|
@ -398,6 +457,11 @@ msgid ""
|
|||
"`KeyboardInterrupt` or :exc:`SystemExit` is re-raised instead of :exc:"
|
||||
"`ExceptionGroup` or :exc:`BaseExceptionGroup`."
|
||||
msgstr ""
|
||||
"Deux exceptions de base sont traitées spécialement : si une tâche échoue "
|
||||
"avec :exc:`KeyboardInterrupt` ou :exc:`SystemExit`, le groupe de tâches "
|
||||
"annule toujours les tâches restantes et les attend, mais alors la :exc:"
|
||||
"`KeyboardInterrupt` ou la :exc:`SystemExit` initiale est levée à nouveau au "
|
||||
"lieu de :exc:`ExceptionGroup` ou :exc:`BaseExceptionGroup`."
|
||||
|
||||
#: library/asyncio-task.rst:375
|
||||
msgid ""
|
||||
|
@ -410,6 +474,15 @@ msgid ""
|
|||
"the exception group. The same special case is made for :exc:"
|
||||
"`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph."
|
||||
msgstr ""
|
||||
"Si le corps de l'instruction ``async with`` se termine avec une exception "
|
||||
"(donc :meth:`~object.__aexit__` est appelé avec un ensemble d'exceptions), "
|
||||
"cela est traité de la même manière que si l'une des tâches échouait : les "
|
||||
"tâches restantes sont annulées puis attendues, et les exceptions de non-"
|
||||
"annulation sont regroupées dans un groupe d'exceptions et levées. "
|
||||
"L'exception transmise à :meth:`~object.__aexit__`, à moins qu'il ne s'agisse "
|
||||
"de :exc:`asyncio.CancelledError`, est également incluse dans le groupe "
|
||||
"d'exceptions. Le même cas spécial concerne :exc:`KeyboardInterrupt` et :exc:"
|
||||
"`SystemExit` comme dans le paragraphe précédent."
|
||||
|
||||
#: library/asyncio-task.rst:389
|
||||
msgid "Sleeping"
|
||||
|
@ -440,6 +513,10 @@ msgid ""
|
|||
"run. This can be used by long-running functions to avoid blocking the event "
|
||||
"loop for the full duration of the function call."
|
||||
msgstr ""
|
||||
"Définir le délai sur 0 fournit un chemin optimisé pour permettre à d'autres "
|
||||
"tâches de s'exécuter. Cela peut être utilisé par les fonctions de longue "
|
||||
"durée pour éviter de bloquer la boucle d'événements pendant toute la durée "
|
||||
"de l'appel de fonction."
|
||||
|
||||
#: library/asyncio-task.rst:407
|
||||
msgid ""
|
||||
|
@ -448,11 +525,11 @@ msgstr ""
|
|||
"Exemple d'une coroutine affichant la date toutes les secondes pendant 5 "
|
||||
"secondes ::"
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:516 library/asyncio-task.rst:717
|
||||
#: library/asyncio-task.rst:799 library/asyncio-task.rst:821
|
||||
#, fuzzy
|
||||
msgid "Removed the *loop* parameter."
|
||||
msgstr "Le paramètre *loop*."
|
||||
msgstr "le paramètre *loop* a été enlevé."
|
||||
|
||||
#: library/asyncio-task.rst:430
|
||||
msgid "Running Tasks Concurrently"
|
||||
|
@ -531,6 +608,8 @@ msgid ""
|
|||
"A more modern way to create and run tasks concurrently and wait for their "
|
||||
"completion is :class:`asyncio.TaskGroup`."
|
||||
msgstr ""
|
||||
"Une façon plus moderne de créer et d'exécuter des tâches simultanément et "
|
||||
"d'attendre leur achèvement est :class:`asyncio.TaskGroup`."
|
||||
|
||||
#: library/asyncio-task.rst:505
|
||||
msgid ""
|
||||
|
@ -540,6 +619,12 @@ msgid ""
|
|||
"calling ``gather.cancel()`` after catching an exception (raised by one of "
|
||||
"the awaitables) from gather won't cancel any other awaitables."
|
||||
msgstr ""
|
||||
"Si *return_exceptions* est faux, l'annulation de la fonction *gather* après "
|
||||
"qu'elle a été marquée comme terminée n'annule pas les *attendables* soumis. "
|
||||
"Par exemple, *gather* peut être marquée comme terminée après avoir propagé "
|
||||
"une exception à l'appelant, par conséquent, appeler ``gather.cancel()`` "
|
||||
"après avoir intercepté une exception (levée par l'un des *attendables*) de "
|
||||
"la collecte n'annule aucun autre *attendable*."
|
||||
|
||||
#: library/asyncio-task.rst:512
|
||||
msgid ""
|
||||
|
@ -555,6 +640,9 @@ msgid ""
|
|||
"not all positional arguments are Future-like objects and there is no running "
|
||||
"event loop."
|
||||
msgstr ""
|
||||
"Un avertissement d'obsolescence est émis si aucun argument positionnel n'est "
|
||||
"fourni ou si tous les arguments positionnels ne sont pas des objets de type "
|
||||
"Future et qu'il n'y a pas de boucle d'événements en cours d'exécution."
|
||||
|
||||
#: library/asyncio-task.rst:526
|
||||
msgid "Shielding From Cancellation"
|
||||
|
@ -613,6 +701,7 @@ msgstr ""
|
|||
"``shield()`` peut être combinée à une clause *try* / *except*, comme dans le "
|
||||
"code ci-dessous ::"
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:565
|
||||
msgid ""
|
||||
"Save a reference to tasks passed to this function, to avoid a task "
|
||||
|
@ -620,12 +709,20 @@ msgid ""
|
|||
"tasks. A task that isn't referenced elsewhere may get garbage collected at "
|
||||
"any time, even before it's done."
|
||||
msgstr ""
|
||||
"sauvegardez une référence aux tâches passées à cette fonction, pour éviter "
|
||||
"qu'une tâche ne disparaisse en cours d'exécution. La boucle d'événements ne "
|
||||
"conserve que les références faibles aux tâches. Une tâche qui n'est pas "
|
||||
"référencée ailleurs peut faire l'objet d'une suppression par le ramasse-"
|
||||
"miettes à tout moment, même avant qu'elle ne soit terminée."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:573
|
||||
msgid ""
|
||||
"Deprecation warning is emitted if *aw* is not Future-like object and there "
|
||||
"is no running event loop."
|
||||
msgstr ""
|
||||
"un avertissement d'obsolescence est émis si *aw* n'est pas un objet de type "
|
||||
"*future* et qu'il n'y a pas de boucle d'événement en cours d'exécution."
|
||||
|
||||
#: library/asyncio-task.rst:579
|
||||
msgid "Timeouts"
|
||||
|
@ -636,23 +733,27 @@ msgid ""
|
|||
"An :ref:`asynchronous context manager <async-context-managers>` that can be "
|
||||
"used to limit the amount of time spent waiting on something."
|
||||
msgstr ""
|
||||
":ref:`Gestionnaire de contexte asynchrone <async-context-managers>` qui peut "
|
||||
"être utilisé pour limiter le temps passé à attendre quelque chose."
|
||||
|
||||
#: library/asyncio-task.rst:587
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"*delay* can either be ``None``, or a float/int number of seconds to wait. If "
|
||||
"*delay* is ``None``, no time limit will be applied; this can be useful if "
|
||||
"the delay is unknown when the context manager is created."
|
||||
msgstr ""
|
||||
"*timeout* peut-être soit ``None``, soit le nombre de secondes (entier ou "
|
||||
"décimal) d'attente. Si *timeout* vaut ``None``, la fonction s'interrompt "
|
||||
"jusqu'à ce que le futur s'achève."
|
||||
"*delay* peut-être soit ``None``, soit le nombre de secondes (entier ou "
|
||||
"décimal) d'attente. Si *delay* vaut ``None``, aucune limite n'est "
|
||||
"appliquée ; cela peut être utile lorsque le délai d'attente est inconnu au "
|
||||
"moment de la création du gestionnaire de contexte."
|
||||
|
||||
#: library/asyncio-task.rst:592
|
||||
msgid ""
|
||||
"In either case, the context manager can be rescheduled after creation using :"
|
||||
"meth:`Timeout.reschedule`."
|
||||
msgstr ""
|
||||
"Dans les deux cas, le gestionnaire de contexte peut être redéfini après sa "
|
||||
"création en utilisant :meth:`Timeout.reschedule`."
|
||||
|
||||
#: library/asyncio-task.rst:601
|
||||
msgid ""
|
||||
|
@ -661,7 +762,12 @@ msgid ""
|
|||
"CancelledError` internally, transforming it into an :exc:`asyncio."
|
||||
"TimeoutError` which can be caught and handled."
|
||||
msgstr ""
|
||||
"Si ``long_running_task`` prend plus de 10 secondes pour se terminer, le "
|
||||
"gestionnaire de contexte annule la tâche en cours et traite l'erreur :exc:"
|
||||
"`asyncio.CancelledError` en interne, la transformant en une :exc:`asyncio."
|
||||
"TimeoutError` qui peut être interceptée et gérée."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:608
|
||||
msgid ""
|
||||
"The :func:`asyncio.timeout` context manager is what transforms the :exc:"
|
||||
|
@ -669,64 +775,81 @@ msgid ""
|
|||
"the :exc:`asyncio.TimeoutError` can only be caught *outside* of the context "
|
||||
"manager."
|
||||
msgstr ""
|
||||
"le gestionnaire de contexte :func:`asyncio.timeout` est ce qui transforme "
|
||||
"la :exc:`asyncio.CancelledError` en une :exc:`asyncio.TimeoutError`, ce qui "
|
||||
"signifie que la :exc:`asyncio.TimeoutError` ne peut être interceptée qu' *en "
|
||||
"dehors* du gestionnaire de contexte."
|
||||
|
||||
#: library/asyncio-task.rst:613
|
||||
msgid "Example of catching :exc:`asyncio.TimeoutError`::"
|
||||
msgstr ""
|
||||
msgstr "Exemple de capture :exc:`asyncio.TimeoutError` ::"
|
||||
|
||||
#: library/asyncio-task.rst:624
|
||||
msgid ""
|
||||
"The context manager produced by :func:`asyncio.timeout` can be rescheduled "
|
||||
"to a different deadline and inspected."
|
||||
msgstr ""
|
||||
"Le gestionnaire de contexte produit par :func:`asyncio.timeout` peut être "
|
||||
"reprogrammé à une échéance différente et inspecté."
|
||||
|
||||
#: library/asyncio-task.rst:629
|
||||
msgid ""
|
||||
"An :ref:`asynchronous context manager <async-context-managers>` for "
|
||||
"cancelling overdue coroutines."
|
||||
msgstr ""
|
||||
":ref:`Gestionnaire de contexte asynchrone <async-context-managers>` pour "
|
||||
"annuler les coroutines en retard."
|
||||
|
||||
#: library/asyncio-task.rst:632
|
||||
msgid ""
|
||||
"``when`` should be an absolute time at which the context should time out, as "
|
||||
"measured by the event loop's clock:"
|
||||
msgstr ""
|
||||
"``when`` doit être un temps absolu au bout duquel le contexte doit expirer, "
|
||||
"tel que mesuré par l'horloge de la boucle d'événements :"
|
||||
|
||||
#: library/asyncio-task.rst:635
|
||||
msgid "If ``when`` is ``None``, the timeout will never trigger."
|
||||
msgstr ""
|
||||
msgstr "Si ``when`` vaut ``None``, le délai maximal ne se déclenche jamais."
|
||||
|
||||
#: library/asyncio-task.rst:636
|
||||
msgid ""
|
||||
"If ``when < loop.time()``, the timeout will trigger on the next iteration of "
|
||||
"the event loop."
|
||||
msgstr ""
|
||||
"Si ``when < loop.time()``, le délai maximal se déclenche à la prochaine "
|
||||
"itération de la boucle d'événement."
|
||||
|
||||
#: library/asyncio-task.rst:641
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Return the current deadline, or ``None`` if the current deadline is not set."
|
||||
msgstr ""
|
||||
"Renvoie l'instance de la :class:`Task` en cours d'exécution, ou ``None`` "
|
||||
"s'il n'y a pas de tâche en cours."
|
||||
"Renvoie la limite de temps d'exécution définie actuellement, ou ``None`` "
|
||||
"s'il n'y en a pas."
|
||||
|
||||
#: library/asyncio-task.rst:646
|
||||
msgid "Reschedule the timeout."
|
||||
msgstr ""
|
||||
msgstr "Reprogramme le délai d'attente."
|
||||
|
||||
#: library/asyncio-task.rst:650
|
||||
msgid "Return whether the context manager has exceeded its deadline (expired)."
|
||||
msgstr ""
|
||||
"Renvoie si le gestionnaire de contexte a dépassé son délai (c.-à-d. s'il a "
|
||||
"expiré)."
|
||||
|
||||
#: library/asyncio-task.rst:670
|
||||
msgid "Timeout context managers can be safely nested."
|
||||
msgstr ""
|
||||
"Les gestionnaires de contexte de délai maximal peuvent être imbriqués en "
|
||||
"toute sécurité."
|
||||
|
||||
#: library/asyncio-task.rst:676
|
||||
msgid ""
|
||||
"Similar to :func:`asyncio.timeout`, except *when* is the absolute time to "
|
||||
"stop waiting, or ``None``."
|
||||
msgstr ""
|
||||
"Semblable à :func:`asyncio.timeout`, sauf que *when* est le temps absolu "
|
||||
"pour arrêter d'attendre, ou ``None``."
|
||||
|
||||
#: library/asyncio-task.rst:696
|
||||
msgid ""
|
||||
|
@ -746,12 +869,11 @@ msgstr ""
|
|||
"jusqu'à ce que le futur s'achève."
|
||||
|
||||
#: library/asyncio-task.rst:705
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`."
|
||||
msgstr ""
|
||||
"Si le délai d'attente maximal est dépassé, la tâche est annulée et "
|
||||
"l'exception :exc:`asyncio.TimeoutError` est levée."
|
||||
"l'exception :exc:`TimeoutError` est levée."
|
||||
|
||||
#: library/asyncio-task.rst:708
|
||||
msgid ""
|
||||
|
@ -762,47 +884,45 @@ msgstr ""
|
|||
"nécessaire de l'encapsuler dans une fonction :func:`shield`."
|
||||
|
||||
#: library/asyncio-task.rst:711
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"The function will wait until the future is actually cancelled, so the total "
|
||||
"wait time may exceed the *timeout*. If an exception happens during "
|
||||
"cancellation, it is propagated."
|
||||
msgstr ""
|
||||
"Cette fonction attend que le futur soit réellement annulé, donc le temps "
|
||||
"d'attente total peut être supérieur à *timeout*."
|
||||
"d'attente total peut être supérieur à *timeout*. Si une exception se produit "
|
||||
"lors de l'annulation, elle est propagée."
|
||||
|
||||
#: library/asyncio-task.rst:715
|
||||
msgid "If the wait is cancelled, the future *aw* is also cancelled."
|
||||
msgstr "Si l'attente est annulée, le futur *aw* est également annulé."
|
||||
|
||||
#: library/asyncio-task.rst:742
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be "
|
||||
"cancelled. Previously, it raised :exc:`TimeoutError` immediately."
|
||||
msgstr ""
|
||||
"Si le dépassement du délai d'attente maximal provoque l'annulation de *aw*, "
|
||||
"``wait_for`` attend que *aw* soit annulée. Auparavant, l'exception :exc:"
|
||||
"`asyncio.TimeoutError` était immédiatement levée."
|
||||
"`TimeoutError` était immédiatement levée."
|
||||
|
||||
#: library/asyncio-task.rst:752
|
||||
msgid "Waiting Primitives"
|
||||
msgstr "Primitives d'attente"
|
||||
|
||||
#: library/asyncio-task.rst:756
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the "
|
||||
"*aws* iterable concurrently and block until the condition specified by "
|
||||
"*return_when*."
|
||||
msgstr ""
|
||||
"Exécute les objets :ref:`awaitables <asyncio-awaitables>` de l'ensemble "
|
||||
"*aws* de manière concurrente, et s'interrompt jusqu'à ce que la condition "
|
||||
"décrite dans *return_when* soit vraie."
|
||||
"Exécute les instances :class:`~asyncio.Future` et :class:`~asyncio.Task` de "
|
||||
"l'itérable *aws* de manière concurrente, et s'interrompt jusqu'à ce que la "
|
||||
"condition décrite dans *return_when* soit vraie."
|
||||
|
||||
#: library/asyncio-task.rst:760
|
||||
msgid "The *aws* iterable must not be empty."
|
||||
msgstr ""
|
||||
msgstr "L'itérable *aws* ne doit pas être vide."
|
||||
|
||||
#: library/asyncio-task.rst:762
|
||||
msgid "Returns two sets of Tasks/Futures: ``(done, pending)``."
|
||||
|
@ -821,15 +941,14 @@ msgstr ""
|
|||
"le nombre maximal de secondes d'attente avant de se terminer."
|
||||
|
||||
#: library/asyncio-task.rst:771
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks "
|
||||
"that aren't done when the timeout occurs are simply returned in the second "
|
||||
"set."
|
||||
msgstr ""
|
||||
"Cette fonction ne lève pas :exc:`asyncio.TimeoutError`. Les futurs et les "
|
||||
"tâches qui ne sont pas finis quand le délai d'attente maximal est dépassé "
|
||||
"sont tout simplement renvoyés dans le second ensemble."
|
||||
"Cette fonction ne lève pas :exc:`TimeoutError`. Les futurs et les tâches qui "
|
||||
"ne sont pas finis quand le délai d'attente maximal est dépassé sont tout "
|
||||
"simplement renvoyés dans le second ensemble."
|
||||
|
||||
#: library/asyncio-task.rst:775
|
||||
msgid ""
|
||||
|
@ -888,44 +1007,46 @@ msgstr ""
|
|||
"futurs quand le délai d'attente est dépassé."
|
||||
|
||||
#: library/asyncio-task.rst:802
|
||||
#, fuzzy
|
||||
msgid "Passing coroutine objects to ``wait()`` directly is forbidden."
|
||||
msgstr "Passer directement des objets coroutines à ``wait()`` est obsolète."
|
||||
msgstr "Passer directement des objets coroutines à ``wait()`` est interdit."
|
||||
|
||||
#: library/asyncio-task.rst:807
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Run :ref:`awaitable objects <asyncio-awaitables>` in the *aws* iterable "
|
||||
"concurrently. Return an iterator of coroutines. Each coroutine returned can "
|
||||
"be awaited to get the earliest next result from the iterable of the "
|
||||
"remaining awaitables."
|
||||
msgstr ""
|
||||
"Exécute les objets :ref:`awaitables <asyncio-awaitables>` de l'ensemble "
|
||||
"*aws* de manière concurrente. Renvoie un itérateur sur des objets :class:"
|
||||
"`Future`. Chaque objet *futur* renvoyé représente le résultat le plus récent "
|
||||
"de l'ensemble des *awaitables* restants."
|
||||
"Exécute les objets :ref:`attendables <asyncio-awaitables>` de l'itérable "
|
||||
"*aws* de manière concurrente. Renvoie un itérateur sur des coroutines. "
|
||||
"Chaque coroutine renvoyée peut être attendue pour obtenir le premier "
|
||||
"résultat suivant de l'ensemble des *attendables* restants."
|
||||
|
||||
#: library/asyncio-task.rst:812
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done."
|
||||
msgstr ""
|
||||
"Lève une exception :exc:`asyncio.TimeoutError` si le délai d'attente est "
|
||||
"dépassé avant que tous les futurs ne soient achevés."
|
||||
"Lève une exception :exc:`TimeoutError` si le délai d'attente est dépassé "
|
||||
"avant que tous les futurs ne soient achevés."
|
||||
|
||||
#: library/asyncio-task.rst:824
|
||||
msgid ""
|
||||
"Deprecation warning is emitted if not all awaitable objects in the *aws* "
|
||||
"iterable are Future-like objects and there is no running event loop."
|
||||
msgstr ""
|
||||
"Un avertissement d'obsolescence est émis si tous les objets en attente dans "
|
||||
"l'itérable *aws* ne sont pas des objets de type *Future* et qu'il n'y a pas "
|
||||
"de boucle d'événement en cours d'exécution."
|
||||
|
||||
#: library/asyncio-task.rst:830
|
||||
msgid "Running in Threads"
|
||||
msgstr ""
|
||||
msgstr "Exécution dans des fils d'exécution (*threads*)"
|
||||
|
||||
#: library/asyncio-task.rst:834
|
||||
msgid "Asynchronously run function *func* in a separate thread."
|
||||
msgstr ""
|
||||
"Exécute la fonction *func* de manière asynchrone dans un fil d'exécution "
|
||||
"séparé."
|
||||
|
||||
#: library/asyncio-task.rst:836
|
||||
msgid ""
|
||||
|
@ -934,11 +1055,17 @@ msgid ""
|
|||
"allowing context variables from the event loop thread to be accessed in the "
|
||||
"separate thread."
|
||||
msgstr ""
|
||||
"Tous les *\\*args* et *\\*\\*kwargs* fournis à cette fonction sont "
|
||||
"directement passés à *func*. De plus, le :class:`contextvars.Context` actuel "
|
||||
"est propagé, ce qui permet d'accéder aux variables de contexte du fil de "
|
||||
"boucle d'événements dans le fil séparé."
|
||||
|
||||
#: library/asyncio-task.rst:841
|
||||
msgid ""
|
||||
"Return a coroutine that can be awaited to get the eventual result of *func*."
|
||||
msgstr ""
|
||||
"Renvoie une coroutine qui peut être attendue pour obtenir le résultat "
|
||||
"éventuel de *func*."
|
||||
|
||||
#: library/asyncio-task.rst:843
|
||||
msgid ""
|
||||
|
@ -946,6 +1073,10 @@ msgid ""
|
|||
"bound functions/methods that would otherwise block the event loop if they "
|
||||
"were run in the main thread. For example::"
|
||||
msgstr ""
|
||||
"Cette fonction coroutine est principalement destinée à être utilisée pour "
|
||||
"exécuter des fonctions/méthodes faisant beaucoup d'entrées-sorties et qui "
|
||||
"bloqueraient autrement la boucle d'événements si elles étaient exécutées "
|
||||
"dans le fil d'exécution principal. Par exemple ::"
|
||||
|
||||
#: library/asyncio-task.rst:873
|
||||
msgid ""
|
||||
|
@ -954,7 +1085,13 @@ msgid ""
|
|||
"Instead, by using ``asyncio.to_thread()``, we can run it in a separate "
|
||||
"thread without blocking the event loop."
|
||||
msgstr ""
|
||||
"Appeler directement ``blocking_io()`` dans n'importe quelle coroutine "
|
||||
"bloquerait la boucle d'événements pendant sa durée, ce qui entraînerait une "
|
||||
"seconde supplémentaire de temps d'exécution. Au lieu de cela, en utilisant "
|
||||
"``asyncio.to_thread()``, nous pouvons l'exécuter dans un fil d'exécution "
|
||||
"séparé sans bloquer la boucle d'événements."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:880
|
||||
msgid ""
|
||||
"Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used "
|
||||
|
@ -962,6 +1099,12 @@ msgid ""
|
|||
"release the GIL or alternative Python implementations that don't have one, "
|
||||
"``asyncio.to_thread()`` can also be used for CPU-bound functions."
|
||||
msgstr ""
|
||||
"en raison du :term:`GIL`, ``asyncio.to_thread()`` ne peut généralement être "
|
||||
"utilisée que pour rendre les fonctions faisant beaucoup d'entrées-sorties "
|
||||
"non bloquantes. Cependant, pour les modules d'extension qui relâchent le GIL "
|
||||
"ou les implémentations Python alternatives qui n'en ont pas, ``asyncio."
|
||||
"to_thread()`` peut également être utilisée pour les fonctions qui "
|
||||
"sollicitent beaucoup le processeur."
|
||||
|
||||
#: library/asyncio-task.rst:889
|
||||
msgid "Scheduling From Other Threads"
|
||||
|
@ -1050,9 +1193,8 @@ msgstr ""
|
|||
"la boucle en cours d'exécution."
|
||||
|
||||
#: library/asyncio-task.rst:961
|
||||
#, fuzzy
|
||||
msgid "Return ``True`` if *obj* is a coroutine object."
|
||||
msgstr "Renvoie ``True`` si *obj* est un :ref:`objet coroutine <coroutine>`."
|
||||
msgstr "Renvoie ``True`` si *obj* est un objet coroutine."
|
||||
|
||||
#: library/asyncio-task.rst:967
|
||||
msgid "Task Object"
|
||||
|
@ -1138,18 +1280,22 @@ msgid ""
|
|||
"context."
|
||||
msgstr ""
|
||||
"*Task* implémente le module :mod:`contextvars`. Lors de sa création, une "
|
||||
"tâche effectue une copie du contexte actuel et exécutera ses coroutines dans "
|
||||
"tâche effectue une copie du contexte actuel et exécute ses coroutines dans "
|
||||
"cette copie."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:1008
|
||||
msgid "Added support for the :mod:`contextvars` module."
|
||||
msgstr "Ajout du support du module :mod:`contextvars`."
|
||||
msgstr "ajout du support du module :mod:`contextvars`."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:1014
|
||||
msgid ""
|
||||
"Deprecation warning is emitted if *loop* is not specified and there is no "
|
||||
"running event loop."
|
||||
msgstr ""
|
||||
"un avertissement d'obsolescence est émis si *loop* n'est pas spécifié et "
|
||||
"qu'il n'y a pas de boucle d'événement en cours d'exécution."
|
||||
|
||||
#: library/asyncio-task.rst:1020
|
||||
msgid "Return ``True`` if the Task is *done*."
|
||||
|
@ -1299,13 +1445,12 @@ msgid "The *limit* argument is passed to :meth:`get_stack` directly."
|
|||
msgstr "Le paramètre *limit* est directement passé à :meth:`get_stack`."
|
||||
|
||||
#: library/asyncio-task.rst:1101
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"The *file* argument is an I/O stream to which the output is written; by "
|
||||
"default output is written to :data:`sys.stdout`."
|
||||
msgstr ""
|
||||
"Le paramètre *file* est un flux d'entrées-sorties sur lequel le résultat est "
|
||||
"écrit ; par défaut, :data:`sys.stderr`."
|
||||
"écrit ; par défaut, :data:`sys.stdout`."
|
||||
|
||||
#: library/asyncio-task.rst:1106
|
||||
msgid "Return the coroutine object wrapped by the :class:`Task`."
|
||||
|
@ -1357,7 +1502,6 @@ msgstr ""
|
|||
"d'exécution."
|
||||
|
||||
#: library/asyncio-task.rst:1139
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
"The coroutine then has a chance to clean up or even deny the request by "
|
||||
"suppressing the exception with a :keyword:`try` ... ... ``except "
|
||||
|
@ -1373,16 +1517,20 @@ msgstr ""
|
|||
"CancelledError`` … :keyword:`finally`. Par conséquent, contrairement à :meth:"
|
||||
"`Future.cancel`, :meth:`Task.cancel` ne garantit pas que la tâche sera "
|
||||
"annulée, bien qu'ignorer totalement une annulation ne soit ni une pratique "
|
||||
"courante, ni encouragé."
|
||||
"courante, ni encouragé. Si la coroutine décide néanmoins de supprimer "
|
||||
"l'annulation, elle doit appeler :meth:`Task.uncancel` en plus d'intercepter "
|
||||
"l'exception."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:1149
|
||||
#, fuzzy
|
||||
msgid "Added the *msg* parameter."
|
||||
msgstr "ajout du paramètre ``name``."
|
||||
msgstr "ajout du paramètre *msg*."
|
||||
|
||||
# suit un :
|
||||
#: library/asyncio-task.rst:1152
|
||||
msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter."
|
||||
msgstr ""
|
||||
"le paramètre ``msg`` est propagé de la tâche annulée vers celle qui l'attend."
|
||||
|
||||
#: library/asyncio-task.rst:1157
|
||||
msgid ""
|
||||
|
@ -1407,19 +1555,20 @@ msgstr ""
|
|||
"été levée en son sein."
|
||||
|
||||
#: library/asyncio-task.rst:1204
|
||||
#, fuzzy
|
||||
msgid "Decrement the count of cancellation requests to this Task."
|
||||
msgstr "Renvoie une liste représentant la pile d'appels de la tâche."
|
||||
msgstr "Décrémente le nombre de demandes d'annulation pour cette tâche."
|
||||
|
||||
#: library/asyncio-task.rst:1206
|
||||
msgid "Returns the remaining number of cancellation requests."
|
||||
msgstr ""
|
||||
msgstr "Renvoie le nombre restant de demandes d'annulation."
|
||||
|
||||
#: library/asyncio-task.rst:1208
|
||||
msgid ""
|
||||
"Note that once execution of a cancelled task completed, further calls to :"
|
||||
"meth:`uncancel` are ineffective."
|
||||
msgstr ""
|
||||
"Notez qu'une fois l'exécution d'une tâche annulée terminée, les appels "
|
||||
"ultérieurs à :meth:`uncancel` ne font rien."
|
||||
|
||||
#: library/asyncio-task.rst:1213
|
||||
msgid ""
|
||||
|
@ -1429,6 +1578,12 @@ msgid ""
|
|||
"func:`asyncio.timeout` to continue running, isolating cancellation to the "
|
||||
"respective structured block. For example::"
|
||||
msgstr ""
|
||||
"Cette méthode est utilisée par les composants internes d'*asyncio* et elle "
|
||||
"ne devrait pas être utilisée par le code de l'utilisateur final. En "
|
||||
"particulier, si une tâche est annulée avec succès, cela permet aux "
|
||||
"structures permettant le multi-fils tels que :ref:`taskgroups` et :func:"
|
||||
"`asyncio.timeout` de continuer à s'exécuter, isolant l'annulation au bloc "
|
||||
"concerné. Par exemple ::"
|
||||
|
||||
#: library/asyncio-task.rst:1231
|
||||
msgid ""
|
||||
|
@ -1438,6 +1593,11 @@ msgid ""
|
|||
"`uncancel`. :class:`TaskGroup` context managers use :func:`uncancel` in a "
|
||||
"similar fashion."
|
||||
msgstr ""
|
||||
"Alors que le bloc avec ``make_request()`` et ``make_another_request()`` peut "
|
||||
"être annulé en raison du délai d'attente, ``unrelated_code()`` devrait "
|
||||
"continuer à s'exécuter même en cas d'atteinte du délai maximal. Ceci est "
|
||||
"implémenté avec :meth:`uncancel`. Les gestionnaires de contexte :class:"
|
||||
"`TaskGroup` utilisent :func:`uncancel` de la même manière."
|
||||
|
||||
#: library/asyncio-task.rst:1237
|
||||
msgid ""
|
||||
|
@ -1445,12 +1605,18 @@ msgid ""
|
|||
"exc:`CancelledError`, it needs to call this method to remove the "
|
||||
"cancellation state."
|
||||
msgstr ""
|
||||
"Si, pour une raison quelconque, le code de l'utilisateur final supprime "
|
||||
"l'annulation en interceptant :exc:`CancelledError`, il doit appeler cette "
|
||||
"méthode pour supprimer l'état d'annulation."
|
||||
|
||||
#: library/asyncio-task.rst:1243
|
||||
msgid ""
|
||||
"Return the number of pending cancellation requests to this Task, i.e., the "
|
||||
"number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls."
|
||||
msgstr ""
|
||||
"Renvoie le nombre de demandes d'annulation en attente à cette tâche, c'est-à-"
|
||||
"dire le nombre d'appels à :meth:`cancel` moins le nombre d'appels à :meth:"
|
||||
"`uncancel`."
|
||||
|
||||
#: library/asyncio-task.rst:1247
|
||||
msgid ""
|
||||
|
@ -1460,12 +1626,20 @@ msgid ""
|
|||
"the task not being cancelled after all if the cancellation requests go down "
|
||||
"to zero."
|
||||
msgstr ""
|
||||
"Notez que si ce nombre est supérieur à zéro mais que la tâche est toujours "
|
||||
"en cours d'exécution, :meth:`cancelled` renvoie toujours ``False``. En "
|
||||
"effet, ce nombre peut être réduit en appelant :meth:`uncancel`, ce qui peut "
|
||||
"empêcher en fin de compte la tâche d'être annulée si les demandes "
|
||||
"d'annulation tombent à zéro."
|
||||
|
||||
#: library/asyncio-task.rst:1253
|
||||
msgid ""
|
||||
"This method is used by asyncio's internals and isn't expected to be used by "
|
||||
"end-user code. See :meth:`uncancel` for more details."
|
||||
msgstr ""
|
||||
"Cette méthode est utilisée par les composants internes d'*asyncio* et ne "
|
||||
"devrait pas être utilisée par le code de l'utilisateur final. Voir :meth:"
|
||||
"`uncancel` pour plus de détails."
|
||||
|
||||
#~ msgid "Running an asyncio Program"
|
||||
#~ msgstr "Exécution d'un programme *asyncio*"
|
||||
|
|
Loading…
Reference in New Issue
Block a user