1
0
Fork 0

Un paragraphe de plus pour ctypes + fuzzys. (#1377)

* Un paragraphe de plus pour ctypes + fuzzys.

* Suggestions de vpoulailleau.

Co-authored-by: Vincent Poulailleau <vpoulailleau@gmail.com>

* Indentation

* Suggestion de vpoulailleau

Co-authored-by: Vincent Poulailleau <vpoulailleau@gmail.com>

* Indentation.

* Modifs mineures.

* Suggestions de christopheNan

Co-authored-by: Christophe Nanteuil <35002064+christopheNan@users.noreply.github.com>

* Indentation.

* Suggestions de christopheNan.

Co-authored-by: Christophe Nanteuil <35002064+christopheNan@users.noreply.github.com>

* Indentation.

Co-authored-by: Vincent Poulailleau <vpoulailleau@gmail.com>
Co-authored-by: Christophe Nanteuil <35002064+christopheNan@users.noreply.github.com>
This commit is contained in:
Antoine 2020-08-21 16:16:33 +02:00 committed by GitHub
parent a162774205
commit ad57aeae2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 95 additions and 53 deletions

1
dict
View File

@ -1,6 +1,7 @@
#python-fr #python-fr
-1 -1
-ième -ième
-uplet
-uplets -uplets
017f 017f
212a 212a

View File

@ -5,15 +5,15 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Python 3\n" "Project-Id-Version: Python 3\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-07-20 10:51+0200\n" "POT-Creation-Date: 2020-02-04 10:00+0100\n"
"PO-Revision-Date: 2020-04-27 22:21+0200\n" "PO-Revision-Date: 2020-08-17 23:01+0200\n"
"Last-Translator: Antoine Wecxsteen\n" "Last-Translator: Antoine Wecxsteen\n"
"Language-Team: FRENCH <traductions@lists.afpy.org>\n" "Language-Team: FRENCH <traductions@lists.afpy.org>\n"
"Language: fr\n" "Language: fr\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.2.4\n" "X-Generator: Poedit 2.3\n"
#: library/ctypes.rst:2 #: library/ctypes.rst:2
msgid ":mod:`ctypes` --- A foreign function library for Python" msgid ":mod:`ctypes` --- A foreign function library for Python"
@ -291,7 +291,7 @@ msgstr ""
#: library/ctypes.rst:211 library/ctypes.rst:2128 #: library/ctypes.rst:211 library/ctypes.rst:2128
msgid "Fundamental data types" msgid "Fundamental data types"
msgstr "Types de données fondamentaux" msgstr "Types de données de base"
#: library/ctypes.rst:213 #: library/ctypes.rst:213
msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" msgid ":mod:`ctypes` defines a number of primitive C compatible data types:"
@ -724,7 +724,7 @@ msgid ""
msgstr "" msgstr ""
"Si la fonction à interfacer renvoie un entier, l'attribut :attr:`restype` " "Si la fonction à interfacer renvoie un entier, l'attribut :attr:`restype` "
"peut aussi être un appelable (une fonction ou une classe par exemple). Dans " "peut aussi être un appelable (une fonction ou une classe par exemple). Dans "
"ce cas, l'appelable sera appelé avec l'entier renvoyé par la fonction et le " "ce cas, l'appelable est appelé avec l'entier renvoyé par la fonction et le "
"résultat de cet appel sera le résultat final de l'appel à la fonction. C'est " "résultat de cet appel sera le résultat final de l'appel à la fonction. C'est "
"pratique pour vérifier les codes d'erreurs des valeurs de retour et lever " "pratique pour vérifier les codes d'erreurs des valeurs de retour et lever "
"automatiquement des exceptions ::" "automatiquement des exceptions ::"
@ -1399,15 +1399,14 @@ msgstr ""
"autre, donc mieux vaut sortir de la boucle quand on lit l'entrée ``NULL`` ::" "autre, donc mieux vaut sortir de la boucle quand on lit l'entrée ``NULL`` ::"
#: library/ctypes.rst:1120 #: library/ctypes.rst:1120
#, fuzzy
msgid "" msgid ""
"The fact that standard Python has a frozen module and a frozen package " "The fact that standard Python has a frozen module and a frozen package "
"(indicated by the negative ``size`` member) is not well known, it is only " "(indicated by the negative ``size`` member) is not well known, it is only "
"used for testing. Try it out with ``import __hello__`` for example." "used for testing. Try it out with ``import __hello__`` for example."
msgstr "" msgstr ""
"Le fait que le standard Python possède un module et un paquet gelés (indiqué " "Le fait que le standard Python possède un module et un paquet gelés "
"par la valeur négative du membre *size*) est peu connu, cela ne sert qu'aux " "(indiqués par la valeur négative du membre *size*) est peu connu, cela ne "
"tests. Essayez avec ``import __hello__`` par exemple." "sert qu'aux tests. Essayez avec ``import __hello__`` par exemple."
#: library/ctypes.rst:1128 #: library/ctypes.rst:1128
msgid "Surprises" msgid "Surprises"
@ -1833,18 +1832,25 @@ msgid ""
"Flag to use as *mode* parameter. On platforms where this flag is not " "Flag to use as *mode* parameter. On platforms where this flag is not "
"available, it is defined as the integer zero." "available, it is defined as the integer zero."
msgstr "" msgstr ""
"Valeur possible pour le paramètre *mode*. Vaut zéro sur les plates-formes où "
"ce drapeau n'est pas disponible."
#: library/ctypes.rst:1416 #: library/ctypes.rst:1416
msgid "" msgid ""
"Flag to use as *mode* parameter. On platforms where this is not available, " "Flag to use as *mode* parameter. On platforms where this is not available, "
"it is the same as *RTLD_GLOBAL*." "it is the same as *RTLD_GLOBAL*."
msgstr "" msgstr ""
"Valeur possible pour le paramètre *mode*. Vaut *RTLD_GLOBAL* sur les plates-"
"formes où ce drapeau n'est pas disponible."
#: library/ctypes.rst:1423 #: library/ctypes.rst:1423
msgid "" msgid ""
"The default mode which is used to load shared libraries. On OSX 10.3, this " "The default mode which is used to load shared libraries. On OSX 10.3, this "
"is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*."
msgstr "" msgstr ""
"Mode de chargement par défaut des bibliothèques partagées. Vaut "
"*RTLD_GLOBAL* sur OSX 10.3 et *RTLD_LOCAL* sur les autres systèmes "
"d'exploitation."
#: library/ctypes.rst:1426 #: library/ctypes.rst:1426
msgid "" msgid ""
@ -1854,12 +1860,19 @@ msgid ""
"therefore accessing it repeatedly returns the same object each time. On the " "therefore accessing it repeatedly returns the same object each time. On the "
"other hand, accessing it through an index returns a new object each time::" "other hand, accessing it through an index returns a new object each time::"
msgstr "" msgstr ""
"Les instances de ces classes n'ont pas de méthodes publiques ; on accède aux "
"fonctions de la bibliothèque partagée par attribut ou par indiçage. Notez "
"que les résultats des accès par attribut sont mis en cache, et donc des "
"accès consécutifs renvoient à chaque fois le même objet. Accéder à une "
"fonction par indice renvoie cependant chaque fois un nouvel objet :"
#: library/ctypes.rst:1439 #: library/ctypes.rst:1439
msgid "" msgid ""
"The following public attributes are available, their name starts with an " "The following public attributes are available, their name starts with an "
"underscore to not clash with exported function names:" "underscore to not clash with exported function names:"
msgstr "" msgstr ""
"Les attributs publics suivants sont disponibles, leur nom commence par un "
"tiret bas pour éviter les conflits avec les noms des fonctions exportées :"
#: library/ctypes.rst:1445 #: library/ctypes.rst:1445
msgid "The system handle used to access the library." msgid "The system handle used to access the library."
@ -1867,7 +1880,7 @@ msgstr ""
#: library/ctypes.rst:1450 #: library/ctypes.rst:1450
msgid "The name of the library passed in the constructor." msgid "The name of the library passed in the constructor."
msgstr "" msgstr "Nom de la bibliothèque donné au constructeur."
#: library/ctypes.rst:1452 #: library/ctypes.rst:1452
msgid "" msgid ""
@ -1886,6 +1899,8 @@ msgid ""
"Class which loads shared libraries. *dlltype* should be one of the :class:" "Class which loads shared libraries. *dlltype* should be one of the :class:"
"`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types."
msgstr "" msgstr ""
"Classe pour charger une bibliothèque partagée. *dlltype* doit être de type :"
"class:`CDLL`, :class:`PyDLL`, :class:`WinDLL` ou :class:`OleDLL`."
#: library/ctypes.rst:1463 #: library/ctypes.rst:1463
msgid "" msgid ""
@ -1893,6 +1908,10 @@ msgid ""
"by accessing it as attribute of a library loader instance. The result is " "by accessing it as attribute of a library loader instance. The result is "
"cached, so repeated attribute accesses return the same library each time." "cached, so repeated attribute accesses return the same library each time."
msgstr "" msgstr ""
":meth:`__getattr__` a un comportement particulier : elle charge une "
"bibliothèque quand on accède à un attribut du chargeur. Le résultat est mis "
"en cache, donc des accès consécutifs renvoient la même bibliothèque à chaque "
"fois."
#: library/ctypes.rst:1469 #: library/ctypes.rst:1469
msgid "" msgid ""
@ -1941,14 +1960,6 @@ msgstr ""
"donc définir vous-même le bon attribut :attr:`restype` pour pouvoir les " "donc définir vous-même le bon attribut :attr:`restype` pour pouvoir les "
"utiliser." "utiliser."
#: 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``."
#: library/ctypes.rst:1512 #: library/ctypes.rst:1512
msgid "" msgid ""
"Loading a library through any of these objects raises an :ref:`auditing " "Loading a library through any of these objects raises an :ref:`auditing "
@ -1959,14 +1970,6 @@ msgstr ""
"``name``, le nom de la bibliothèque (une chaîne de caractères), lève un :ref:" "``name``, le nom de la bibliothèque (une chaîne de caractères), lève un :ref:"
"`évènement d'audit <auditing>` ``ctypes.dlopen``." "`évènement d'audit <auditing>` ``ctypes.dlopen``."
#: library/ctypes.rst:None
msgid ""
"Raises an :ref:`auditing event <auditing>` ``ctypes.dlsym`` with arguments "
"``library``, ``name``."
msgstr ""
# "Lève un :ref:`évènement d'audit <auditing>` ``ctypes.dlsym`` avec "
# "``library`` et ``name`` comme arguments."
#: library/ctypes.rst:1518 #: library/ctypes.rst:1518
msgid "" msgid ""
"Accessing a function on a loaded library raises an auditing event ``ctypes." "Accessing a function on a loaded library raises an auditing event ``ctypes."
@ -1977,14 +1980,6 @@ msgstr ""
"dlsym`` avec ``library`` (l'objet bibliothèque) et ``name`` (le nom du " "dlsym`` avec ``library`` (l'objet bibliothèque) et ``name`` (le nom du "
"symbole — une chaîne de caractères ou un entier) comme arguments." "symbole — une chaîne de caractères ou un entier) comme arguments."
#: library/ctypes.rst:None
msgid ""
"Raises an :ref:`auditing event <auditing>` ``ctypes.dlsym/handle`` with "
"arguments ``handle``, ``name``."
msgstr ""
# "Lève un :ref:`évènement d'audit <auditing>` ``ctypes.dlsym/handle`` avec "
# "``handle`` et ``name`` comme arguments."
#: library/ctypes.rst:1524 #: library/ctypes.rst:1524
msgid "" msgid ""
"In cases when only the library handle is available rather than the object, " "In cases when only the library handle is available rather than the object, "
@ -2007,28 +2002,41 @@ msgid ""
"instances as arguments, and return the default result type specified by the " "instances as arguments, and return the default result type specified by the "
"library loader. They are instances of a private class:" "library loader. They are instances of a private class:"
msgstr "" msgstr ""
"Comme expliqué dans la section précédente, on peut accéder aux fonctions "
"externes au travers des attributs des bibliothèques partagées. Un objet "
"fonction créé de cette façon accepte par défaut un nombre quelconque "
"d'arguments qui peuvent être de n'importe quel type de données *ctypes*. Il "
"renvoie le type par défaut du chargeur de la bibliothèque. Ce sont des "
"instances de la classe privée :"
#: library/ctypes.rst:1542 #: library/ctypes.rst:1542
msgid "Base class for C callable foreign functions." msgid "Base class for C callable foreign functions."
msgstr "" msgstr "Classe de base pour les fonctions externes C."
#: library/ctypes.rst:1544 #: library/ctypes.rst:1544
msgid "" msgid ""
"Instances of foreign functions are also C compatible data types; they " "Instances of foreign functions are also C compatible data types; they "
"represent C function pointers." "represent C function pointers."
msgstr "" msgstr ""
"Une instance de fonction externe est également un type de donnée compatible "
"avec le C ; elle représente un pointeur vers une fonction."
#: library/ctypes.rst:1547 #: library/ctypes.rst:1547
msgid "" msgid ""
"This behavior can be customized by assigning to special attributes of the " "This behavior can be customized by assigning to special attributes of the "
"foreign function object." "foreign function object."
msgstr "" msgstr ""
"Son comportement peut-être personnalisé en réaffectant les attributs "
"spécifiques de l'objet représentant la fonction externe."
#: library/ctypes.rst:1552 #: library/ctypes.rst:1552
msgid "" msgid ""
"Assign a ctypes type to specify the result type of the foreign function. Use " "Assign a ctypes type to specify the result type of the foreign function. Use "
"``None`` for :c:type:`void`, a function not returning anything." "``None`` for :c:type:`void`, a function not returning anything."
msgstr "" msgstr ""
"Fait correspondre le type de retour de la fonction externe à un type "
"*ctypes*. Dans le cas où la fonction ne renvoie rien (:c:type:`void`), "
"utilisez ``None``."
#: library/ctypes.rst:1555 #: library/ctypes.rst:1555
msgid "" msgid ""
@ -2039,6 +2047,14 @@ msgid ""
"or error checking use a ctypes data type as :attr:`restype` and assign a " "or error checking use a ctypes data type as :attr:`restype` and assign a "
"callable to the :attr:`errcheck` attribute." "callable to the :attr:`errcheck` attribute."
msgstr "" msgstr ""
"Il est aussi possible de passer n'importe quel un objet Python qui n'est pas "
"un type *ctypes* pourvu qu'il soit appelable. Dans ce cas, la fonction est "
"censée renvoyer un :c:type:`int` C et l'appelable sera appelé avec cet "
"entier, ce qui permet ainsi de faire des actions supplémentaires comme "
"vérifier un code d'erreur. Ce mécanisme est obsolète ; une façon plus souple "
"de faire des actions supplémentaires ou de la vérification consiste à "
"affecter un type *ctypes* à :attr:`restype` et à affecter un appelable à "
"l'attribut :attr:`errcheck`."
#: library/ctypes.rst:1564 #: library/ctypes.rst:1564
msgid "" msgid ""
@ -2048,6 +2064,11 @@ msgid ""
"tuple; functions using the C calling convention accept additional, " "tuple; functions using the C calling convention accept additional, "
"unspecified arguments as well." "unspecified arguments as well."
msgstr "" msgstr ""
"Fait correspondre le type des arguments que la fonction accepte avec un *n*-"
"uplet de types *ctypes*. Les fonctions qui utilisent la convention d'appel "
"``stdcall`` ne peuvent être appelées qu'avec le même nombre d'arguments que "
"la taille du *n*-uplet mais les fonctions qui utilisent la convention "
"d'appel C acceptent aussi des arguments additionnels non-définis."
#: library/ctypes.rst:1570 #: library/ctypes.rst:1570
msgid "" msgid ""
@ -2058,6 +2079,13 @@ msgid ""
"attr:`argtypes` tuple will convert a string passed as argument into a bytes " "attr:`argtypes` tuple will convert a string passed as argument into a bytes "
"object using ctypes conversion rules." "object using ctypes conversion rules."
msgstr "" msgstr ""
"À l'appel d'une fonction externe, chaque argument est passé à la méthode de "
"classe :meth:`from_param` de l'élément correspondant dans le *n*-uplet des :"
"attr:`argtypes`. Cette méthode convertit l'argument initial en un objet que "
"la fonction externe peut comprendre. Par exemple, un :class:`c_char_p` dans "
"le *n*-uplet des :attr:`argtypes` va transformer la chaîne de caractères "
"passée en argument en un objet chaîne d'octets selon les règles de "
"conversion *ctypes*."
#: library/ctypes.rst:1577 #: library/ctypes.rst:1577
msgid "" msgid ""
@ -2066,30 +2094,47 @@ msgid ""
"usable as argument (integer, string, ctypes instance). This allows defining " "usable as argument (integer, string, ctypes instance). This allows defining "
"adapters that can adapt custom objects as function parameters." "adapters that can adapt custom objects as function parameters."
msgstr "" msgstr ""
"Nouveau : il est maintenant possible de mettre des objets qui ne sont pas "
"des types de *ctypes* dans les *argtypes*, mais ceux-ci doivent avoir une "
"méthode :meth:`from_param` renvoyant une valeur qui peut être utilisée comme "
"un argument (entier, chaîne de caractères ou instance *ctypes*). Ceci permet "
"de créer des adaptateurs qui convertissent des objets arbitraires en des "
"paramètres de fonction."
#: library/ctypes.rst:1584 #: library/ctypes.rst:1584
msgid "" msgid ""
"Assign a Python function or another callable to this attribute. The callable " "Assign a Python function or another callable to this attribute. The callable "
"will be called with three or more arguments:" "will be called with three or more arguments:"
msgstr "" msgstr ""
"Définit une fonction Python ou tout autre appelable qui sera appelé avec "
"trois arguments ou plus :"
#: library/ctypes.rst:1591 #: library/ctypes.rst:1591
msgid "" msgid ""
"*result* is what the foreign function returns, as specified by the :attr:" "*result* is what the foreign function returns, as specified by the :attr:"
"`restype` attribute." "`restype` attribute."
msgstr "" msgstr ""
"*result* est la valeur de retour de la fonction externe, comme défini par "
"l'attribut :attr:`restype`."
#: library/ctypes.rst:1594 #: library/ctypes.rst:1594
msgid "" msgid ""
"*func* is the foreign function object itself, this allows reusing the same " "*func* is the foreign function object itself, this allows reusing the same "
"callable object to check or post process the results of several functions." "callable object to check or post process the results of several functions."
msgstr "" msgstr ""
"*func* est l'objet représentant la fonction externe elle-même. Cet accesseur "
"permet de réutiliser le même appelable pour vérifier le résultat de "
"plusieurs fonctions ou de faire des actions supplémentaires après leur "
"exécution."
#: library/ctypes.rst:1598 #: library/ctypes.rst:1598
msgid "" msgid ""
"*arguments* is a tuple containing the parameters originally passed to the " "*arguments* is a tuple containing the parameters originally passed to the "
"function call, this allows specializing the behavior on the arguments used." "function call, this allows specializing the behavior on the arguments used."
msgstr "" msgstr ""
"*arguments* est le *n*-uplet qui contient les paramètres initiaux passés à "
"la fonction, ceci permet de spécialiser le comportement des arguments "
"utilisés."
#: library/ctypes.rst:1602 #: library/ctypes.rst:1602
msgid "" msgid ""
@ -2097,18 +2142,17 @@ msgid ""
"function call, but it can also check the result value and raise an exception " "function call, but it can also check the result value and raise an exception "
"if the foreign function call failed." "if the foreign function call failed."
msgstr "" msgstr ""
"L'objet renvoyé par cette fonction est celui renvoyé par l'appel de la "
"fonction externe, mais il peut aussi vérifier la valeur du résultat et lever "
"une exception si l'appel a échoué."
#: library/ctypes.rst:1609 #: library/ctypes.rst:1609
msgid "" msgid ""
"This exception is raised when a foreign function call cannot convert one of " "This exception is raised when a foreign function call cannot convert one of "
"the passed arguments." "the passed arguments."
msgstr "" msgstr ""
"Exception levée quand un appel à la fonction externe ne peut pas convertir "
#: library/ctypes.rst:None "un des arguments qu'elle a reçus."
msgid ""
"Raises an :ref:`auditing event <auditing>` ``ctypes.seh_exception`` with "
"argument ``code``."
msgstr ""
#: library/ctypes.rst:1615 #: library/ctypes.rst:1615
msgid "" msgid ""
@ -2118,12 +2162,12 @@ msgid ""
"seh_exception`` with argument ``code`` will be raised, allowing an audit " "seh_exception`` with argument ``code`` will be raised, allowing an audit "
"hook to replace the exception with its own." "hook to replace the exception with its own."
msgstr "" msgstr ""
"En Windows, quand un appel à une fonction externe lève une exception système "
#: library/ctypes.rst:None "(par exemple, une erreur de segmentation), celle-ci est interceptée pour "
msgid "" "être remplacée par l'exception Python correspondante. De plus, un évènement "
"Raises an :ref:`auditing event <auditing>` ``ctypes.call_function`` with " "d'audit ``ctypes.seh_exception`` est levé avec ``code`` en argument, ce qui "
"arguments ``func_pointer``, ``arguments``." "permet à un point d'entrée (*hook* en anglais) d'audit de remplacer "
msgstr "" "l'exception par une des siennes."
#: library/ctypes.rst:1623 #: library/ctypes.rst:1623
msgid "" msgid ""
@ -2131,6 +2175,9 @@ msgid ""
"``ctypes.call_function`` with arguments ``function pointer`` and " "``ctypes.call_function`` with arguments ``function pointer`` and "
"``arguments``." "``arguments``."
msgstr "" msgstr ""
"Certaines manières d'appeler des fonction externes peuvent lever des "
"évènements d'audit ``ctypes.call_function`` avec ``function pointer`` et "
"``arguments`` comme arguments."
#: library/ctypes.rst:1629 #: library/ctypes.rst:1629
msgid "Function prototypes" msgid "Function prototypes"
@ -2652,12 +2699,6 @@ msgid ""
"*address* which must be an integer." "*address* which must be an integer."
msgstr "" msgstr ""
#: library/ctypes.rst:None
msgid ""
"Raises an :ref:`auditing event <auditing>` ``ctypes.cdata`` with argument "
"``address``."
msgstr ""
#: library/ctypes.rst:2082 #: library/ctypes.rst:2082
msgid "" msgid ""
"This method, and others that indirectly call this method, raises an :ref:" "This method, and others that indirectly call this method, raises an :ref:"