forked from AFPy/python-docs-fr
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:
parent a162774205
commit ad57aeae2a
2 changed files with 95 additions and 53 deletions
1 dict
1
dict | | @ -1,6 +1,7 @@ | |||
#python-fr | ||||
-1 | ||||
-ième | ||||
-uplet | ||||
-uplets | ||||
017f | ||||
212a | ||||
| | | |||
| | @ -5,15 +5,15 @@ msgid "" | |||
msgstr "" | ||||
"Project-Id-Version: Python 3\n" | ||||
"Report-Msgid-Bugs-To: \n" | ||||
"POT-Creation-Date: 2020-07-20 10:51+0200\n" | ||||
"PO-Revision-Date: 2020-04-27 22:21+0200\n" | ||||
"POT-Creation-Date: 2020-02-04 10:00+0100\n" | ||||
"PO-Revision-Date: 2020-08-17 23:01+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.4\n" | ||||
"X-Generator: Poedit 2.3\n" | ||||
| ||||
#: library/ctypes.rst:2 | ||||
msgid ":mod:`ctypes` --- A foreign function library for Python" | ||||
| | @ -291,7 +291,7 @@ msgstr "" | |||
| ||||
#: library/ctypes.rst:211 library/ctypes.rst:2128 | ||||
msgid "Fundamental data types" | ||||
msgstr "Types de données fondamentaux" | ||||
msgstr "Types de données de base" | ||||
| ||||
#: library/ctypes.rst:213 | ||||
msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" | ||||
| | @ -724,7 +724,7 @@ msgid "" | |||
msgstr "" | ||||
"Si la fonction à interfacer renvoie un entier, l'attribut :attr:`restype` " | ||||
"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 " | ||||
"pratique pour vérifier les codes d'erreurs des valeurs de retour et lever " | ||||
"automatiquement des exceptions ::" | ||||
| | @ -1399,15 +1399,14 @@ msgstr "" | |||
"autre, donc mieux vaut sortir de la boucle quand on lit l'entrée ``NULL`` ::" | ||||
| ||||
#: library/ctypes.rst:1120 | ||||
#, fuzzy | ||||
msgid "" | ||||
"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 " | ||||
"used for testing. Try it out with ``import __hello__`` for example." | ||||
msgstr "" | ||||
"Le fait que le standard Python possède un module et un paquet gelés (indiqué " | ||||
"par la valeur négative du membre *size*) est peu connu, cela ne sert qu'aux " | ||||
"tests. Essayez avec ``import __hello__`` par exemple." | ||||
"Le fait que le standard Python possède un module et un paquet gelés " | ||||
"(indiqués par la valeur négative du membre *size*) est peu connu, cela ne " | ||||
"sert qu'aux tests. Essayez avec ``import __hello__`` par exemple." | ||||
| ||||
#: library/ctypes.rst:1128 | ||||
msgid "Surprises" | ||||
| | @ -1833,18 +1832,25 @@ msgid "" | |||
"Flag to use as *mode* parameter. On platforms where this flag is not " | ||||
"available, it is defined as the integer zero." | ||||
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 | ||||
msgid "" | ||||
"Flag to use as *mode* parameter. On platforms where this is not available, " | ||||
"it is the same as *RTLD_GLOBAL*." | ||||
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 | ||||
msgid "" | ||||
"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*." | ||||
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 | ||||
msgid "" | ||||
| | @ -1854,12 +1860,19 @@ msgid "" | |||
"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::" | ||||
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 | ||||
msgid "" | ||||
"The following public attributes are available, their name starts with an " | ||||
"underscore to not clash with exported function names:" | ||||
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 | ||||
msgid "The system handle used to access the library." | ||||
| | @ -1867,7 +1880,7 @@ msgstr "" | |||
| ||||
#: library/ctypes.rst:1450 | ||||
msgid "The name of the library passed in the constructor." | ||||
msgstr "" | ||||
msgstr "Nom de la bibliothèque donné au constructeur." | ||||
| ||||
#: library/ctypes.rst:1452 | ||||
msgid "" | ||||
| | @ -1886,6 +1899,8 @@ msgid "" | |||
"Class which loads shared libraries. *dlltype* should be one of the :class:" | ||||
"`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." | ||||
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 | ||||
msgid "" | ||||
| | @ -1893,6 +1908,10 @@ msgid "" | |||
"by accessing it as attribute of a library loader instance. The result is " | ||||
"cached, so repeated attribute accesses return the same library each time." | ||||
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 | ||||
msgid "" | ||||
| | @ -1941,14 +1960,6 @@ msgstr "" | |||
"donc définir vous-même le bon attribut :attr:`restype` pour pouvoir les " | ||||
"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 | ||||
msgid "" | ||||
"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:" | ||||
"`é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 | ||||
msgid "" | ||||
"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 " | ||||
"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 | ||||
msgid "" | ||||
"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 " | ||||
"library loader. They are instances of a private class:" | ||||
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 | ||||
msgid "Base class for C callable foreign functions." | ||||
msgstr "" | ||||
msgstr "Classe de base pour les fonctions externes C." | ||||
| ||||
#: library/ctypes.rst:1544 | ||||
msgid "" | ||||
"Instances of foreign functions are also C compatible data types; they " | ||||
"represent C function pointers." | ||||
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 | ||||
msgid "" | ||||
"This behavior can be customized by assigning to special attributes of the " | ||||
"foreign function object." | ||||
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 | ||||
msgid "" | ||||
"Assign a ctypes type to specify the result type of the foreign function. Use " | ||||
"``None`` for :c:type:`void`, a function not returning anything." | ||||
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 | ||||
msgid "" | ||||
| | @ -2039,6 +2047,14 @@ msgid "" | |||
"or error checking use a ctypes data type as :attr:`restype` and assign a " | ||||
"callable to the :attr:`errcheck` attribute." | ||||
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 | ||||
msgid "" | ||||
| | @ -2048,6 +2064,11 @@ msgid "" | |||
"tuple; functions using the C calling convention accept additional, " | ||||
"unspecified arguments as well." | ||||
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 | ||||
msgid "" | ||||
| | @ -2058,6 +2079,13 @@ msgid "" | |||
"attr:`argtypes` tuple will convert a string passed as argument into a bytes " | ||||
"object using ctypes conversion rules." | ||||
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 | ||||
msgid "" | ||||
| | @ -2066,30 +2094,47 @@ msgid "" | |||
"usable as argument (integer, string, ctypes instance). This allows defining " | ||||
"adapters that can adapt custom objects as function parameters." | ||||
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 | ||||
msgid "" | ||||
"Assign a Python function or another callable to this attribute. The callable " | ||||
"will be called with three or more arguments:" | ||||
msgstr "" | ||||
"Définit une fonction Python ou tout autre appelable qui sera appelé avec " | ||||
"trois arguments ou plus :" | ||||
| ||||
#: library/ctypes.rst:1591 | ||||
msgid "" | ||||
"*result* is what the foreign function returns, as specified by the :attr:" | ||||
"`restype` attribute." | ||||
msgstr "" | ||||
"*result* est la valeur de retour de la fonction externe, comme défini par " | ||||
"l'attribut :attr:`restype`." | ||||
| ||||
#: library/ctypes.rst:1594 | ||||
msgid "" | ||||
"*func* is the foreign function object itself, this allows reusing the same " | ||||
"callable object to check or post process the results of several functions." | ||||
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 | ||||
msgid "" | ||||
"*arguments* is a tuple containing the parameters originally passed to the " | ||||
"function call, this allows specializing the behavior on the arguments used." | ||||
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 | ||||
msgid "" | ||||
| | @ -2097,18 +2142,17 @@ msgid "" | |||
"function call, but it can also check the result value and raise an exception " | ||||
"if the foreign function call failed." | ||||
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 | ||||
msgid "" | ||||
"This exception is raised when a foreign function call cannot convert one of " | ||||
"the passed arguments." | ||||
msgstr "" | ||||
| ||||
#: library/ctypes.rst:None | ||||
msgid "" | ||||
"Raises an :ref:`auditing event <auditing>` ``ctypes.seh_exception`` with " | ||||
"argument ``code``." | ||||
msgstr "" | ||||
"Exception levée quand un appel à la fonction externe ne peut pas convertir " | ||||
"un des arguments qu'elle a reçus." | ||||
| ||||
#: library/ctypes.rst:1615 | ||||
msgid "" | ||||
| | @ -2118,12 +2162,12 @@ msgid "" | |||
"seh_exception`` with argument ``code`` will be raised, allowing an audit " | ||||
"hook to replace the exception with its own." | ||||
msgstr "" | ||||
| ||||
#: library/ctypes.rst:None | ||||
msgid "" | ||||
"Raises an :ref:`auditing event <auditing>` ``ctypes.call_function`` with " | ||||
"arguments ``func_pointer``, ``arguments``." | ||||
msgstr "" | ||||
"En Windows, quand un appel à une fonction externe lève une exception système " | ||||
"(par exemple, une erreur de segmentation), celle-ci est interceptée pour " | ||||
"être remplacée par l'exception Python correspondante. De plus, un évènement " | ||||
"d'audit ``ctypes.seh_exception`` est levé avec ``code`` en argument, ce qui " | ||||
"permet à un point d'entrée (*hook* en anglais) d'audit de remplacer " | ||||
"l'exception par une des siennes." | ||||
| ||||
#: library/ctypes.rst:1623 | ||||
msgid "" | ||||
| | @ -2131,6 +2175,9 @@ msgid "" | |||
"``ctypes.call_function`` with arguments ``function pointer`` and " | ||||
"``arguments``." | ||||
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 | ||||
msgid "Function prototypes" | ||||
| | @ -2652,12 +2699,6 @@ msgid "" | |||
"*address* which must be an integer." | ||||
msgstr "" | ||||
| ||||
#: library/ctypes.rst:None | ||||
msgid "" | ||||
"Raises an :ref:`auditing event <auditing>` ``ctypes.cdata`` with argument " | ||||
"``address``." | ||||
msgstr "" | ||||
| ||||
#: library/ctypes.rst:2082 | ||||
msgid "" | ||||
"This method, and others that indirectly call this method, raises an :ref:" | ||||
| | | |||
Loading…
Add table
Add a link
Reference in a new issue