You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"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 2.4.3\n"
16
17
17
18
#:library/contextvars.rst:2
18
19
msgid":mod:`contextvars` --- Context Variables"
19
-
msgstr""
20
+
msgstr":mod:`contextvars` --- Variables de contexte"
20
21
21
22
#:library/contextvars.rst:11
22
23
msgid""
@@ -26,37 +27,54 @@ msgid ""
26
27
"the :class:`~contextvars.Context` class should be used to manage the current "
27
28
"context in asynchronous frameworks."
28
29
msgstr""
30
+
"Ce module fournit des API pour gérer, stocker et accéder à l'état local de "
31
+
"contexte. La classe :class:`~contextvars.ContextVar` est utilisée pour "
32
+
"déclarer et travailler avec les *Variables de contexte*. La fonction :func:"
33
+
"`~contextvars.copy_context` et la classe :class:`~contextvars.Context` "
34
+
"doivent être utilisées pour la gestion du contexte actuel dans les "
35
+
"cadriciels asynchrones."
29
36
30
37
#:library/contextvars.rst:17
31
38
msgid""
32
39
"Context managers that have state should use Context Variables instead of :"
33
40
"func:`threading.local()` to prevent their state from bleeding to other code "
34
41
"unexpectedly, when used in concurrent code."
35
42
msgstr""
43
+
"Les gestionnaires de contexte, quand ils ont un état et quand ils sont "
44
+
"utilisés dans du code s'exécutant de manière concurrente, doivent utiliser "
45
+
"les variables de contexte au lieu de :func:`threading.local()` pour empêcher "
46
+
"que leur état déborde dans d'autre code de manière inattendue."
36
47
37
48
#:library/contextvars.rst:21
38
49
msgid"See also :pep:`567` for additional details."
39
-
msgstr""
50
+
msgstr"Voir aussi :pep:`567` pour plus de détails."
40
51
41
52
#:library/contextvars.rst:27
42
53
msgid"Context Variables"
43
-
msgstr""
54
+
msgstr"Variables de contexte"
44
55
45
56
#:library/contextvars.rst:31
46
57
msgid"This class is used to declare a new Context Variable, e.g.::"
47
58
msgstr""
59
+
"Cette classe est utilisée pour déclarer une nouvelle variable de contexte, "
60
+
"p. ex. ::"
48
61
49
62
#:library/contextvars.rst:35
50
63
msgid""
51
64
"The required *name* parameter is used for introspection and debug purposes."
52
65
msgstr""
66
+
"Le paramètre requis *name* est utilisé à des fins d'introspection et de "
67
+
"débogage."
53
68
54
69
#:library/contextvars.rst:38
55
70
msgid""
56
71
"The optional keyword-only *default* parameter is returned by :meth:"
57
72
"`ContextVar.get` when no value for the variable is found in the current "
58
73
"context."
59
74
msgstr""
75
+
"Le paramètre par mot-clé uniquement *default* est renvoyé par :meth:"
76
+
"`ContextVar.get` quand aucune valeur n'est trouvée dans le contexte actuel "
77
+
"pour la variable."
60
78
61
79
#:library/contextvars.rst:42
62
80
msgid""
@@ -65,57 +83,77 @@ msgid ""
65
83
"context variables which prevents context variables from being properly "
66
84
"garbage collected."
67
85
msgstr""
86
+
"**Important :** Les variables de contexte doivent être créées au plus haut "
87
+
"niveau du module et jamais dans des fermetures (*closures*). Les objets :"
88
+
"class:`Context` tiennent des références fortes aux variables de contexte ce "
89
+
"qui empêche que les variables de contexte se fassent collecter par le "
90
+
"ramasse-miette."
68
91
69
92
#:library/contextvars.rst:49
70
93
msgid"The name of the variable. This is a read-only property."
71
-
msgstr""
94
+
msgstr"Le nom de la variable. Cette propriété est en lecture seule."
72
95
73
96
#:library/contextvars.rst:55
74
97
msgid"Return a value for the context variable for the current context."
75
98
msgstr""
99
+
"Renvoie une valeur pour la variable de contexte pour le contexte actuel."
76
100
77
101
#:library/contextvars.rst:57
78
102
msgid""
79
103
"If there is no value for the variable in the current context, the method "
80
104
"will:"
81
105
msgstr""
106
+
"S'il n'y a pas de valeur pour la variable dans le contexte actuel, la "
107
+
"méthode :"
82
108
83
109
#:library/contextvars.rst:60
84
110
msgid""
85
111
"return the value of the *default* argument of the method, if provided; or"
86
-
msgstr""
112
+
msgstr"renvoie la valeur de l'argument *default* de la méthode, si fournie ;"
87
113
88
114
#:library/contextvars.rst:63
89
115
msgid""
90
116
"return the default value for the context variable, if it was created with "
91
117
"one; or"
92
118
msgstr""
119
+
"ou renvoie la valeur par défaut de la variable de contexte, si elle a été "
120
+
"créée avec une valeur par défaut ;"
93
121
122
+
# padpo se plaint ici pour le verbe lever mais on peut l'ignorer pour préserver le présent de l'indicatif en accord avec les "renvoie" dans les autres items de la liste.
94
123
#:library/contextvars.rst:66
95
124
msgid"raise a :exc:`LookupError`."
96
-
msgstr""
125
+
msgstr"ou lève une erreur :exc:`LookupError`."
97
126
98
127
#:library/contextvars.rst:70
99
128
msgid""
100
129
"Call to set a new value for the context variable in the current context."
101
130
msgstr""
131
+
"Appel pour assigner une nouvelle valeur pour la variable de contexte dans le "
132
+
"contexte actuel."
102
133
103
134
#:library/contextvars.rst:73
104
135
msgid""
105
136
"The required *value* argument is the new value for the context variable."
106
137
msgstr""
138
+
"L'argument requis *value* est la nouvelle valeur pour la variable de "
139
+
"contexte."
107
140
108
141
#:library/contextvars.rst:76
109
142
msgid""
110
143
"Returns a :class:`~contextvars.Token` object that can be used to restore the "
111
144
"variable to its previous value via the :meth:`ContextVar.reset` method."
112
145
msgstr""
146
+
"Renvoie un objet :class:`~contextvars.Token` qui peut être utilisé pour "
147
+
"rétablir la variable à sa valeur précédente par la méthode :meth:`ContextVar."
148
+
"reset`."
113
149
114
150
#:library/contextvars.rst:82
115
151
msgid""
116
152
"Reset the context variable to the value it had before the :meth:`ContextVar."
117
153
"set` that created the *token* was used."
118
154
msgstr""
155
+
"Réinitialise la variable de contexte à la valeur qu'elle avait avant que le :"
156
+
"meth:`ContextVar.set` qui a créé le *token* a été utilisé."
119
157
120
158
#:library/contextvars.rst:85
121
159
msgid"For example::"
@@ -127,124 +165,165 @@ msgid ""
127
165
"be passed to the :meth:`ContextVar.reset` method to revert the value of the "
128
166
"variable to what it was before the corresponding *set*."
129
167
msgstr""
168
+
"Les objets *Token* sont renvoyés par la méthode :meth:`ContextVar.set`. Ils "
169
+
"peuvent être passés à la méthode :meth:`ContextVar.reset` pour réaffecter la "
170
+
"valeur de la variable à ce qu'elle était avant le *set* correspondant."
130
171
131
172
#:library/contextvars.rst:106
132
173
msgid""
133
174
"A read-only property. Points to the :class:`ContextVar` object that created "
134
175
"the token."
135
176
msgstr""
177
+
"Une propriété en lecture seule. Pointe vers l'objet :class:`ContextVar` qui "
178
+
"a créé le token."
136
179
137
180
#:library/contextvars.rst:111
138
181
msgid""
139
182
"A read-only property. Set to the value the variable had before the :meth:"
140
183
"`ContextVar.set` method call that created the token. It points to :attr:"
141
184
"`Token.MISSING` is the variable was not set before the call."
142
185
msgstr""
186
+
"Une propriété en lecture seule. Elle prend la valeur que la variable avait "
187
+
"avant l'appel à la méthode :meth:`ContextVar.set` qui a créé le jeton. Elle "
188
+
"pointe à :attr:`Token.MISSING` si la variable n'est pas définie avant "
189
+
"l'appel."
143
190
144
191
#:library/contextvars.rst:118
145
192
msgid"A marker object used by :attr:`Token.old_value`."
146
-
msgstr""
193
+
msgstr"Un objet marqueur utilisé par :attr:`Token.old_value`."
147
194
148
195
#:library/contextvars.rst:122
149
196
msgid"Manual Context Management"
150
-
msgstr""
197
+
msgstr"Gestion de contexte manuelle"
151
198
152
199
#:library/contextvars.rst:126
153
200
msgid"Returns a copy of the current :class:`~contextvars.Context` object."
154
-
msgstr""
201
+
msgstr"Renvoie une copie de l'objet :class:`~contextvars.Context` actuel."
155
202
156
203
#:library/contextvars.rst:128
157
204
msgid""
158
205
"The following snippet gets a copy of the current context and prints all "
159
206
"variables and their values that are set in it::"
160
207
msgstr""
208
+
"Le fragment de code qui suit obtient une copie du contexte actuel et affiche "
209
+
"toutes les variables et leurs valeurs définis dans ce contexte."
161
210
162
211
#:library/contextvars.rst:134
163
212
msgid""
164
213
"The function has an O(1) complexity, i.e. works equally fast for contexts "
165
214
"with a few context variables and for contexts that have a lot of them."
166
215
msgstr""
216
+
"La fonction a une complexité O(1), c.-à-d. elle fonctionne aussi rapidement "
217
+
"pour des contextes avec peu de variables de contexte que pour des contextes "
218
+
"qui en ont beaucoup."
167
219
168
220
#:library/contextvars.rst:141
169
221
msgid"A mapping of :class:`ContextVars <ContextVar>` to their values."
170
222
msgstr""
223
+
"Correspondance entre :class:`ContextVars <ContextVar>` et leurs valeurs."
171
224
172
225
#:library/contextvars.rst:143
173
226
msgid""
174
227
"``Context()`` creates an empty context with no values in it. To get a copy "
175
228
"of the current context use the :func:`~contextvars.copy_context` function."
176
229
msgstr""
230
+
"``Context()`` créé un contexte vide contenant aucune valeur. Pour obtenir "
231
+
"une copie du contexte actuel, utilisez la fonction :func:`~contextvars."
232
+
"copy_context`."
177
233
178
234
#:library/contextvars.rst:147
179
235
msgid"Context implements the :class:`collections.abc.Mapping` interface."
# padpo lance 3 warnings ici, mais en fait tout semble correct. Si on enlève les * de args/kwargs, il n'y a plus de warnings. Je suspecte un bug dans padpo.
239
+
# library/contextvars.po:238: warning: Incohérence : l’espace insécable à côté de l’espace sécable n’a pas d’effet. => ###ntexte sur lequel est appelée la méthode »run*. Ren###
240
+
# library/contextvars.po:238: warning: Il manque un espace. => ###xte sur lequel est appelée la méthode »run*. Renvoie###
241
+
# library/contextvars.po:238: warning: Mot inconnu : run => ###xte sur lequel est appelée la méthode »run*. Renvoie###
182
242
#:library/contextvars.rst:151
183
243
msgid""
184
244
"Execute ``callable(*args, **kwargs)`` code in the context object the *run* "
185
245
"method is called on. Return the result of the execution or propagate an "
186
246
"exception if one occurred."
187
247
msgstr""
248
+
"Exécute le code ``callable(*args, **kwargs)`` dans l'objet de contexte sur "
249
+
"lequel est appelée la méthode *run*. Renvoie le résultat de l'exécution ou "
250
+
"propage une exception s'il y en a une qui s'est produite."
188
251
189
252
#:library/contextvars.rst:155
190
253
msgid""
191
254
"Any changes to any context variables that *callable* makes will be contained "
192
255
"in the context object::"
193
256
msgstr""
257
+
"Tout changement apporté aux variables de contexte effectué par *callable* "
258
+
"sera contenu dans l'objet de contexte ::"
194
259
195
260
#:library/contextvars.rst:184
196
261
msgid""
197
262
"The method raises a :exc:`RuntimeError` when called on the same context "
198
263
"object from more than one OS thread, or when called recursively."
199
264
msgstr""
265
+
"La méthode lève un :exc:`RuntimeError` quand elle est appelée sur le même "
266
+
"objet de contexte depuis plus qu'un fil d'exécution de système "
267
+
"d'exploitation, ou quand elle est appelée récursivement."
200
268
201
269
#:library/contextvars.rst:190
202
270
msgid"Return a shallow copy of the context object."
203
-
msgstr""
271
+
msgstr"Renvoie une copie de surface de l'objet de contexte."
204
272
205
273
#:library/contextvars.rst:194
206
274
msgid""
207
275
"Return ``True`` if the *context* has a value for *var* set; return ``False`` "
208
276
"otherwise."
209
277
msgstr""
278
+
"Renvoie ``True`` si le *context* a une valeur pour *var* ; sinon renvoie "
279
+
"``False``."
210
280
211
281
#:library/contextvars.rst:199
212
282
msgid""
213
283
"Return the value of the *var* :class:`ContextVar` variable. If the variable "
214
284
"is not set in the context object, a :exc:`KeyError` is raised."
215
285
msgstr""
286
+
"Renvoie la valeur de la variable :class:`ContextVar` *var*. Si la variable "
287
+
"n'est pas définie dans l'objet de contexte, :exc:`KeyError` est levée."
216
288
217
289
#:library/contextvars.rst:205
218
290
msgid""
219
291
"Return the value for *var* if *var* has the value in the context object. "
220
292
"Return *default* otherwise. If *default* is not given, return ``None``."
221
293
msgstr""
294
+
"Renvoie la valeur de *var* si *var* a la valeur dans l'objet de contexte. "
295
+
"Renvoie *default* sinon. Si *default* n'est pas donné, renvoie ``None``."
222
296
223
297
#:library/contextvars.rst:211
224
298
msgid"Return an iterator over the variables stored in the context object."
225
299
msgstr""
300
+
"Renvoie un itérateur sur les variables stockées dans l'objet de contexte."
226
301
227
302
#:library/contextvars.rst:216
228
303
msgid"Return the number of variables set in the context object."
229
-
msgstr""
304
+
msgstr"Renvoie le nombre de variables définies dans l'objet de contexte."
230
305
231
306
#:library/contextvars.rst:220
232
307
msgid"Return a list of all variables in the context object."
233
-
msgstr""
308
+
msgstr"Renvoie une liste de toutes les variables dans l'objet de contexte."
234
309
235
310
#:library/contextvars.rst:224
236
311
msgid"Return a list of all variables' values in the context object."
237
312
msgstr""
313
+
"Renvoie une liste de toutes les valeurs des variables dans l'objet de "
314
+
"contexte."
238
315
239
316
#:library/contextvars.rst:229
240
317
msgid""
241
318
"Return a list of 2-tuples containing all variables and their values in the "
242
319
"context object."
243
320
msgstr""
321
+
"Renvoie une liste de paires contenant toutes les variables et leurs valeurs "
322
+
"dans l'objet de contexte."
244
323
245
324
#:library/contextvars.rst:234
246
325
msgid"asyncio support"
247
-
msgstr""
326
+
msgstr"Support *asyncio*"
248
327
249
328
#:library/contextvars.rst:236
250
329
msgid""
@@ -253,3 +332,8 @@ msgid ""
253
332
"server, that uses a context variable to make the address of a remote client "
254
333
"available in the Task that handles that client::"
255
334
msgstr""
335
+
"Les variables de contexte sont nativement supportées dans :mod:`asyncio` et "
336
+
"sont prêtes à être utilisées sans configuration supplémentaire. Par exemple, "
337
+
"voici un serveur *echo* simple qui utilise une variable de contexte pour "
338
+
"rendre l’adresse d'un client distant disponible dans le *Task* qui gère ce "
0 commit comments