Premier jet de l'API de library/ctypes. (#1239)
* Premier jet. * Apply suggestions from code review Suggestion de @ChristopheNan Co-Authored-By: Christophe Nanteuil <35002064+christopheNan@users.noreply.github.com> * Suggestions de ChristopheNaN et de padpo. * Suggestions de ChristopheNaN. Co-authored-by: Christophe Nanteuil <35002064+christopheNan@users.noreply.github.com>
This commit is contained in:
parent 86b6ddc15d
commit 899f9ee755
1 changed files with 130 additions and 11 deletions
| | @ -6,14 +6,14 @@ msgstr "" | |||
"Project-Id-Version: Python 3\n" | ||||
"Report-Msgid-Bugs-To: \n" | ||||
"POT-Creation-Date: 2020-02-04 10:00+0100\n" | ||||
"PO-Revision-Date: 2018-07-29 19:07+0200\n" | ||||
"PO-Revision-Date: 2020-04-27 22:21+0200\n" | ||||
"Last-Translator: Antoine Wecxsteen\n" | ||||
"Language-Team: FRENCH <traductions@lists.afpy.org>\n" | ||||
"Language: fr\n" | ||||
"MIME-Version: 1.0\n" | ||||
"Content-Type: text/plain; charset=UTF-8\n" | ||||
"Content-Transfer-Encoding: 8bit\n" | ||||
"X-Generator: Poedit 2.2.1\n" | ||||
"X-Generator: Poedit 2.2.4\n" | ||||
| ||||
#: ../Doc/library/ctypes.rst:2 | ||||
msgid ":mod:`ctypes` --- A foreign function library for Python" | ||||
| | @ -1550,6 +1550,9 @@ msgid "" | |||
"When programming in a compiled language, shared libraries are accessed when " | ||||
"compiling/linking a program, and when the program is run." | ||||
msgstr "" | ||||
"Les langages compilés ont besoin d'accéder aux bibliothèques partagées au " | ||||
"moment de la compilation, de l'édition de liens et pendant l'exécution du " | ||||
"programme." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1251 | ||||
msgid "" | ||||
| | @ -1559,12 +1562,20 @@ msgid "" | |||
"while the ctypes library loaders act like when a program is run, and call " | ||||
"the runtime loader directly." | ||||
msgstr "" | ||||
"Le but de la fonction :func:`find_library` est de trouver une bibliothèque " | ||||
"de la même façon que le ferait le compilateur ou le chargeur (sur les plates-" | ||||
"formes avec plusieurs versions de la même bibliothèque, la plus récente est " | ||||
"chargée), alors que les chargeurs de bibliothèques de *ctypes* se comportent " | ||||
"de la même façon qu'un programme qui s'exécute, et appellent directement le " | ||||
"chargeur." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1257 | ||||
msgid "" | ||||
"The :mod:`ctypes.util` module provides a function which can help to " | ||||
"determine the library to load." | ||||
msgstr "" | ||||
"Le module :mod:`ctypes.util` fournit une fonction pour déterminer quelle " | ||||
"bibliothèque charger." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1265 | ||||
msgid "" | ||||
| | @ -1573,10 +1584,15 @@ msgid "" | |||
"number (this is the form used for the posix linker option :option:`!-l`). " | ||||
"If no library can be found, returns ``None``." | ||||
msgstr "" | ||||
"Tente de trouver une bibliothèque et en renvoie le chemin. *name* est le nom " | ||||
"de la bibliothèque sans préfixe — comme *lib* — ni suffixe — comme ``.so``, " | ||||
"``.dylib`` ou un numéro de version (c.-à-d. la même forme que l'option POSIX " | ||||
"de l'éditeur de lien :option:`!-l`). Si la fonction ne parvient pas à " | ||||
"trouver de bibliothèque, elle renvoie ``None``." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1270 ../Doc/library/ctypes.rst:1903 | ||||
msgid "The exact functionality is system dependent." | ||||
msgstr "" | ||||
msgstr "Le mode opératoire exact dépend du système." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1272 | ||||
msgid "" | ||||
| | @ -1584,6 +1600,9 @@ msgid "" | |||
"ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It " | ||||
"returns the filename of the library file." | ||||
msgstr "" | ||||
"Sous Linux, :func:`find_library` essaye de lancer des programmes externes " | ||||
"(``/sbin/ldconfig``, ``gcc``, ``objdump`` et ``ld``) pour trouver la " | ||||
"bibliothèque. Elle renvoie le nom de la bibliothèque sur le disque." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1276 | ||||
msgid "" | ||||
| | @ -1591,16 +1610,21 @@ msgid "" | |||
"when searching for libraries, if a library cannot be found by any other " | ||||
"means." | ||||
msgstr "" | ||||
"Sous Linux, si les autres moyens échouent, la fonction utilise la variable " | ||||
"d'environnement ``LD_LIBRARY_PATH`` pour trouver la bibliothèque." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1280 | ||||
msgid "Here are some examples::" | ||||
msgstr "" | ||||
msgstr "Voici quelques exemples :" | ||||
| ||||
#: ../Doc/library/ctypes.rst:1291 | ||||
msgid "" | ||||
"On OS X, :func:`find_library` tries several predefined naming schemes and " | ||||
"paths to locate the library, and returns a full pathname if successful::" | ||||
msgstr "" | ||||
"Sous OS X, :func:`find_library` regarde dans des chemins et conventions de " | ||||
"chemins prédéfinies pour trouver la bibliothèque et en renvoie le chemin " | ||||
"complet si elle la trouve :" | ||||
| ||||
#: ../Doc/library/ctypes.rst:1305 | ||||
msgid "" | ||||
| | @ -1608,6 +1632,10 @@ msgid "" | |||
"returns the full pathname, but since there is no predefined naming scheme a " | ||||
"call like ``find_library(\"c\")`` will fail and return ``None``." | ||||
msgstr "" | ||||
"Sous Windows, :func:`find_library` examine le chemin de recherche du système " | ||||
"et renvoie le chemin complet de la bibliothèque, mais comme il n'existe pas " | ||||
"de convention de nommage, des appels comme ``find_library(\"c\")`` échouent " | ||||
"et renvoient ``None``." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1309 | ||||
msgid "" | ||||
| | @ -1616,6 +1644,11 @@ msgid "" | |||
"into the wrapper module instead of using :func:`find_library` to locate the " | ||||
"library at runtime." | ||||
msgstr "" | ||||
"Si vous encapsulez une bibliothèque partagée avec :mod:`ctypes`, il est " | ||||
"*probablement* plus judicieux de déterminer le chemin de cette bibliothèque " | ||||
"lors du développement et de l'écrire en dur dans le module d'encapsulation, " | ||||
"plutôt que d'utiliser :func:`find_library` pour la trouver lors de " | ||||
"l'exécution." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1317 | ||||
msgid "Loading shared libraries" | ||||
| | @ -1626,6 +1659,9 @@ msgid "" | |||
"There are several ways to load shared libraries into the Python process. " | ||||
"One way is to instantiate one of the following classes:" | ||||
msgstr "" | ||||
"Il y a plusieurs moyens de charger une bibliothèque partagée dans un " | ||||
"processus Python. L'un d'entre eux consiste à instancier une des classes " | ||||
"suivantes :" | ||||
| ||||
#: ../Doc/library/ctypes.rst:1325 | ||||
msgid "" | ||||
| | @ -1633,6 +1669,9 @@ msgid "" | |||
"these libraries use the standard C calling convention, and are assumed to " | ||||
"return :c:type:`int`." | ||||
msgstr "" | ||||
"Une instance de cette classe représente une bibliothèque partagée déjà " | ||||
"chargée. Les fonctions de cette bibliothèque utilisent la convention d'appel " | ||||
"C standard et doivent renvoyer un :c:type:`int`." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1332 | ||||
msgid "" | ||||
| | @ -1643,6 +1682,13 @@ msgid "" | |||
"failed or succeeded, together with additional error code. If the return " | ||||
"value signals a failure, an :class:`OSError` is automatically raised." | ||||
msgstr "" | ||||
"En Windows seulement : une instance de cette classe représente une " | ||||
"bibliothèque partagée déjà chargée. Les fonctions de cette bibliothèque " | ||||
"utilisent la convention d'appel *stdcall*, et doivent renvoyer un code :" | ||||
"class:`HRESULT` (propre à Windows). Les valeurs de :class:`HRESULT` " | ||||
"contiennent des informations précisant si l'appel de la fonction a échoué ou " | ||||
"s'il a réussi, ainsi qu'un code d'erreur supplémentaire. Si la valeur de " | ||||
"retour signale un échec, une :class:`OSError` est levée automatiquement." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1339 | ||||
msgid ":exc:`WindowsError` used to be raised." | ||||
| | @ -1654,6 +1700,10 @@ msgid "" | |||
"functions in these libraries use the ``stdcall`` calling convention, and are " | ||||
"assumed to return :c:type:`int` by default." | ||||
msgstr "" | ||||
"En Windows seulement : une instance de cette classe représente une " | ||||
"bibliothèque partagée déjà chargée. Les fonctions de cette bibliothèque " | ||||
"utilisent la convention d'appel *stdcall* et doivent renvoyer par défaut un :" | ||||
"c:type:`int`." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1349 | ||||
msgid "" | ||||
| | @ -1661,12 +1711,18 @@ msgid "" | |||
"the :class:`WinDLL` and :class:`OleDLL` use the standard calling convention " | ||||
"on this platform." | ||||
msgstr "" | ||||
"Sous Windows CE, seule la convention d'appel standard est utilisée. Pour des " | ||||
"raisons pratiques, :class:`WinDLL` et :class:`OleDLL` utilisent la " | ||||
"convention d'appel standard sur cette plate-forme." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1353 | ||||
msgid "" | ||||
"The Python :term:`global interpreter lock` is released before calling any " | ||||
"function exported by these libraries, and reacquired afterwards." | ||||
msgstr "" | ||||
"Le :term:`verrou global de l'interpréteur <global interpreter lock>` Python " | ||||
"est relâché avant chaque appel d'une fonction exposée par ces bibliothèques " | ||||
"et ré-activé après." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1359 | ||||
msgid "" | ||||
| | @ -1675,10 +1731,15 @@ msgid "" | |||
"function execution the Python error flag is checked. If the error flag is " | ||||
"set, a Python exception is raised." | ||||
msgstr "" | ||||
"Cette classe est identique à :class:`CDLL`, à ceci près que le GIL n'est " | ||||
"*pas* relâché pendant l'appel de la fonction, et, qu'au terme de l'appel, le " | ||||
"drapeau d'erreur Python est vérifié. Si celui-ci est activé, une exception " | ||||
"Python est levée." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1364 | ||||
msgid "Thus, this is only useful to call Python C api functions directly." | ||||
msgstr "" | ||||
"Donc, cette classe ne sert qu'à appeler les fonctions de l'API C de Python." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1366 | ||||
msgid "" | ||||
| | @ -1689,6 +1750,12 @@ msgid "" | |||
"``LoadLibrary`` function is used to load the library into the process, and " | ||||
"to get a handle to it." | ||||
msgstr "" | ||||
"Toutes ces classes peuvent être instanciées en les appelant avec le chemin " | ||||
"de la bibliothèque partagée comme unique argument. Il est aussi possible de " | ||||
"passer un lien vers une bibliothèque déjà chargée en utilisant le paramètre " | ||||
"``handle``. Sinon, les fonctions ``dlopen`` ou ``LoadLibrary`` de la plate-" | ||||
"forme sous-jacente permettent de charger la bibliothèque dans le processus, " | ||||
"et d'en obtenir un lien." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1373 | ||||
msgid "" | ||||
| | @ -1697,6 +1764,10 @@ msgid "" | |||
"ignored. On posix systems, RTLD_NOW is always added, and is not " | ||||
"configurable." | ||||
msgstr "" | ||||
"Le mode de chargement de la bibliothèque est défini par le paramètre *mode*. " | ||||
"Pour plus de détails, référez-vous à l'entrée :manpage:`dlopen(3)` du " | ||||
"manuel. En Windows, *mode* est ignoré. Sur les systèmes POSIX, RTLD_NOW y " | ||||
"est toujours ajouté. Ceci n'est pas configurable." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1378 | ||||
msgid "" | ||||
| | @ -1707,6 +1778,13 @@ msgid "" | |||
"the :data:`errno` value before the function call is swapped with the ctypes " | ||||
"private copy, the same happens immediately after the function call." | ||||
msgstr "" | ||||
"Le paramètre *use_errno*, lorsque défini à vrai, active un mécanisme de " | ||||
"*ctypes* qui permet d'accéder au numéro d'erreur :data:`errno` du système de " | ||||
"manière sécurisée. :mod:`ctypes` maintient une copie de :data:`errno` du " | ||||
"système dans chaque fil d'exécution. Si vous appelez des fonctions externes " | ||||
"créées avec ``use_errno=True``, la valeur de :data:`errno` avant l'appel de " | ||||
"la fonction est échangée avec la copie privée de *ctypes*. La même chose se " | ||||
"produit juste après l'appel de la fonction." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1385 | ||||
msgid "" | ||||
| | @ -1714,6 +1792,9 @@ msgid "" | |||
"private copy, and the function :func:`ctypes.set_errno` changes the ctypes " | ||||
"private copy to a new value and returns the former value." | ||||
msgstr "" | ||||
"La fonction :func:`ctypes.get_errno` renvoie la valeur de la copie privée de " | ||||
"*ctypes*. La fonction :func:`ctypes.set_errno` affecte une nouvelle valeur à " | ||||
"la copie privée et renvoie l'ancienne valeur." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1389 | ||||
msgid "" | ||||
| | @ -1723,6 +1804,11 @@ msgid "" | |||
"and :func:`ctypes.set_last_error` are used to request and change the ctypes " | ||||
"private copy of the windows error code." | ||||
msgstr "" | ||||
"Définir le paramètre *use_last_error* à vrai active le même mécanisme pour " | ||||
"le code d'erreur de Windows qui est géré par les fonctions :func:" | ||||
"`GetLastError` et :func:`SetLastError` de l'API Windows ; :func:`ctypes." | ||||
"get_last_error` et :func:`ctypes.set_last_error` servent à obtenir et " | ||||
"modifier la copie privée *ctypes* de ce code d'erreur." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1395 | ||||
msgid "" | ||||
| | @ -1733,6 +1819,13 @@ msgid "" | |||
"such as DLL hijacking. Passing the full path to the DLL is the safest way to " | ||||
"ensure the correct library and dependencies are loaded." | ||||
msgstr "" | ||||
"Sous Windows, le paramètre *winmode* définit comment charger la bibliothèque " | ||||
"(puisque *mode* est ignoré). Il accepte toute valeur compatible avec le " | ||||
"drapeau ``LoadLibraryEx`` de l'API Win32. Lorsqu'il est omis, les drapeaux " | ||||
"par défaut sont ceux qui chargent la DLL de la manière la plus sécurisée " | ||||
"possible, afin d'éviter des problèmes comme le détournement de DLL. Passer " | ||||
"le chemin complet à la DLL reste le moyen le plus sûr de s'assurer que la " | ||||
"bonne bibliothèque et les bonnes dépendances sont chargées." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1402 | ||||
msgid "Added *winmode* parameter." | ||||
| | @ -1786,6 +1879,10 @@ msgid "" | |||
"calling the :meth:`LoadLibrary` method, or by retrieving the library as " | ||||
"attribute of the loader instance." | ||||
msgstr "" | ||||
"Il est possible de charger une bibliothèque partagée soit en utilisant une " | ||||
"instance de la classe :class:`LibraryLoader`, soit en appelant la méthode :" | ||||
"meth:`LoadLibrary`, soit en récupérant la bibliothèque comme attribut de " | ||||
"l'instance du chargeur." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1460 | ||||
msgid "" | ||||
| | @ -1805,32 +1902,34 @@ msgid "" | |||
"Load a shared library into the process and return it. This method always " | ||||
"returns a new instance of the library." | ||||
msgstr "" | ||||
"Charge une bibliothèque partagée dans le processus et la renvoie. Cette " | ||||
"méthode renvoie toujours une nouvelle instance de la bibliothèque." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1473 | ||||
msgid "These prefabricated library loaders are available:" | ||||
msgstr "" | ||||
msgstr "Plusieurs chargeurs sont fournis :" | ||||
| ||||
#: ../Doc/library/ctypes.rst:1478 | ||||
msgid "Creates :class:`CDLL` instances." | ||||
msgstr "" | ||||
msgstr "Pour créer des instances de :class:`CDLL`." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1484 | ||||
msgid "Windows only: Creates :class:`WinDLL` instances." | ||||
msgstr "" | ||||
msgstr "Pour créer des instances de :class:`WinDLL` (uniquement en Windows)." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1490 | ||||
msgid "Windows only: Creates :class:`OleDLL` instances." | ||||
msgstr "" | ||||
msgstr "Pour créer des instances de :class:`OleDLL` (uniquement en Windows)." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1496 | ||||
msgid "Creates :class:`PyDLL` instances." | ||||
msgstr "" | ||||
msgstr "Pour créer des instances de :class:`PyDLL`." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1499 | ||||
msgid "" | ||||
"For accessing the C Python api directly, a ready-to-use Python shared " | ||||
"library object is available:" | ||||
msgstr "" | ||||
msgstr "Il existe un moyen rapide d'accéder directement à l'API C Python :" | ||||
| ||||
#: ../Doc/library/ctypes.rst:1505 | ||||
msgid "" | ||||
| | @ -1839,12 +1938,19 @@ msgid "" | |||
"`int`, which is of course not always the truth, so you have to assign the " | ||||
"correct :attr:`restype` attribute to use these functions." | ||||
msgstr "" | ||||
"Une instance de :class:`PyDLL` dont les attributs sont les fonctions " | ||||
"exportées par l'API C Python. Toutes ces fonctions sont supposées renvoyer " | ||||
"un :c:type:`int` C, ce qui n'est bien entendu pas toujours le cas. Il faut " | ||||
"donc définir vous-même le bon attribut :attr:`restype` pour pouvoir les " | ||||
"utiliser." | ||||
| ||||
#: ../Doc/library/ctypes.rst:None | ||||
msgid "" | ||||
"Raises an :ref:`auditing event <auditing>` ``ctypes.dlopen`` with argument " | ||||
"``name``." | ||||
msgstr "" | ||||
"Lève un :ref:`évènement d'audit <auditing>` ``ctypes.dlopen`` avec " | ||||
"l'argument ``name``." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1512 | ||||
msgid "" | ||||
| | @ -1852,6 +1958,9 @@ msgid "" | |||
"event <auditing>` ``ctypes.dlopen`` with string argument ``name``, the name " | ||||
"used to load the library." | ||||
msgstr "" | ||||
"Charger une bibliothèque à l'aide d'un de ces objets avec en argument " | ||||
"``name``, le nom de la bibliothèque (une chaîne de caractères), lève un :ref:" | ||||
"`évènement d'audit <auditing>` ``ctypes.dlopen``." | ||||
| ||||
#: ../Doc/library/ctypes.rst:None | ||||
msgid "" | ||||
| | @ -1859,12 +1968,17 @@ msgid "" | |||
"``library``, ``name``." | ||||
msgstr "" | ||||
| ||||
# "Lève un :ref:`évènement d'audit <auditing>` ``ctypes.dlsym`` avec " | ||||
# "``library`` et ``name`` comme arguments." | ||||
#: ../Doc/library/ctypes.rst:1518 | ||||
msgid "" | ||||
"Accessing a function on a loaded library raises an auditing event ``ctypes." | ||||
"dlsym`` with arguments ``library`` (the library object) and ``name`` (the " | ||||
"symbol's name as a string or integer)." | ||||
msgstr "" | ||||
"Accéder à une fonction d'une bibliothèque lève un évènement d'audit ``ctypes." | ||||
"dlsym`` avec ``library`` (l'objet bibliothèque) et ``name`` (le nom du " | ||||
"symbole — une chaîne de caractères ou un entier) comme arguments." | ||||
| ||||
#: ../Doc/library/ctypes.rst:None | ||||
msgid "" | ||||
| | @ -1872,12 +1986,17 @@ msgid "" | |||
"arguments ``handle``, ``name``." | ||||
msgstr "" | ||||
| ||||
# "Lève un :ref:`évènement d'audit <auditing>` ``ctypes.dlsym/handle`` avec " | ||||
# "``handle`` et ``name`` comme arguments." | ||||
#: ../Doc/library/ctypes.rst:1524 | ||||
msgid "" | ||||
"In cases when only the library handle is available rather than the object, " | ||||
"accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " | ||||
"arguments ``handle`` (the raw library handle) and ``name``." | ||||
msgstr "" | ||||
"Si seul le lien sur la bibliothèque, et non l'objet, est disponible, accéder " | ||||
"à une fonction lève l'évènement d'audit ``ctypes.dlsym/handle`` avec " | ||||
"``handle`` (le lien vers la bibliothèque) et ``name`` comme arguments." | ||||
| ||||
#: ../Doc/library/ctypes.rst:1531 | ||||
msgid "Foreign functions" | ||||
| | @ -2849,7 +2968,7 @@ msgstr "" | |||
| ||||
#: ../Doc/library/ctypes.rst:2371 | ||||
msgid "Structured data types" | ||||
msgstr "Types de donnée dérivés de Structure" | ||||
msgstr "Types de données dérivés de Structure" | ||||
| ||||
#: ../Doc/library/ctypes.rst:2376 | ||||
msgid "Abstract base class for unions in native byte order." | ||||
| | | |||
Loading…
Add table
Add a link
Reference in a new issue