@@ -6,13 +6,14 @@ msgstr ""
6
6
"Project-Id-Version : Python 3\n "
7
7
"Report-Msgid-Bugs-To : \n "
8
8
"POT-Creation-Date : 2020-10-01 16:00+0200\n "
9
- "PO-Revision-Date : 2018-10-13 17:38+0200 \n "
10
- "Last-Translator : Julien Palard <julien@palard.fr >\n "
9
+ "PO-Revision-Date : 2022-06-06 21:29-0400 \n "
10
+ "Last-Translator : Nicolas Haller <nicolas@haller.im >\n "
11
11
"Language-Team : FRENCH <traductions@lists.afpy.org>\n "
12
12
"Language : fr\n "
13
13
"MIME-Version : 1.0\n "
14
14
"Content-Type : text/plain; charset=UTF-8\n "
15
15
"Content-Transfer-Encoding : 8bit\n "
16
+ "X-Generator : Poedit 3.0.1\n "
16
17
17
18
#: library/asyncio-dev.rst:7
18
19
msgid "Developing with asyncio"
@@ -23,94 +24,125 @@ msgid ""
23
24
"Asynchronous programming is different from classic \" sequential\" "
24
25
"programming."
25
26
msgstr ""
27
+ "La programmation asynchrone est différente de la programmation "
28
+ "« séquentielle » classique."
26
29
27
30
#: library/asyncio-dev.rst:12
28
31
msgid ""
29
32
"This page lists common mistakes and traps and explains how to avoid them."
30
33
msgstr ""
34
+ "Cette page liste les pièges et erreurs communs que le développeur pourrait "
35
+ "rencontrer et décrit comment les éviter."
31
36
32
37
#: library/asyncio-dev.rst:19
33
38
msgid "Debug Mode"
34
- msgstr ""
39
+ msgstr "Mode débogage "
35
40
36
41
#: library/asyncio-dev.rst:21
37
42
msgid ""
38
43
"By default asyncio runs in production mode. In order to ease the "
39
44
"development asyncio has a *debug mode*."
40
45
msgstr ""
46
+ "Par défaut, *asyncio* s'exécute en mode production. Pour faciliter le "
47
+ "développement, *asyncio* possède un « mode débogage »."
41
48
42
49
#: library/asyncio-dev.rst:24
43
50
msgid "There are several ways to enable asyncio debug mode:"
44
- msgstr ""
51
+ msgstr "Il existe plusieurs façons d'activer le mode débogage de *asyncio* : "
45
52
46
53
#: library/asyncio-dev.rst:26
47
54
msgid "Setting the :envvar:`PYTHONASYNCIODEBUG` environment variable to ``1``."
48
55
msgstr ""
56
+ "en réglant la variable d’environnement :envvar:`PYTHONASYNCIODEBUG` à ``1`` ;"
49
57
50
58
#: library/asyncio-dev.rst:28
51
59
msgid "Using the :ref:`Python Development Mode <devmode>`."
52
60
msgstr ""
61
+ "en utilisant le mode développement de Python (:ref:`Python Development Mode "
62
+ "<devmode>`) ;"
53
63
54
64
#: library/asyncio-dev.rst:30
55
65
msgid "Passing ``debug=True`` to :func:`asyncio.run`."
56
- msgstr ""
66
+ msgstr "en passant ``debug=True`` à la fonction :func:`asyncio.run` ; "
57
67
58
68
#: library/asyncio-dev.rst:32
59
69
msgid "Calling :meth:`loop.set_debug`."
60
- msgstr ""
70
+ msgstr "en appelant la méthode :meth:`loop.set_debug`. "
61
71
62
72
#: library/asyncio-dev.rst:34
63
73
msgid "In addition to enabling the debug mode, consider also:"
64
- msgstr ""
74
+ msgstr "En plus d'activer le mode débogage, vous pouvez également : "
65
75
66
76
#: library/asyncio-dev.rst:36
67
77
msgid ""
68
78
"setting the log level of the :ref:`asyncio logger <asyncio-logger>` to :py:"
69
79
"data:`logging.DEBUG`, for example the following snippet of code can be run "
70
80
"at startup of the application::"
71
81
msgstr ""
82
+ "régler le niveau de journalisation pour l'enregistreur d'*asyncio* (:ref:"
83
+ "`asyncio logger <asyncio-logger>`) à :py:data:`logging.DEBUG` ; par exemple, "
84
+ "le fragment de code suivant peut être exécuté au démarrage de "
85
+ "l'application ::"
72
86
73
87
#: library/asyncio-dev.rst:42
74
88
msgid ""
75
89
"configuring the :mod:`warnings` module to display :exc:`ResourceWarning` "
76
90
"warnings. One way of doing that is by using the :option:`-W` ``default`` "
77
91
"command line option."
78
92
msgstr ""
93
+ "configurer le module :mod:`warnings` afin d'afficher les avertissements de "
94
+ "type :exc:`ResourceWarning` ; vous pouvez faire cela en utilisant l'option :"
95
+ "option:`-W` ``default`` sur la ligne de commande."
79
96
80
97
#: library/asyncio-dev.rst:47
81
98
msgid "When the debug mode is enabled:"
82
- msgstr ""
99
+ msgstr "Lorsque le mode débogage est activé : "
83
100
101
+ # long ref
84
102
#: library/asyncio-dev.rst:49
85
103
msgid ""
86
104
"asyncio checks for :ref:`coroutines that were not awaited <asyncio-coroutine-"
87
105
"not-scheduled>` and logs them; this mitigates the \" forgotten await\" "
88
106
"pitfall."
89
107
msgstr ""
108
+ "*asyncio* surveille les :ref:`coroutines qui ne sont jamais attendues "
109
+ "<asyncio-coroutine-not-scheduled>` et les journalise ; cela atténue le "
110
+ "problème des « *await* oubliés » ;"
90
111
112
+ # thread safe comment traduire
91
113
#: library/asyncio-dev.rst:53
92
114
msgid ""
93
115
"Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and :meth:"
94
116
"`loop.call_at` methods) raise an exception if they are called from a wrong "
95
117
"thread."
96
118
msgstr ""
119
+ "beaucoup d'*API* *asyncio* ne prenant pas en charge les fils d'exécution "
120
+ "multiples (comme les méthodes :meth:`loop.call_soon` et :meth:`loop."
121
+ "call_at`) lèvent une exception si elles sont appelées par le mauvais fil "
122
+ "d’exécution ;"
97
123
98
124
#: library/asyncio-dev.rst:57
99
125
msgid ""
100
126
"The execution time of the I/O selector is logged if it takes too long to "
101
127
"perform an I/O operation."
102
128
msgstr ""
129
+ "le temps d'exécution du sélecteur d'entrée-sortie est journalisé si une "
130
+ "opération prend trop de temps à s'effectuer ;"
103
131
104
132
#: library/asyncio-dev.rst:60
105
133
msgid ""
106
134
"Callbacks taking longer than 100ms are logged. The :attr:`loop."
107
135
"slow_callback_duration` attribute can be used to set the minimum execution "
108
136
"duration in seconds that is considered \" slow\" ."
109
137
msgstr ""
138
+ "les fonctions de rappel prenant plus de 100 ms sont journalisées ; "
139
+ "l'attribut :attr:`loop.slow_callback_duration` peut être utilisé pour "
140
+ "changer la limite (en secondes) après laquelle une fonction de rappel est "
141
+ "considérée comme « lent »."
110
142
111
143
#: library/asyncio-dev.rst:68
112
144
msgid "Concurrency and Multithreading"
113
- msgstr "Concourance et *multithreading* "
145
+ msgstr "Programmation concurrente et multi-fils "
114
146
115
147
#: library/asyncio-dev.rst:70
116
148
msgid ""
@@ -120,12 +152,21 @@ msgid ""
120
152
"``await`` expression, the running Task gets suspended, and the event loop "
121
153
"executes the next Task."
122
154
msgstr ""
155
+ "Une boucle d'évènements s'exécute dans un fil d’exécution (typiquement dans "
156
+ "le fil principal) et traite toutes les fonctions de rappel (*callbacks*) "
157
+ "ainsi que toutes les tâches dans ce même fil. Lorsqu'une tâche est en cours "
158
+ "d'exécution dans la boucle d'évènements, aucune autre tâche ne peut "
159
+ "s'exécuter dans ce fil. Quand une tâche traite une expression ``await``, "
160
+ "elle se suspend et laisse la boucle d’évènements traiter la tâche suivante."
123
161
124
162
#: library/asyncio-dev.rst:76
125
163
msgid ""
126
164
"To schedule a :term:`callback` from another OS thread, the :meth:`loop."
127
165
"call_soon_threadsafe` method should be used. Example::"
128
166
msgstr ""
167
+ "Pour planifier un :term:`rappel <callback>` depuis un autre fil d'exécution "
168
+ "système, utilisez la méthode :meth:`loop.call_soon_threadsafe`. Par "
169
+ "exemple ::"
129
170
130
171
#: library/asyncio-dev.rst:81
131
172
msgid ""
@@ -134,19 +175,30 @@ msgid ""
134
175
"a callback. If there's a need for such code to call a low-level asyncio "
135
176
"API, the :meth:`loop.call_soon_threadsafe` method should be used, e.g.::"
136
177
msgstr ""
178
+ "La plupart des objets *asyncio* ne sont pas conçus pour être exécutés dans "
179
+ "un contexte multi-fils (*thread-safe*) mais cela n'est en général pas un "
180
+ "problème à moins que l'objet ne fasse appel à du code se trouvant en dehors "
181
+ "d'une tâche ou d'une fonction de rappel. Dans ce dernier cas, si le code "
182
+ "appelle les *API* bas niveau de *asyncio*, utilisez la méthode :meth:`loop."
183
+ "call_soon_threadsafe`. Par exemple ::"
137
184
138
185
#: library/asyncio-dev.rst:89
139
186
msgid ""
140
187
"To schedule a coroutine object from a different OS thread, the :func:"
141
188
"`run_coroutine_threadsafe` function should be used. It returns a :class:"
142
189
"`concurrent.futures.Future` to access the result::"
143
190
msgstr ""
191
+ "Pour planifier un objet concurrent depuis un autre fil d'exécution système, "
192
+ "utilisez :func:`run_coroutine_threadsafe`. Cette fonction renvoie un objet :"
193
+ "class:`concurrent.futures.Future` pour accéder au résultat ::"
144
194
145
195
#: library/asyncio-dev.rst:102
146
196
msgid ""
147
197
"To handle signals and to execute subprocesses, the event loop must be run in "
148
198
"the main thread."
149
199
msgstr ""
200
+ "Pour pouvoir traiter les signaux et démarrer des processus enfants, la "
201
+ "boucle d'évènements doit être exécutée dans le fil principal."
150
202
151
203
#: library/asyncio-dev.rst:105
152
204
msgid ""
@@ -155,6 +207,10 @@ msgid ""
155
207
"different OS thread without blocking the OS thread that the event loop runs "
156
208
"in."
157
209
msgstr ""
210
+ "La méthode :meth:`loop.run_in_executor` peut être utilisée avec :class:"
211
+ "`concurrent.futures.ThreadPoolExecutor` pour exécuter du code bloquant dans "
212
+ "un autre fil d'exécution, afin de ne pas bloquer le fil où la boucle "
213
+ "d'évènements se trouve."
158
214
159
215
#: library/asyncio-dev.rst:110
160
216
msgid ""
@@ -168,24 +224,44 @@ msgid ""
168
224
"a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a "
169
225
"different process."
170
226
msgstr ""
227
+ "Il n'y a actuellement aucune façon de planifier des coroutines ou des "
228
+ "rappels directement depuis un autre processus (comme, par exemple, un "
229
+ "processus démarré avec :mod:`multiprocessing`). La section :ref:`Méthodes de "
230
+ "la boucle d'évènements <asyncio-event-loop>` liste les *API* pouvant lire "
231
+ "les tubes (*pipes*) et surveiller les descripteurs de fichiers sans bloquer "
232
+ "la boucle d'évènements. De plus, les *API* :ref:`Subprocess <asyncio-"
233
+ "subprocess>` d'*asyncio* fournissent un moyen de démarrer un processus et de "
234
+ "communiquer avec lui depuis la boucle d'évènements. Enfin, la méthode :meth:"
235
+ "`loop.run_in_executor` peut également être utilisée avec :class:`concurrent."
236
+ "futures.ProcessPoolExecutor` pour exécuter du code dans un processus "
237
+ "différent."
171
238
172
239
#: library/asyncio-dev.rst:124
173
240
msgid "Running Blocking Code"
174
- msgstr ""
241
+ msgstr "Exécution de code bloquant "
175
242
176
243
#: library/asyncio-dev.rst:126
177
244
msgid ""
178
245
"Blocking (CPU-bound) code should not be called directly. For example, if a "
179
246
"function performs a CPU-intensive calculation for 1 second, all concurrent "
180
247
"asyncio Tasks and IO operations would be delayed by 1 second."
181
248
msgstr ""
249
+ "Du code bloquant sur des opérations de calcul (*CPU-bound*) ne devrait pas "
250
+ "être appelé directement. Par exemple, si une fonction effectue des calculs "
251
+ "utilisant le CPU intensivement pendant une seconde, toutes les tâches "
252
+ "*asyncio* concurrentes et les opérations d'entrées-sorties seront bloquées "
253
+ "pour une seconde."
182
254
183
255
#: library/asyncio-dev.rst:131
184
256
msgid ""
185
257
"An executor can be used to run a task in a different thread or even in a "
186
258
"different process to avoid blocking the OS thread with the event loop. See "
187
259
"the :meth:`loop.run_in_executor` method for more details."
188
260
msgstr ""
261
+ "Un exécuteur peut être utilisé pour traiter une tâche dans un fil "
262
+ "d'exécution ou un processus différent, afin d'éviter de bloquer le fil "
263
+ "d'exécution système dans lequel se trouve la boucle d’évènements. Voir :meth:"
264
+ "`loop.run_in_executor` pour plus de détails."
189
265
190
266
#: library/asyncio-dev.rst:140
191
267
msgid "Logging"
@@ -196,23 +272,31 @@ msgid ""
196
272
"asyncio uses the :mod:`logging` module and all logging is performed via the "
197
273
"``\" asyncio\" `` logger."
198
274
msgstr ""
275
+ "*Asyncio* utilise le module :mod:`logging`. Toutes les opérations de "
276
+ "journalisation sont effectuées via l'enregistreur (*logger*) ``\" asyncio\" ``."
199
277
200
278
#: library/asyncio-dev.rst:145
201
279
msgid ""
202
280
"The default log level is :py:data:`logging.INFO`, which can be easily "
203
281
"adjusted::"
204
282
msgstr ""
283
+ "Le niveau de journalisation par défaut est :py:data:`logging.INFO` mais peut "
284
+ "être ajusté facilement ::"
205
285
206
286
#: library/asyncio-dev.rst:154
207
287
msgid "Detect never-awaited coroutines"
208
- msgstr ""
288
+ msgstr "Détection des coroutines jamais attendues "
209
289
210
290
#: library/asyncio-dev.rst:156
211
291
msgid ""
212
292
"When a coroutine function is called, but not awaited (e.g. ``coro()`` "
213
293
"instead of ``await coro()``) or the coroutine is not scheduled with :meth:"
214
294
"`asyncio.create_task`, asyncio will emit a :exc:`RuntimeWarning`::"
215
295
msgstr ""
296
+ "Lorsqu'une fonction coroutine est appelée mais qu'elle n'est pas attendue "
297
+ "(p. ex. ``coro()`` au lieu de ``await coro()``) ou si la coroutine n'est "
298
+ "pas planifiée avec :meth:`asyncio.create_task`, *asyncio* émet un :exc:"
299
+ "`RuntimeWarning` ::"
216
300
217
301
#: library/asyncio-dev.rst:216
218
302
msgid "Output::"
@@ -227,10 +311,12 @@ msgid ""
227
311
"The usual fix is to either await the coroutine or call the :meth:`asyncio."
228
312
"create_task` function::"
229
313
msgstr ""
314
+ "La façon habituelle de régler ce problème est d'attendre (*await*) la "
315
+ "coroutine ou bien d'appeler la fonction :meth:`asyncio.create_task` ::"
230
316
231
317
#: library/asyncio-dev.rst:197
232
318
msgid "Detect never-retrieved exceptions"
233
- msgstr ""
319
+ msgstr "Détection des exceptions jamais récupérées "
234
320
235
321
#: library/asyncio-dev.rst:199
236
322
msgid ""
@@ -239,13 +325,19 @@ msgid ""
239
325
"this case, asyncio would emit a log message when the Future object is "
240
326
"garbage collected."
241
327
msgstr ""
328
+ "Si la méthode :meth:`Future.set_exception` est appelée mais que l'objet "
329
+ "*Future* n'est pas attendu, l'exception n'est pas propagée au code "
330
+ "utilisateur. Dans ce cas, *asyncio* écrit un message dans le journal lorsque "
331
+ "l'objet *Future* est récupéré par le ramasse-miette."
242
332
243
333
#: library/asyncio-dev.rst:204
244
334
msgid "Example of an unhandled exception::"
245
- msgstr ""
335
+ msgstr "Exemple d'une exception non-gérée :: "
246
336
247
337
#: library/asyncio-dev.rst:227
248
338
msgid ""
249
339
":ref:`Enable the debug mode <asyncio-debug-mode>` to get the traceback where "
250
340
"the task was created::"
251
341
msgstr ""
342
+ ":ref:`Activez le mode débogage <asyncio-debug-mode>` pour récupérer la trace "
343
+ "d'appels indiquant où la tâche a été créée ::"
0 commit comments