forked from python/python-docs-pt-br
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontextvars.po
More file actions
332 lines (287 loc) · 13 KB
/
contextvars.po
File metadata and controls
332 lines (287 loc) · 13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001-2021, Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# Rafael Fontenelle <rffontenelle@gmail.com>, 2021
# Claudio Rogerio Carvalho Filho <excriptbrasil@gmail.com>, 2021
# i17obot <i17obot@rougeth.com>, 2021
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2021-06-29 12:56+0000\n"
"PO-Revision-Date: 2021-06-28 00:57+0000\n"
"Last-Translator: i17obot <i17obot@rougeth.com>, 2021\n"
"Language-Team: Portuguese (Brazil) (https://www.transifex.com/python-doc/"
"teams/5390/pt_BR/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: pt_BR\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: ../../library/contextvars.rst:2
msgid ":mod:`contextvars` --- Context Variables"
msgstr ":mod:`contextvars` --- Variáveis de contexto"
#: ../../library/contextvars.rst:11
msgid ""
"This module provides APIs to manage, store, and access context-local state. "
"The :class:`~contextvars.ContextVar` class is used to declare and work with "
"*Context Variables*. The :func:`~contextvars.copy_context` function and "
"the :class:`~contextvars.Context` class should be used to manage the current "
"context in asynchronous frameworks."
msgstr ""
"Este módulo fornece APIs para gerenciar, armazenar e acessar o estado local "
"do contexto. A classe :class:`~contextvars.ContextVar` é usada para declarar "
"e trabalhar com *Variáveis de Contexto*. A função :func:`~contextvars."
"copy_context` e a classe :class:`~contextvars.Context` devem ser usadas para "
"gerenciar o contexto atual em frameworks assíncronos."
#: ../../library/contextvars.rst:17
msgid ""
"Context managers that have state should use Context Variables instead of :"
"func:`threading.local()` to prevent their state from bleeding to other code "
"unexpectedly, when used in concurrent code."
msgstr ""
"Os gerenciadores de contexto que possuem estado devem usar Variáveis de "
"Contexto ao invés de :func:`threading.local()` para evitar que seu estado "
"vaze para outro código inesperadamente, quando usado em código concorrente."
#: ../../library/contextvars.rst:21
msgid "See also :pep:`567` for additional details."
msgstr "Veja também a :pep:`567` para detalhes adicionais."
#: ../../library/contextvars.rst:27
msgid "Context Variables"
msgstr "Variáveis de contexto"
#: ../../library/contextvars.rst:31
msgid "This class is used to declare a new Context Variable, e.g.::"
msgstr ""
"Esta classe é usada para declarar uma nova variável de contexto, como, por "
"exemplo::"
#: ../../library/contextvars.rst:35
msgid ""
"The required *name* parameter is used for introspection and debug purposes."
msgstr ""
"O parâmetro obrigatório *name* é usado para fins de introspecção e depuração."
#: ../../library/contextvars.rst:38
msgid ""
"The optional keyword-only *default* parameter is returned by :meth:"
"`ContextVar.get` when no value for the variable is found in the current "
"context."
msgstr ""
"O parâmetro somente-nomeado opcional *default* é retornado por :meth:"
"`ContextVar.get` quando nenhum valor para a variável é encontrado no "
"contexto atual."
#: ../../library/contextvars.rst:42
msgid ""
"**Important:** Context Variables should be created at the top module level "
"and never in closures. :class:`Context` objects hold strong references to "
"context variables which prevents context variables from being properly "
"garbage collected."
msgstr ""
"**Importante:** Variáveis de Contexto devem ser criadas no nível do módulo "
"superior e nunca em fechamentos. Os objetos :class:`Context` contêm "
"referências fortes a variáveis de contexto que evitam que as variáveis de "
"contexto sejam coletadas como lixo corretamente."
#: ../../library/contextvars.rst:49
msgid "The name of the variable. This is a read-only property."
msgstr "O nome da variável. Esta é uma propriedade somente leitura."
#: ../../library/contextvars.rst:55
msgid "Return a value for the context variable for the current context."
msgstr "Retorna um valor para a variável de contexto para o contexto atual."
#: ../../library/contextvars.rst:57
msgid ""
"If there is no value for the variable in the current context, the method "
"will:"
msgstr "Se não houver valor para a variável no contexto atual, o método vai:"
#: ../../library/contextvars.rst:60
msgid ""
"return the value of the *default* argument of the method, if provided; or"
msgstr "retornar o valor do argumento *default* do método, se fornecido; ou"
#: ../../library/contextvars.rst:63
msgid ""
"return the default value for the context variable, if it was created with "
"one; or"
msgstr ""
"retornar o valor padrão para a variável de contexto, se ela foi criada com "
"uma; ou"
#: ../../library/contextvars.rst:66
msgid "raise a :exc:`LookupError`."
msgstr "levantar uma :exc:`LookupError`."
#: ../../library/contextvars.rst:70
msgid ""
"Call to set a new value for the context variable in the current context."
msgstr ""
"Chame para definir um novo valor para a variável de contexto no contexto "
"atual."
#: ../../library/contextvars.rst:73
msgid ""
"The required *value* argument is the new value for the context variable."
msgstr ""
"O argumento *value* obrigatório é o novo valor para a variável de contexto."
#: ../../library/contextvars.rst:76
msgid ""
"Returns a :class:`~contextvars.Token` object that can be used to restore the "
"variable to its previous value via the :meth:`ContextVar.reset` method."
msgstr ""
"Retorna um objeto :class:`~contextvars.Token` que pode ser usado para "
"restaurar a variável ao seu valor anterior através do método :meth:"
"`ContextVar.reset`."
#: ../../library/contextvars.rst:82
msgid ""
"Reset the context variable to the value it had before the :meth:`ContextVar."
"set` that created the *token* was used."
msgstr ""
"Redefine a variável de contexto para o valor que tinha antes de :meth:"
"`ContextVar.set`. que criou o *token*, ser usado."
#: ../../library/contextvars.rst:85
msgid "For example::"
msgstr "Por exemplo::"
#: ../../library/contextvars.rst:99
msgid ""
"*Token* objects are returned by the :meth:`ContextVar.set` method. They can "
"be passed to the :meth:`ContextVar.reset` method to revert the value of the "
"variable to what it was before the corresponding *set*."
msgstr ""
"Objetos *token* são retornados pelo método :meth:`ContextVar.set`. Eles "
"podem ser passados para o método :meth:`ContextVar.reset` para reverter o "
"valor da variável para o que era antes do *set* correspondente."
#: ../../library/contextvars.rst:106
msgid ""
"A read-only property. Points to the :class:`ContextVar` object that created "
"the token."
msgstr ""
"Uma propriedade somente leitura. Aponta para o objeto :class:`ContextVar` "
"que criou o token."
#: ../../library/contextvars.rst:111
msgid ""
"A read-only property. Set to the value the variable had before the :meth:"
"`ContextVar.set` method call that created the token. It points to :attr:"
"`Token.MISSING` is the variable was not set before the call."
msgstr ""
"Uma propriedade somente leitura. Defina com o valor que a variável tinha "
"antes da chamada do método :meth:`ContextVar.set` que criou o token. Ele "
"aponta para :attr:`Token.MISSING` é a variável não foi definida antes da "
"chamada."
#: ../../library/contextvars.rst:118
msgid "A marker object used by :attr:`Token.old_value`."
msgstr "Um objeto marcador usado por :attr:`Token.old_value`."
#: ../../library/contextvars.rst:122
msgid "Manual Context Management"
msgstr "Gerenciamento de contexto manual"
#: ../../library/contextvars.rst:126
msgid "Returns a copy of the current :class:`~contextvars.Context` object."
msgstr "Retorna uma cópia do objeto :class:`~contextvars.Context` atual."
#: ../../library/contextvars.rst:128
msgid ""
"The following snippet gets a copy of the current context and prints all "
"variables and their values that are set in it::"
msgstr ""
"O trecho a seguir obtém uma cópia do contexto atual e imprime todas as "
"variáveis e seus valores que são definidos nele::"
#: ../../library/contextvars.rst:134
msgid ""
"The function has an O(1) complexity, i.e. works equally fast for contexts "
"with a few context variables and for contexts that have a lot of them."
msgstr ""
"A função tem uma complexidade O(1), ou seja, funciona igualmente rápido para "
"contextos com algumas variáveis de contexto e para contextos que têm muitas "
"delas."
#: ../../library/contextvars.rst:141
msgid "A mapping of :class:`ContextVars <ContextVar>` to their values."
msgstr "Um mapeamento de :class:`ContextVars <ContextVar>` para seus valores."
#: ../../library/contextvars.rst:143
msgid ""
"``Context()`` creates an empty context with no values in it. To get a copy "
"of the current context use the :func:`~contextvars.copy_context` function."
msgstr ""
"``Context()`` cria um contexto vazio sem valores nele. Para obter uma cópia "
"do contexto atual, use a função :func:`~contextvars.copy_context`."
#: ../../library/contextvars.rst:147
msgid "Context implements the :class:`collections.abc.Mapping` interface."
msgstr "Context implementa a interface :class:`collections.abc.Mapping`."
#: ../../library/contextvars.rst:151
msgid ""
"Execute ``callable(*args, **kwargs)`` code in the context object the *run* "
"method is called on. Return the result of the execution or propagate an "
"exception if one occurred."
msgstr ""
"Executa o código ``callable(*args, **kwargs)`` no objeto contexto em que o "
"método *run* é chamado. Retorna o resultado da execução ou propaga uma "
"exceção, se ocorrer."
#: ../../library/contextvars.rst:155
msgid ""
"Any changes to any context variables that *callable* makes will be contained "
"in the context object::"
msgstr ""
"Quaisquer mudanças em quaisquer variáveis de contexto que *callable* faça "
"estarão contidas no objeto de contexto::"
#: ../../library/contextvars.rst:184
msgid ""
"The method raises a :exc:`RuntimeError` when called on the same context "
"object from more than one OS thread, or when called recursively."
msgstr ""
"O método levanta uma :exc:`RuntimeError` quando chamado no mesmo objeto de "
"contexto de mais de uma thread do sistema operacional, ou quando chamado "
"recursivamente."
#: ../../library/contextvars.rst:190
msgid "Return a shallow copy of the context object."
msgstr "Retorna uma cópia rasa do objeto contexto."
#: ../../library/contextvars.rst:194
msgid ""
"Return ``True`` if the *context* has a value for *var* set; return ``False`` "
"otherwise."
msgstr ""
"Retorna ``True`` se *context* tem uma variável para *var* definida; do "
"contrário, retorna ``False``."
#: ../../library/contextvars.rst:199
msgid ""
"Return the value of the *var* :class:`ContextVar` variable. If the variable "
"is not set in the context object, a :exc:`KeyError` is raised."
msgstr ""
"Retorna o valor da variável :class:`ContextVar` *var*. Se a variável não for "
"definida no objeto contexto, uma :exc:`KeyError` é levantada."
#: ../../library/contextvars.rst:205
msgid ""
"Return the value for *var* if *var* has the value in the context object. "
"Return *default* otherwise. If *default* is not given, return ``None``."
msgstr ""
"Retorna o valor para *var* se *var* tiver o valor no objeto contexto. Caso "
"contrário, retorna *default*. Se *default* não for fornecido, retorna "
"``None``."
#: ../../library/contextvars.rst:211
msgid "Return an iterator over the variables stored in the context object."
msgstr "Retorna um iterador sobre as variáveis armazenadas no objeto contexto."
#: ../../library/contextvars.rst:216
msgid "Return the number of variables set in the context object."
msgstr "Retorna o número das variáveis definidas no objeto contexto."
#: ../../library/contextvars.rst:220
msgid "Return a list of all variables in the context object."
msgstr "Retorna uma lista de todas as variáveis no objeto contexto."
#: ../../library/contextvars.rst:224
msgid "Return a list of all variables' values in the context object."
msgstr ""
"Retorna uma lista dos valores de todas as variáveis no objeto contexto."
#: ../../library/contextvars.rst:229
msgid ""
"Return a list of 2-tuples containing all variables and their values in the "
"context object."
msgstr ""
"Retorna uma lista de tuplas de 2 elementos contendo todas as variáveis e "
"seus valores no objeto contexto."
#: ../../library/contextvars.rst:234
msgid "asyncio support"
msgstr "Suporte a asyncio"
#: ../../library/contextvars.rst:236
msgid ""
"Context variables are natively supported in :mod:`asyncio` and are ready to "
"be used without any extra configuration. For example, here is a simple echo "
"server, that uses a context variable to make the address of a remote client "
"available in the Task that handles that client::"
msgstr ""
"Variáveis de contexto encontram suporte nativo em :mod:`asyncio` e estão "
"prontas para serem usadas sem qualquer configuração extra. Por exemplo, aqui "
"está um servidor simples de eco, que usa uma variável de contexto para "
"disponibilizar o endereço de um cliente remoto na Task que lida com esse "
"cliente::"