Forward porting faq/extending.po

Co-Authored-By: Zepmanbc <zepman@gmail.com>
This commit is contained in:
Julien Palard 2019-10-16 14:52:41 +02:00
parent d4af9ad9af
commit 1effbe8790
3 changed files with 164 additions and 15 deletions

View File

@ -32,10 +32,15 @@ msgid ""
"exceptions and even new types in C. This is explained in the document :ref:" "exceptions and even new types in C. This is explained in the document :ref:"
"`extending-index`." "`extending-index`."
msgstr "" msgstr ""
"Oui, vous pouvez créer des modules intégrés contenant des fonctions, des "
"variables, des exceptions et même de nouveaux types en C. Ceci est expliqué "
"dans le document :ref:`extending-index`."
#: ../Doc/faq/extending.rst:22 #: ../Doc/faq/extending.rst:22
msgid "Most intermediate or advanced Python books will also cover this topic." msgid "Most intermediate or advanced Python books will also cover this topic."
msgstr "" msgstr ""
"La plupart des livres Python intermédiaires ou avancés couvrent également ce "
"sujet."
#: ../Doc/faq/extending.rst:26 #: ../Doc/faq/extending.rst:26
msgid "Can I create my own functions in C++?" msgid "Can I create my own functions in C++?"
@ -74,6 +79,11 @@ msgid ""
"Cython and Pyrex make it possible to write an extension without having to " "Cython and Pyrex make it possible to write an extension without having to "
"learn Python's C API." "learn Python's C API."
msgstr "" msgstr ""
"`Cython <http://cython.org>`_ et son cousin `Pyrex <https://www.cosc."
"canterbury.ac.nz/greg.ewing/python/Pyrex/>`_ sont des compilateurs qui "
"acceptent une forme légèrement modifiée de Python et produisent du code C "
"correspondant. Cython et Pyrex permettent d'écrire une extension sans avoir "
"à connaître l'API C de Python."
#: ../Doc/faq/extending.rst:50 #: ../Doc/faq/extending.rst:50
msgid "" msgid ""
@ -85,10 +95,19 @@ msgid ""
"html>`_, or `Weave <https://github.com/scipy/weave>`_ are also alternatives " "html>`_, or `Weave <https://github.com/scipy/weave>`_ are also alternatives "
"for wrapping C++ libraries." "for wrapping C++ libraries."
msgstr "" msgstr ""
"Si vous avez besoin d'accéder à l'interface d'une bibliothèque C ou C++ pour "
"laquelle aucune extension Python n'existe à ce jour, vous pouvez essayer "
"d'encapsuler les types de données et fonctions de la bibliothèque avec un "
"outil tel que `SWIG <http://www.swig.org>`_. `SIP <https://"
"riverbankcomputing.com/software/sip/intro>`__, `CXX <http://cxx.sourceforge."
"net/>`_, `Boost <http://www.boost.org/libs/python/doc/index.html>`_ ou "
"`Weave <https://github.com/scipy/weave>`_ sont également des alternatives "
"pour encapsuler des bibliothèques C++."
#: ../Doc/faq/extending.rst:61 #: ../Doc/faq/extending.rst:61
msgid "How can I execute arbitrary Python statements from C?" msgid "How can I execute arbitrary Python statements from C?"
msgstr "" msgstr ""
"Comment puis-je exécuter des instructions quelconques Python à partir de C ?"
#: ../Doc/faq/extending.rst:63 #: ../Doc/faq/extending.rst:63
msgid "" msgid ""
@ -99,10 +118,18 @@ msgid ""
"func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in " "func:`PyRun_String`; see the source for :c:func:`PyRun_SimpleString` in "
"``Python/pythonrun.c``." "``Python/pythonrun.c``."
msgstr "" msgstr ""
"La fonction de plus haut niveau pour ce faire est :c:func:"
"`PyRun_SimpleStringString` qui prend une chaîne pour seul argument afin de "
"l'exécuter dans le contexte du module ``__main__`` et renvoie ``0`` en cas "
"de succès et ``-1`` quand une exception se produit (incluant :exc:"
"`SyntaxError`). Pour une meilleure maîtrise, utilisez :c:func:"
"`PyRun_String` ; voir le code source pour :c:func:`PyRun_SimpleString` dans "
"``Python/pythonrun.c``."
#: ../Doc/faq/extending.rst:72 #: ../Doc/faq/extending.rst:72
msgid "How can I evaluate an arbitrary Python expression from C?" msgid "How can I evaluate an arbitrary Python expression from C?"
msgstr "" msgstr ""
"Comment puis-je évaluer une expression quelconque de Python à partir de C ?"
#: ../Doc/faq/extending.rst:74 #: ../Doc/faq/extending.rst:74
msgid "" msgid ""
@ -110,10 +137,13 @@ msgid ""
"start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it " "start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it "
"and returns its value." "and returns its value."
msgstr "" msgstr ""
"Appelez la fonction :c:func:`PyRun_String` de la question précédente avec le "
"symbole de départ :c:data:`Py_eval_input` ; il analyse une expression, "
"l'évalue et renvoie sa valeur."
#: ../Doc/faq/extending.rst:80 #: ../Doc/faq/extending.rst:80
msgid "How do I extract C values from a Python object?" msgid "How do I extract C values from a Python object?"
msgstr "" msgstr "Comment puis-je extraire des donnés en C d'un objet Python ?"
#: ../Doc/faq/extending.rst:82 #: ../Doc/faq/extending.rst:82
msgid "" msgid ""
@ -122,6 +152,10 @@ msgid ""
"specified index. Lists have similar functions, :c:func:`PyListSize` and :c:" "specified index. Lists have similar functions, :c:func:`PyListSize` and :c:"
"func:`PyList_GetItem`." "func:`PyList_GetItem`."
msgstr "" msgstr ""
"Cela dépend du type d'objet. Si c'est un tuple, :c:func:`PyTuple_Size` "
"renvoie sa longueur et :c:func:`PyTuple_GetItem` renvoie l'élément à l'index "
"spécifié. Les listes ont des fonctions similaires, :c:func:`PyListSize` et :"
"c:func:`PyList_GetItem`."
#: ../Doc/faq/extending.rst:87 #: ../Doc/faq/extending.rst:87
msgid "" msgid ""
@ -130,6 +164,10 @@ msgid ""
"Note that Python bytes objects may contain null bytes so C's :c:func:" "Note that Python bytes objects may contain null bytes so C's :c:func:"
"`strlen` should not be used." "`strlen` should not be used."
msgstr "" msgstr ""
"Pour les bytes, :c:func:`PyBytes_Size` renvoie sa longueur et :c:func:"
"`PyBytes_AsStringAndSize` fournit un pointeur vers sa valeur et sa longueur. "
"Notez que les objets bytes en Python peuvent contenir des valeurs nulles, "
"c'est pourquoi il ne faut pas utiliser la fonction C :c:func:`strlen`."
#: ../Doc/faq/extending.rst:92 #: ../Doc/faq/extending.rst:92
msgid "" msgid ""
@ -137,6 +175,9 @@ msgid ""
"use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:" "use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:"
"`PyList_Check`, etc." "`PyList_Check`, etc."
msgstr "" msgstr ""
"Pour tester le type d'un objet, assurez-vous d'abord qu'il n'est pas *NULL*, "
"puis utilisez :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:"
"`PyList_Check`, etc."
#: ../Doc/faq/extending.rst:95 #: ../Doc/faq/extending.rst:95
msgid "" msgid ""
@ -147,18 +188,26 @@ msgid ""
"as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et " "as many other useful protocols such as numbers (:c:func:`PyNumber_Index` et "
"al.) and mappings in the PyMapping APIs." "al.) and mappings in the PyMapping APIs."
msgstr "" msgstr ""
"Il y a aussi une API de haut niveau pour les objets Python qui est fournie "
"par l'interface dite « abstraite » — voir ``Include/abstract.h`` pour plus "
"de détails. Elle permet l'interfaçage avec tout type de séquence Python en "
"utilisant des appels tels que :c:func:`PySequence_Length`, :c:func:"
"`PySequence_GetItem`, etc. ainsi que de nombreux autres protocoles utiles "
"tels que les nombres (:c:func:`PyNumber_Index` et autres) et les "
"correspondances dans les APIs PyMapping."
#: ../Doc/faq/extending.rst:104 #: ../Doc/faq/extending.rst:104
msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?" msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?"
msgstr "" msgstr ""
"Comment utiliser Py_BuildValue() pour créer un tuple de longueur définie ?"
#: ../Doc/faq/extending.rst:106 #: ../Doc/faq/extending.rst:106
msgid "You can't. Use :c:func:`PyTuple_Pack` instead." msgid "You can't. Use :c:func:`PyTuple_Pack` instead."
msgstr "" msgstr "Vous ne pouvez pas. Utilisez :c:func:`PyTuple_Pack` à la place."
#: ../Doc/faq/extending.rst:110 #: ../Doc/faq/extending.rst:110
msgid "How do I call an object's method from C?" msgid "How do I call an object's method from C?"
msgstr "" msgstr "Comment puis-je appeler la méthode d'un objet à partir de C ?"
#: ../Doc/faq/extending.rst:112 #: ../Doc/faq/extending.rst:112
msgid "" msgid ""
@ -167,6 +216,10 @@ msgid ""
"to call, a format string like that used with :c:func:`Py_BuildValue`, and " "to call, a format string like that used with :c:func:`Py_BuildValue`, and "
"the argument values::" "the argument values::"
msgstr "" msgstr ""
"La fonction :c:func:`PyObject_CallMethod` peut être utilisée pour appeler la "
"méthode d'un objet. Les paramètres sont l'objet, le nom de la méthode à "
"appeler, une chaîne de caractères comme celle utilisée pour :c:func:"
"`Py_BuildValue` et les valeurs des arguments ::"
#: ../Doc/faq/extending.rst:121 #: ../Doc/faq/extending.rst:121
msgid "" msgid ""
@ -174,12 +227,17 @@ msgid ""
"defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the " "defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the "
"return value." "return value."
msgstr "" msgstr ""
"Cela fonctionne pour tous les objets qui ont des méthodes — qu'elles soient "
"intégrées ou définies par l'utilisateur. Vous êtes responsable de « :c:func:"
"`Py_DECREF`\\ *er* » la valeur de retour à la fin."
#: ../Doc/faq/extending.rst:124 #: ../Doc/faq/extending.rst:124
msgid "" msgid ""
"To call, e.g., a file object's \"seek\" method with arguments 10, 0 " "To call, e.g., a file object's \"seek\" method with arguments 10, 0 "
"(assuming the file object pointer is \"f\")::" "(assuming the file object pointer is \"f\")::"
msgstr "" msgstr ""
"Pour appeler, p. ex., la méthode *seek* d'un objet *file* avec les arguments "
"10, 0 (en supposant que le pointeur de l'objet fichier est *f*) ::"
#: ../Doc/faq/extending.rst:135 #: ../Doc/faq/extending.rst:135
msgid "" msgid ""
@ -188,12 +246,18 @@ msgid ""
"format, and to call a function with one argument, surround the argument in " "format, and to call a function with one argument, surround the argument in "
"parentheses, e.g. \"(i)\"." "parentheses, e.g. \"(i)\"."
msgstr "" msgstr ""
"Notez que :c:func:`PyObject_CallObject` veut *toujours* un tuple comme liste "
"d'arguments. Aussi, pour appeler une fonction sans arguments, utilisez "
"\"()\" pour être conforme au type et, pour appeler une fonction avec un "
"paramètre, entourez-le de parenthèses, p. ex. \"(i)\"."
#: ../Doc/faq/extending.rst:142 #: ../Doc/faq/extending.rst:142
msgid "" msgid ""
"How do I catch the output from PyErr_Print() (or anything that prints to " "How do I catch the output from PyErr_Print() (or anything that prints to "
"stdout/stderr)?" "stdout/stderr)?"
msgstr "" msgstr ""
"Comment puis-je récupérer la sortie de ``PyErr_Print()`` (ou tout ce qui "
"s'affiche sur *stdout*/*stderr*) ?"
#: ../Doc/faq/extending.rst:144 #: ../Doc/faq/extending.rst:144
msgid "" msgid ""
@ -202,22 +266,29 @@ msgid ""
"print_error, or just allow the standard traceback mechanism to work. Then, " "print_error, or just allow the standard traceback mechanism to work. Then, "
"the output will go wherever your ``write()`` method sends it." "the output will go wherever your ``write()`` method sends it."
msgstr "" msgstr ""
"Dans le code Python, définissez un objet qui possède la méthode ``write()``. "
"Affectez cet objet à :data:`sys.stdout` et :data:`sys.stderr`. Appelez "
"*print_error* ou faites simplement en sorte que le mécanisme standard de "
"remontée des erreurs fonctionne. Ensuite, la sortie sera dirigée vers "
"l'endroit où votre méthode ``write()`` écrit."
#: ../Doc/faq/extending.rst:149 #: ../Doc/faq/extending.rst:149
msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" msgid "The easiest way to do this is to use the :class:`io.StringIO` class:"
msgstr "" msgstr ""
"La façon la plus simple consiste à utiliser la classe :class:`io.StringIO` :"
#: ../Doc/faq/extending.rst:161 #: ../Doc/faq/extending.rst:161
msgid "A custom object to do the same would look like this:" msgid "A custom object to do the same would look like this:"
msgstr "" msgstr ""
"Le code d'un objet à la fonctionnalité similaire ressemblerait à ceci :"
#: ../Doc/faq/extending.rst:182 #: ../Doc/faq/extending.rst:182
msgid "How do I access a module written in Python from C?" msgid "How do I access a module written in Python from C?"
msgstr "" msgstr "Comment accéder à un module écrit en Python à partir de C ?"
#: ../Doc/faq/extending.rst:184 #: ../Doc/faq/extending.rst:184
msgid "You can get a pointer to the module object as follows::" msgid "You can get a pointer to the module object as follows::"
msgstr "" msgstr "Vous pouvez obtenir un pointeur sur l'objet module comme suit ::"
#: ../Doc/faq/extending.rst:188 #: ../Doc/faq/extending.rst:188
msgid "" msgid ""
@ -227,22 +298,32 @@ msgid ""
"module into any namespace -- it only ensures it has been initialized and is " "module into any namespace -- it only ensures it has been initialized and is "
"stored in :data:`sys.modules`." "stored in :data:`sys.modules`."
msgstr "" msgstr ""
"Si le module n'a pas encore été importé (c.-à-d. qu'il n'est pas encore "
"présent dans :data:`sys.modules`), cela initialise le module ; sinon il "
"renvoie simplement la valeur de ``sys.modules[\"<modulename>\"]``. Notez "
"qu'il n'inscrit le module dans aucun espace de nommage — il s'assure "
"seulement qu'il a été initialisé et qu'il est stocké dans :data:`sys."
"modules`."
#: ../Doc/faq/extending.rst:194 #: ../Doc/faq/extending.rst:194
msgid "" msgid ""
"You can then access the module's attributes (i.e. any name defined in the " "You can then access the module's attributes (i.e. any name defined in the "
"module) as follows::" "module) as follows::"
msgstr "" msgstr ""
"Vous pouvez alors accéder aux attributs du module (c.-à-d. à tout nom défini "
"dans le module) comme suit ::"
#: ../Doc/faq/extending.rst:199 #: ../Doc/faq/extending.rst:199
msgid "" msgid ""
"Calling :c:func:`PyObject_SetAttrString` to assign to variables in the " "Calling :c:func:`PyObject_SetAttrString` to assign to variables in the "
"module also works." "module also works."
msgstr "" msgstr ""
"Appeler :c:func:`PyObject_SetAttrString` pour assigner des valeurs aux "
"variables du module fonctionne également."
#: ../Doc/faq/extending.rst:204 #: ../Doc/faq/extending.rst:204
msgid "How do I interface to C++ objects from Python?" msgid "How do I interface to C++ objects from Python?"
msgstr "" msgstr "Comment s'interfacer avec les objets C++ depuis Python ?"
#: ../Doc/faq/extending.rst:206 #: ../Doc/faq/extending.rst:206
msgid "" msgid ""
@ -253,14 +334,22 @@ msgid ""
"building a new Python type around a C structure (pointer) type will also " "building a new Python type around a C structure (pointer) type will also "
"work for C++ objects." "work for C++ objects."
msgstr "" msgstr ""
"Selon vos besoins, de nombreuses approches sont possibles. Pour le faire "
"manuellement, commencez par lire :ref:`le document \"Extension et intégration"
"\" <extending-index>`. Sachez que pour le système d'exécution Python, il n'y "
"a pas beaucoup de différence entre C et C++ — donc la méthode pour "
"construire un nouveau type Python à partir d'une structure C (pointeur) "
"fonctionne également avec des objets en C++."
#: ../Doc/faq/extending.rst:212 #: ../Doc/faq/extending.rst:212
msgid "For C++ libraries, see :ref:`c-wrapper-software`." msgid "For C++ libraries, see :ref:`c-wrapper-software`."
msgstr "" msgstr "Pour les bibliothèques C++, voir :ref:`c-wrapper-software`."
#: ../Doc/faq/extending.rst:216 #: ../Doc/faq/extending.rst:216
msgid "I added a module using the Setup file and the make fails; why?" msgid "I added a module using the Setup file and the make fails; why?"
msgstr "" msgstr ""
"J'ai ajouté un module en utilisant le fichier *Setup* et la compilation "
"échoue ; pourquoi ?"
#: ../Doc/faq/extending.rst:218 #: ../Doc/faq/extending.rst:218
msgid "" msgid ""
@ -268,30 +357,40 @@ msgid ""
"fails. (Fixing this requires some ugly shell script hackery, and this bug " "fails. (Fixing this requires some ugly shell script hackery, and this bug "
"is so minor that it doesn't seem worth the effort.)" "is so minor that it doesn't seem worth the effort.)"
msgstr "" msgstr ""
"Le fichier *Setup* doit se terminer par une ligne vide, s'il n'y a pas de "
"ligne vide, le processus de compilation échoue (ce problème peut se régler "
"en bidouillant un script shell, et ce bogue est si mineur qu'il ne mérite "
"pas qu'on s'y attarde)."
#: ../Doc/faq/extending.rst:224 #: ../Doc/faq/extending.rst:224
msgid "How do I debug an extension?" msgid "How do I debug an extension?"
msgstr "" msgstr "Comment déboguer une extension ?"
#: ../Doc/faq/extending.rst:226 #: ../Doc/faq/extending.rst:226
msgid "" msgid ""
"When using GDB with dynamically loaded extensions, you can't set a " "When using GDB with dynamically loaded extensions, you can't set a "
"breakpoint in your extension until your extension is loaded." "breakpoint in your extension until your extension is loaded."
msgstr "" msgstr ""
"Lorsque vous utilisez GDB avec des extensions chargées dynamiquement, vous "
"ne pouvez pas placer de point d'arrêt dans votre extension tant que celle-ci "
"n'est pas chargée."
#: ../Doc/faq/extending.rst:229 #: ../Doc/faq/extending.rst:229
msgid "In your ``.gdbinit`` file (or interactively), add the command:" msgid "In your ``.gdbinit`` file (or interactively), add the command:"
msgstr "" msgstr ""
"Dans votre fichier ``.gdbinit`` (ou manuellement), ajoutez la commande :"
#: ../Doc/faq/extending.rst:235 #: ../Doc/faq/extending.rst:235
msgid "Then, when you run GDB:" msgid "Then, when you run GDB:"
msgstr "" msgstr "Ensuite, lorsque vous exécutez GDB :"
#: ../Doc/faq/extending.rst:247 #: ../Doc/faq/extending.rst:247
msgid "" msgid ""
"I want to compile a Python module on my Linux system, but some files are " "I want to compile a Python module on my Linux system, but some files are "
"missing. Why?" "missing. Why?"
msgstr "" msgstr ""
"Je veux compiler un module Python sur mon système Linux, mais il manque "
"certains fichiers. Pourquoi ?"
#: ../Doc/faq/extending.rst:249 #: ../Doc/faq/extending.rst:249
msgid "" msgid ""
@ -299,18 +398,25 @@ msgid ""
"{x}/config/` directory, which contains various files required for compiling " "{x}/config/` directory, which contains various files required for compiling "
"Python extensions." "Python extensions."
msgstr "" msgstr ""
"La plupart des versions pré-compilées de Python n'incluent pas le "
"répertoire :file:`/usr/lib/python2.{x}/config/`, qui contient les différents "
"fichiers nécessaires à la compilation des extensions Python."
#: ../Doc/faq/extending.rst:253 #: ../Doc/faq/extending.rst:253
msgid "For Red Hat, install the python-devel RPM to get the necessary files." msgid "For Red Hat, install the python-devel RPM to get the necessary files."
msgstr "" msgstr ""
"Pour Red Hat, installez le RPM *python-devel* pour obtenir les fichiers "
"nécessaires."
#: ../Doc/faq/extending.rst:255 #: ../Doc/faq/extending.rst:255
msgid "For Debian, run ``apt-get install python-dev``." msgid "For Debian, run ``apt-get install python-dev``."
msgstr "" msgstr "Pour Debian, exécutez ``apt-get install python-dev``."
#: ../Doc/faq/extending.rst:259 #: ../Doc/faq/extending.rst:259
msgid "How do I tell \"incomplete input\" from \"invalid input\"?" msgid "How do I tell \"incomplete input\" from \"invalid input\"?"
msgstr "" msgstr ""
"Comment distinguer une « entrée incomplète » (*incomplete input*) d'une "
 entrée invalide » (*invalid input*) ?"
#: ../Doc/faq/extending.rst:261 #: ../Doc/faq/extending.rst:261
msgid "" msgid ""
@ -320,12 +426,19 @@ msgid ""
"parentheses or triple string quotes), but it gives you a syntax error " "parentheses or triple string quotes), but it gives you a syntax error "
"message immediately when the input is invalid." "message immediately when the input is invalid."
msgstr "" msgstr ""
"Parfois vous souhaitez émuler le comportement de l'interpréteur interactif "
"Python, quand il vous donne une invite de continuation lorsque l'entrée est "
"incomplète (par exemple, vous avez tapé le début d'une instruction \"if\" ou "
"vous n'avez pas fermé vos parenthèses ou triple guillemets) mais il vous "
"renvoie immédiatement une erreur syntaxique quand la saisie est incorrecte."
#: ../Doc/faq/extending.rst:267 #: ../Doc/faq/extending.rst:267
msgid "" msgid ""
"In Python you can use the :mod:`codeop` module, which approximates the " "In Python you can use the :mod:`codeop` module, which approximates the "
"parser's behavior sufficiently. IDLE uses this, for example." "parser's behavior sufficiently. IDLE uses this, for example."
msgstr "" msgstr ""
"En Python, vous pouvez utiliser le module :mod:`codeop`, qui se rapproche "
"assez du comportement de l'analyseur. Par exemple, IDLE l'utilise."
#: ../Doc/faq/extending.rst:270 #: ../Doc/faq/extending.rst:270
msgid "" msgid ""
@ -335,6 +448,12 @@ msgid ""
"to point at your custom input function. See ``Modules/readline.c`` and " "to point at your custom input function. See ``Modules/readline.c`` and "
"``Parser/myreadline.c`` for more hints." "``Parser/myreadline.c`` for more hints."
msgstr "" msgstr ""
"La façon la plus simple de le faire en C est d'appeler :c:func:"
"`PyRun_InteractiveLoop` (peut-être dans un autre fil d'exécution) et laisser "
"l'interpréteur Python gérer l'entrée pour vous. Vous pouvez également "
"définir :c:func:`PyOS_ReadlineFunctionPointer` pour pointer vers votre "
"fonction d'entrée personnalisée. Voir ``Modules/readline.c`` et ``Parser/"
"myreadline.c`` pour plus de conseils."
#: ../Doc/faq/extending.rst:276 #: ../Doc/faq/extending.rst:276
msgid "" msgid ""
@ -345,6 +464,13 @@ msgid ""
"error`` equal to ``E_EOF``, which means the input is incomplete. Here's a " "error`` equal to ``E_EOF``, which means the input is incomplete. Here's a "
"sample code fragment, untested, inspired by code from Alex Farber::" "sample code fragment, untested, inspired by code from Alex Farber::"
msgstr "" msgstr ""
"Cependant, vous devez parfois exécuter l'interpréteur Python intégré dans le "
"même fil dexécution que le reste de votre application et vous ne pouvez pas "
"laisser :c:func:`PyRun_InteractiveLoop` attendre les entrées utilisateur. La "
"seule solution est alors d'appeler :c:func:`PyParser_ParseString` et de "
"tester si ``e.error`` égale ``E_EOF``, ce qui signifie que l'entrée est "
"incomplète. Voici un exemple de code, non testé, inspiré d'un code écrit par "
"Alex Farber ::"
#: ../Doc/faq/extending.rst:310 #: ../Doc/faq/extending.rst:310
msgid "" msgid ""
@ -357,10 +483,21 @@ msgid ""
"\". Here is a complete example using the GNU readline library (you may want " "\". Here is a complete example using the GNU readline library (you may want "
"to ignore **SIGINT** while calling readline())::" "to ignore **SIGINT** while calling readline())::"
msgstr "" msgstr ""
"Une autre solution est d'essayer de compiler la chaîne reçue avec :c:func:"
"`Py_CompileString`. Si cela se compile sans erreur, essayez d'exécuter "
"l'objet code renvoyé en appelant :c:func:`PyEval_EvalCode`. Sinon, "
"enregistrez l'entrée pour plus tard. Si la compilation échoue, vérifiez s'il "
"s'agit d'une erreur ou s'il faut juste plus de données — en extrayant la "
"chaîne de message du tuple d'exception et en la comparant à la chaîne *"
"\"unexpected EOF while parsing\"*. Voici un exemple complet d'utilisation de "
"la bibliothèque *readline* de GNU (il vous est possible d'ignorer **SIGINT** "
"lors de l'appel à ``readline()``) ::"
#: ../Doc/faq/extending.rst:432 #: ../Doc/faq/extending.rst:432
msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?" msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?"
msgstr "" msgstr ""
"Comment puis-je trouver les symboles g++ indéfinis ``__builtin_new`` ou "
"``__pure_virtual`` ?"
#: ../Doc/faq/extending.rst:434 #: ../Doc/faq/extending.rst:434
msgid "" msgid ""
@ -368,18 +505,27 @@ msgid ""
"it using g++ (change LINKCC in the Python Modules Makefile), and link your " "it using g++ (change LINKCC in the Python Modules Makefile), and link your "
"extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``)." "extension module using g++ (e.g., ``g++ -shared -o mymodule.so mymodule.o``)."
msgstr "" msgstr ""
"Pour charger dynamiquement les modules d'extension g++, vous devez "
"recompiler Python, effectuer l'édition de liens en utilisant g++ (modifiez "
"*LINKCC* dans le *Python Modules Makefile*), et effectuer l'édition de liens "
"de votre module d'extension avec g++ (par exemple, ``g++ -shared -o mymodule."
"so mymodule.o``)."
#: ../Doc/faq/extending.rst:440 #: ../Doc/faq/extending.rst:440
msgid "" msgid ""
"Can I create an object class with some methods implemented in C and others " "Can I create an object class with some methods implemented in C and others "
"in Python (e.g. through inheritance)?" "in Python (e.g. through inheritance)?"
msgstr "" msgstr ""
"Puis-je créer une classe d'objets avec certaines méthodes implémentées en C "
"et d'autres en Python (p. ex. en utilisant l'héritage) ?"
#: ../Doc/faq/extending.rst:442 #: ../Doc/faq/extending.rst:442
msgid "" msgid ""
"Yes, you can inherit from built-in classes such as :class:`int`, :class:" "Yes, you can inherit from built-in classes such as :class:`int`, :class:"
"`list`, :class:`dict`, etc." "`list`, :class:`dict`, etc."
msgstr "" msgstr ""
"Oui, vous pouvez hériter de classes intégrées telles que :class:`int`, :"
"class:`list`, :class:`dict`, etc."
#: ../Doc/faq/extending.rst:445 #: ../Doc/faq/extending.rst:445
msgid "" msgid ""
@ -387,3 +533,6 @@ msgid ""
"html) provides a way of doing this from C++ (i.e. you can inherit from an " "html) provides a way of doing this from C++ (i.e. you can inherit from an "
"extension class written in C++ using the BPL)." "extension class written in C++ using the BPL)."
msgstr "" msgstr ""
"La bibliothèque *Boost Python Library* (BPL, http://www.boost.org/libs/"
"python/doc/index.html) fournit un moyen de le faire depuis C++ (c.-à-d. que "
"vous pouvez hériter d'une classe d'extension écrite en C++ en utilisant BPL)."

View File

@ -148,7 +148,7 @@ msgstr ""
#: ../Doc/library/datetime.rst:68 #: ../Doc/library/datetime.rst:68
msgid "Constants" msgid "Constants"
msgstr "" msgstr "Constantes"
#: ../Doc/library/datetime.rst:70 #: ../Doc/library/datetime.rst:70
msgid "The :mod:`datetime` module exports the following constants:" msgid "The :mod:`datetime` module exports the following constants:"
@ -1356,7 +1356,7 @@ msgstr ""
#: ../Doc/library/datetime.rst:846 #: ../Doc/library/datetime.rst:846
msgid "Equivalent to::" msgid "Equivalent to::"
msgstr "" msgstr "Équivalent à ::"
#: ../Doc/library/datetime.rst:850 #: ../Doc/library/datetime.rst:850
msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgid "See also :meth:`now`, :meth:`fromtimestamp`."
@ -1656,7 +1656,7 @@ msgstr ""
#: ../Doc/library/datetime.rst:1034 #: ../Doc/library/datetime.rst:1034
msgid "This is equivalent to::" msgid "This is equivalent to::"
msgstr "" msgstr "Cest équivalent à ::"
#: ../Doc/library/datetime.rst:1038 #: ../Doc/library/datetime.rst:1038
#, fuzzy #, fuzzy
@ -2891,7 +2891,7 @@ msgstr ""
#: ../Doc/library/datetime.rst:2011 #: ../Doc/library/datetime.rst:2011
msgid "or::" msgid "or::"
msgstr "" msgstr "ou ::"
#: ../Doc/library/datetime.rst:2023 #: ../Doc/library/datetime.rst:2023
msgid "" msgid ""

View File

@ -476,7 +476,7 @@ msgstr ""
#: ../Doc/tutorial/errors.rst:354 #: ../Doc/tutorial/errors.rst:354
msgid "For example::" msgid "For example::"
msgstr "" msgstr "Par exemple ::"
#: ../Doc/tutorial/errors.rst:365 #: ../Doc/tutorial/errors.rst:365
msgid "A more complicated example::" msgid "A more complicated example::"