@@ -249,6 +249,8 @@ msgid ""
249
249
"How do I catch the output from PyErr_Print() (or anything that prints to "
250
250
"stdout/stderr)?"
251
251
msgstr ""
252
+ "Como posso capturar a saída da função PyErr_Print() (ou qualquer outra coisa "
253
+ "que escreva para stdout/stderr)?"
252
254
253
255
#: ../../faq/extending.rst:144
254
256
msgid ""
@@ -257,22 +259,28 @@ msgid ""
257
259
"print_error, or just allow the standard traceback mechanism to work. Then, "
258
260
"the output will go wherever your ``write()`` method sends it."
259
261
msgstr ""
262
+ "Com código Python, defina um objeto que suporte o método ``write()``. "
263
+ "Atribua esse objeto a :data:`sys.stdout` e :data:`sys.stderr`. Chame "
264
+ "print_error, or simplesmente deixe o mecanismo padrão de traceback "
265
+ "acontecer. Assim, a saída irá para onde quer que o seu método ``write()`` a "
266
+ "envie."
260
267
261
268
#: ../../faq/extending.rst:149
262
269
msgid "The easiest way to do this is to use the :class:`io.StringIO` class:"
263
- msgstr ""
270
+ msgstr "O jeito mais fácil de fazer isso é usar a classe :class:`io.StringIO`: "
264
271
265
272
#: ../../faq/extending.rst:161
266
273
msgid "A custom object to do the same would look like this:"
267
274
msgstr "Um objeto personalizado para fazer a mesma coisa seria esse:"
268
275
269
276
#: ../../faq/extending.rst:182
270
277
msgid "How do I access a module written in Python from C?"
271
- msgstr ""
278
+ msgstr "Como faço para acessar a partir do C um módulo escrito em Python? "
272
279
273
280
#: ../../faq/extending.rst:184
274
281
msgid "You can get a pointer to the module object as follows::"
275
282
msgstr ""
283
+ "Você pode obter um pointeiro para o objeto de módulo da seguinte maneira::"
276
284
277
285
#: ../../faq/extending.rst:188
278
286
msgid ""
@@ -282,22 +290,31 @@ msgid ""
282
290
"module into any namespace -- it only ensures it has been initialized and is "
283
291
"stored in :data:`sys.modules`."
284
292
msgstr ""
293
+ "Se o módulo ainda não foi importado (isto é, ainda não aparece no :data:`sys."
294
+ "modules`), essa função vai inicializar o módulo; caso contrário, ela vai "
295
+ "simplesmente retornar o valor de ``sys.modules[\" <modulename>\" ]``. Note "
296
+ "que ela não adiciona o módulo a nenhum espaço de nomes -- ela simplesmente "
297
+ "garante que ele foi inicializado e colocado no :data:`sys.modules`."
285
298
286
299
#: ../../faq/extending.rst:194
287
300
msgid ""
288
301
"You can then access the module's attributes (i.e. any name defined in the "
289
302
"module) as follows::"
290
303
msgstr ""
304
+ "Você pode então acessar os atributos do módulo (isto é, qualquer nome "
305
+ "definido no módulo) assim::"
291
306
292
307
#: ../../faq/extending.rst:199
293
308
msgid ""
294
309
"Calling :c:func:`PyObject_SetAttrString` to assign to variables in the "
295
310
"module also works."
296
311
msgstr ""
312
+ "Chamar :c:func:`PyObject_SetAttrString` para definir variáveis no módulo "
313
+ "também funciona."
297
314
298
315
#: ../../faq/extending.rst:204
299
316
msgid "How do I interface to C++ objects from Python?"
300
- msgstr ""
317
+ msgstr "Como posso interagir com objetos C++ a partir do Python? "
301
318
302
319
#: ../../faq/extending.rst:206
303
320
msgid ""
@@ -308,45 +325,60 @@ msgid ""
308
325
"building a new Python type around a C structure (pointer) type will also "
309
326
"work for C++ objects."
310
327
msgstr ""
328
+ "Dependendo das suas necessidades, há diversas abordagens. Para fazer isso "
329
+ "manualmente, comece lendo :ref:`o documento \" Estendendo e Incorporando\" "
330
+ "<extending-index>`. Note que, para o sistema Python em tempo de execução, "
331
+ "não há muita diferença entre C e C++ -- de forma que a estratégia de "
332
+ "construir um novo tipo Python ao redor de uma estrutura C (ou ponteiro para "
333
+ "uma) também funciona para objetos C++."
311
334
312
335
#: ../../faq/extending.rst:212
313
336
msgid "For C++ libraries, see :ref:`c-wrapper-software`."
314
- msgstr ""
337
+ msgstr "Para bibliotecas C++, veja :ref:`c-wrapper-software`. "
315
338
316
339
#: ../../faq/extending.rst:216
317
340
msgid "I added a module using the Setup file and the make fails; why?"
318
- msgstr ""
341
+ msgstr "Adicionei um módulo usando o arquivo de Setup e o make falha; por quê? "
319
342
320
343
#: ../../faq/extending.rst:218
321
344
msgid ""
322
345
"Setup must end in a newline, if there is no newline there, the build process "
323
346
"fails. (Fixing this requires some ugly shell script hackery, and this bug "
324
347
"is so minor that it doesn't seem worth the effort.)"
325
348
msgstr ""
349
+ "O Setup deve terminar com uma quebra de linha; se não houver uma quebra de "
350
+ "linha no final, o processo de compilação falha. (Consertar isso requer umas "
351
+ "gambiarras feias em shell script, e esse bug é tão pequeno que o esforço não "
352
+ "parece valer a pena.)"
326
353
327
354
#: ../../faq/extending.rst:224
328
355
msgid "How do I debug an extension?"
329
- msgstr ""
356
+ msgstr "Como eu depuro uma extensão? "
330
357
331
358
#: ../../faq/extending.rst:226
332
359
msgid ""
333
360
"When using GDB with dynamically loaded extensions, you can't set a "
334
361
"breakpoint in your extension until your extension is loaded."
335
362
msgstr ""
363
+ "Ao usar o GDB com extensões carregadas dinamicamente, você não consegue "
364
+ "definir um ponto de interrupção antes da sua extensão ser carregada."
336
365
337
366
#: ../../faq/extending.rst:229
338
367
msgid "In your ``.gdbinit`` file (or interactively), add the command:"
339
368
msgstr ""
369
+ "No seu arquivo ``.gdbinit`` (ou então interativamente), adicione o comando:"
340
370
341
371
#: ../../faq/extending.rst:235
342
372
msgid "Then, when you run GDB:"
343
- msgstr ""
373
+ msgstr "Então, ao executar o GDB: "
344
374
345
375
#: ../../faq/extending.rst:247
346
376
msgid ""
347
377
"I want to compile a Python module on my Linux system, but some files are "
348
378
"missing. Why?"
349
379
msgstr ""
380
+ "Quero compilar um módulo Python no meu sistema Linux, mas alguns arquivos "
381
+ "estão faltando. Por quê?"
350
382
351
383
#: ../../faq/extending.rst:249
352
384
msgid ""
@@ -365,7 +397,7 @@ msgstr ""
365
397
366
398
#: ../../faq/extending.rst:259
367
399
msgid "How do I tell \" incomplete input\" from \" invalid input\" ?"
368
- msgstr ""
400
+ msgstr "Como posso distinguir \" entrada incompleta \" de \" entrada inválida \" ? "
369
401
370
402
#: ../../faq/extending.rst:261
371
403
msgid ""
0 commit comments