Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f1dd86

Browse files
awecxjeanas
andauthored
Traduction de library/ctypes (#1760)
Co-authored-by: Jean-Abou-Samra <[email protected]>
1 parent 9882154 commit 5f1dd86

File tree

1 file changed

+100
-19
lines changed

1 file changed

+100
-19
lines changed

library/ctypes.po

Lines changed: 100 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ msgstr ""
66
"Project-Id-Version: Python 3\n"
77
"Report-Msgid-Bugs-To: \n"
88
"POT-Creation-Date: 2021-09-23 16:16+0200\n"
9-
"PO-Revision-Date: 2020-08-17 23:01+0200\n"
9+
"PO-Revision-Date: 2021-11-09 08:06+0100\n"
1010
"Last-Translator: Antoine Wecxsteen\n"
1111
"Language-Team: FRENCH <[email protected]>\n"
1212
"Language: fr\n"
@@ -36,15 +36,14 @@ msgid "ctypes tutorial"
3636
msgstr "Didacticiel de *ctypes*"
3737

3838
#: library/ctypes.rst:21
39-
#, fuzzy
4039
msgid ""
4140
"Note: The code samples in this tutorial use :mod:`doctest` to make sure that "
4241
"they actually work. Since some code samples behave differently under Linux, "
4342
"Windows, or macOS, they contain doctest directives in comments."
4443
msgstr ""
45-
"Remarque : Les exemples de code de ce didacticiel utilisent :mod:`doctest` "
44+
"Remarque : les exemples de code de ce didacticiel utilisent :mod:`doctest` "
4645
"pour s'assurer de leur propre bon fonctionnement. Vu que certains de ces "
47-
"exemples ont un comportement différent en Linux, Windows ou Mac OS X, ils "
46+
"exemples ont un comportement différent en Linux, Windows ou macOS, ils "
4847
"contiennent des directives *doctest* dans les commentaires."
4948

5049
#: library/ctypes.rst:25
@@ -54,7 +53,7 @@ msgid ""
5453
"`c_long`. So, you should not be confused if :class:`c_long` is printed if "
5554
"you would expect :class:`c_int` --- they are actually the same type."
5655
msgstr ""
57-
"Remarque : Le type :class:`c_int` du module apparaît dans certains de ces "
56+
"Remarque : le type :class:`c_int` du module apparaît dans certains de ces "
5857
"exemples. Sur les plates-formes où ``sizeof(long) == sizeof(int)``, ce type "
5958
"est un alias de :class:`c_long`. Ne soyez donc pas surpris si :class:"
6059
"`c_long` s'affiche là où vous vous attendiez à :class:`c_int` — il s'agit "
@@ -867,7 +866,6 @@ msgid "Structure/union alignment and byte order"
867866
msgstr "Alignement et boutisme des structures et des unions"
868867

869868
#: library/ctypes.rst:619
870-
#, fuzzy
871869
msgid ""
872870
"By default, Structure and Union fields are aligned in the same way the C "
873871
"compiler does it. It is possible to override this behavior by specifying a :"
@@ -1159,7 +1157,6 @@ msgstr ""
11591157
"plus tard, après avoir défini la classe ::"
11601158

11611159
#: library/ctypes.rst:918
1162-
#, fuzzy
11631160
msgid ""
11641161
"Let's try it. We create two instances of ``cell``, and let them point to "
11651162
"each other, and finally follow the pointer chain a few times::"
@@ -1613,12 +1610,11 @@ msgid "Here are some examples::"
16131610
msgstr "Voici quelques exemples :"
16141611

16151612
#: library/ctypes.rst:1291
1616-
#, fuzzy
16171613
msgid ""
16181614
"On macOS, :func:`find_library` tries several predefined naming schemes and "
16191615
"paths to locate the library, and returns a full pathname if successful::"
16201616
msgstr ""
1621-
"Sous OS X, :func:`find_library` regarde dans des chemins et conventions de "
1617+
"Sous macOS, :func:`find_library` regarde dans des chemins et conventions de "
16221618
"chemins prédéfinies pour trouver la bibliothèque et en renvoie le chemin "
16231619
"complet si elle la trouve :"
16241620

@@ -1680,12 +1676,22 @@ msgid ""
16801676
"which DLL is not found, you need to find the list of dependent DLLs and "
16811677
"determine which one is not found using Windows debugging and tracing tools."
16821678
msgstr ""
1679+
"En Windows, créer une instance de :class:`CDLL` peut échouer, même si une "
1680+
"DLL du bon nom existe. Quand une des dépendances de la DLL à charger ne peut "
1681+
"pas être trouvée, une :exc:`OSError` est levée avec le message *\"[WinError "
1682+
"126] The specified module could not be found\".* Ce message d'erreur ne "
1683+
"contient pas le nom de la DLL manquante car l'API Windows ne fournit pas "
1684+
"cette information. Cela rend l'erreur délicate à analyser ; pour la "
1685+
"résoudre, il faut lister toutes les dépendances de la DLL et trouver celle "
1686+
"qui manque en utilisant des outils de débogage et de traçage Windows."
16831687

16841688
#: library/ctypes.rst:1341
16851689
msgid ""
16861690
"`Microsoft DUMPBIN tool <https://docs.microsoft.com/cpp/build/reference/"
16871691
"dependents>`_ -- A tool to find DLL dependents."
16881692
msgstr ""
1693+
"`DUMPBIN <https://docs.microsoft.com/cpp/build/reference/dependents>`_ — un "
1694+
"utilitaire Microsoft pour lister les dépendances d'une DLL."
16891695

16901696
#: library/ctypes.rst:1347
16911697
msgid ""
@@ -1894,7 +1900,7 @@ msgstr ""
18941900

18951901
#: library/ctypes.rst:1460
18961902
msgid "The system handle used to access the library."
1897-
msgstr ""
1903+
msgstr "Le lien système d'accès à la bibliothèque."
18981904

18991905
#: library/ctypes.rst:1465
19001906
msgid "The name of the library passed in the constructor."
@@ -1979,14 +1985,12 @@ msgstr ""
19791985
"utiliser."
19801986

19811987
#: library/ctypes.rst:1525
1982-
#, fuzzy
19831988
msgid ""
19841989
"Raises an :ref:`auditing event <auditing>` ``ctypes.dlopen`` with argument "
19851990
"``name``."
19861991
msgstr ""
1987-
"Charger une bibliothèque à l'aide d'un de ces objets avec en argument "
1988-
"``name``, le nom de la bibliothèque (une chaîne de caractères), lève un :ref:"
1989-
"`évènement d'audit <auditing>` ``ctypes.dlopen``."
1992+
"Lève un :ref:`évènement d'audit <auditing>` ``ctypes.dlopen``, avec en "
1993+
"argument ``name``."
19901994

19911995
#: library/ctypes.rst:1527
19921996
msgid ""
@@ -2257,6 +2261,15 @@ msgid ""
22572261
"decorator factories, and as such, be applied to functions through the "
22582262
"``@wrapper`` syntax. See :ref:`ctypes-callback-functions` for examples."
22592263
msgstr ""
2264+
"Il est aussi possible de créer des fonctions externes en instanciant des "
2265+
"prototypes de fonction. Les prototypes de fonction ressemblent beaucoup aux "
2266+
"prototypes de fonctions en C ; ils décrivent une fonction (type de retour, "
2267+
"type des arguments, convention d'appel) sans préciser son implémentation. "
2268+
"Les fabriques de fonctions prennent en entrée le type de retour et le type "
2269+
"des arguments de la fonction, et peuvent être utilisées comme des "
2270+
"décorateurs-fabrique et ainsi s'appliquer à des fonctions avec la syntaxe "
2271+
"``@décorateur``. Ceci est illustré dans la section :ref:`ctypes-callback-"
2272+
"functions`."
22602273

22612274
#: library/ctypes.rst:1657
22622275
msgid ""
@@ -2266,6 +2279,11 @@ msgid ""
22662279
"`errno` variable is exchanged with the real :data:`errno` value before and "
22672280
"after the call; *use_last_error* does the same for the Windows error code."
22682281
msgstr ""
2282+
"Renvoie un prototype de fonction qui crée des fonctions qui suivent la "
2283+
"convention d'appel standard C. Les fonctions libèreront le GIL lors de leur "
2284+
"exécution. Si *use_errno* est vrai, la copie privée *ctypes* de la variable "
2285+
"système :data:`errno` est échangée avec la vraie valeur de :data:`errno` "
2286+
"avant et après l'appel ; *use_last_error* a le même effet sous Windows."
22692287

22702288
#: library/ctypes.rst:1667
22712289
msgid ""
@@ -2275,29 +2293,42 @@ msgid ""
22752293
"the GIL during the call. *use_errno* and *use_last_error* have the same "
22762294
"meaning as above."
22772295
msgstr ""
2296+
"En Windows seulement : renvoie un prototype de fonction qui crée des "
2297+
"fonctions qui suivent la convention d'appel standard ``stdcall``, sauf sous "
2298+
"Windows CE où :func:`WINFUNCTYPE` équivaut à :func:`CFUNCTYPE`. Les "
2299+
"fonctions libèreront le GIL lors de leur exécution. *use_errno* et "
2300+
"*use_last_error* ont la même signification que ci-dessus."
22782301

22792302
#: library/ctypes.rst:1676
22802303
msgid ""
22812304
"The returned function prototype creates functions that use the Python "
22822305
"calling convention. The function will *not* release the GIL during the call."
22832306
msgstr ""
2307+
"Renvoie un prototype de fonction qui crée des fonctions qui suivent la "
2308+
"convention d'appel Python. Les fonctions ne libèreront *pas* le GIL lors de "
2309+
"leur exécution."
22842310

22852311
#: library/ctypes.rst:1679
22862312
msgid ""
22872313
"Function prototypes created by these factory functions can be instantiated "
22882314
"in different ways, depending on the type and number of the parameters in the "
22892315
"call:"
22902316
msgstr ""
2317+
"Il y a plusieurs façons d'instancier les prototypes de fonction créés par "
2318+
"ces fabriques, selon le type et le nombre de paramètres de l'appel :"
22912319

22922320
#: library/ctypes.rst:1687
22932321
msgid ""
22942322
"Returns a foreign function at the specified address which must be an integer."
22952323
msgstr ""
2324+
"Renvoie une fonction externe sur l'adresse donnée sous la forme d'un entier."
22962325

22972326
#: library/ctypes.rst:1694
22982327
msgid ""
22992328
"Create a C callable function (a callback function) from a Python *callable*."
23002329
msgstr ""
2330+
"Crée une fonction appelable depuis du code C (une fonction de rappel) d'un "
2331+
"appelable Python donné en paramètre."
23012332

23022333
#: library/ctypes.rst:1701
23032334
msgid ""
@@ -2306,6 +2337,11 @@ msgid ""
23062337
"exported function as string, or the ordinal of the exported function as "
23072338
"small integer. The second item is the shared library instance."
23082339
msgstr ""
2340+
"Renvoie une fonction externe exposée par une bibliothèque partagée. "
2341+
"*func_spec* est un couple ``(nom_ou_indice, bibliothèque)``. Le premier "
2342+
"élément est le nom de la fonction à passer comme une chaîne ou bien son "
2343+
"indice (dans la table des symboles) à passer comme un entier. Le second "
2344+
"élément est l'instance de la bibliothèque partagée."
23092345

23102346
#: library/ctypes.rst:1711
23112347
msgid ""
@@ -2314,84 +2350,110 @@ msgid ""
23142350
"is name of the COM method. *iid* is an optional pointer to the interface "
23152351
"identifier which is used in extended error reporting."
23162352
msgstr ""
2353+
"Renvoie une fonction qui appelle une méthode COM. *vtbl_index* est l'indice "
2354+
"de la fonction dans la table virtuelle, un petit entier positif. *name* est "
2355+
"le nom de la méthode COM. *iid* est un pointeur optionnel vers "
2356+
"l'identificateur de plateforme, qui est utilisé dans la remontée d'erreurs "
2357+
"étendue."
23172358

23182359
#: library/ctypes.rst:1716
23192360
msgid ""
23202361
"COM methods use a special calling convention: They require a pointer to the "
23212362
"COM interface as first argument, in addition to those parameters that are "
23222363
"specified in the :attr:`argtypes` tuple."
23232364
msgstr ""
2365+
"Les méthodes COM ont une convention d'appel particulière : elles requièrent "
2366+
"de passer un pointeur vers l'interface COM en premier argument, en sus des "
2367+
"arguments passés dans le *n*-uplet :attr:`argtypes`."
23242368

23252369
#: library/ctypes.rst:1720
23262370
msgid ""
23272371
"The optional *paramflags* parameter creates foreign function wrappers with "
23282372
"much more functionality than the features described above."
23292373
msgstr ""
2374+
"Le paramètre optionnel *paramflags* crée une fabrique de fonction externes "
2375+
"avec des fonctionnalités supplémentaires par rapport à celles décrites ci-"
2376+
"dessus."
23302377

23312378
#: library/ctypes.rst:1723
23322379
msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`."
2333-
msgstr ""
2380+
msgstr "*paramflags* est un *n*-uplet de la même taille que :attr:`argtypes`."
23342381

23352382
#: library/ctypes.rst:1725
23362383
msgid ""
23372384
"Each item in this tuple contains further information about a parameter, it "
23382385
"must be a tuple containing one, two, or three items."
23392386
msgstr ""
2387+
"Chaque élément de ce *n*-uplet contient des informations supplémentaires sur "
2388+
"le paramètre correspondant. Ce doit être aussi un *n*-uplet, avec un, deux "
2389+
"ou trois éléments."
23402390

23412391
#: library/ctypes.rst:1728
23422392
msgid ""
23432393
"The first item is an integer containing a combination of direction flags for "
23442394
"the parameter:"
23452395
msgstr ""
2396+
"Le premier élément est un entier qui contient une combinaison de drapeaux "
2397+
"qui précisent le sens des paramètres (entrée ou sortie) :"
23462398

23472399
#: library/ctypes.rst:1732
23482400
msgid "1"
23492401
msgstr "1"
23502402

23512403
#: library/ctypes.rst:1732
23522404
msgid "Specifies an input parameter to the function."
2353-
msgstr ""
2405+
msgstr "Paramètre d'entrée."
23542406

23552407
#: library/ctypes.rst:1735
23562408
msgid "2"
23572409
msgstr "2"
23582410

23592411
#: library/ctypes.rst:1735
23602412
msgid "Output parameter. The foreign function fills in a value."
2361-
msgstr ""
2413+
msgstr "Paramètre de sortie. La fonction externe va modifier cette valeur."
23622414

23632415
#: library/ctypes.rst:1738
23642416
msgid "4"
23652417
msgstr "4"
23662418

23672419
#: library/ctypes.rst:1738
23682420
msgid "Input parameter which defaults to the integer zero."
2369-
msgstr ""
2421+
msgstr "Paramètre d'entrée, valant 0 par défaut."
23702422

23712423
#: library/ctypes.rst:1740
23722424
msgid ""
23732425
"The optional second item is the parameter name as string. If this is "
23742426
"specified, the foreign function can be called with named parameters."
23752427
msgstr ""
2428+
"Le deuxième élément (optionnel) est une chaîne de caractères représentant le "
2429+
"nom du paramètre. Si cet élément est donné, la fonction externe pourra être "
2430+
"appelée avec des paramètres nommés."
23762431

23772432
#: library/ctypes.rst:1743
23782433
msgid "The optional third item is the default value for this parameter."
23792434
msgstr ""
2435+
"Le troisième élément (optionnel) est la valeur par défaut du paramètre."
23802436

23812437
#: library/ctypes.rst:1745
23822438
msgid ""
23832439
"This example demonstrates how to wrap the Windows ``MessageBoxW`` function "
23842440
"so that it supports default parameters and named arguments. The C "
23852441
"declaration from the windows header file is this::"
23862442
msgstr ""
2443+
"L'exemple suivant montre comment encapsuler la fonction Windows "
2444+
"``MessageBoxW`` afin que celle-ci prenne en charge des paramètres par défaut "
2445+
"et des arguments nommés. Sa déclaration C dans le fichier d'en-tête des "
2446+
"fenêtres est ::"
23872447

23882448
#: library/ctypes.rst:1779
23892449
msgid "Here is the wrapping with :mod:`ctypes`::"
2390-
msgstr ""
2450+
msgstr "L'encapsulation :mod:`ctypes` correspondante est alors ::"
23912451

23922452
#: library/ctypes.rst:1764
23932453
msgid "The ``MessageBox`` foreign function can now be called in these ways::"
23942454
msgstr ""
2455+
"La fonction ``MessageBox`` peut désormais être appelée des manières "
2456+
"suivantes ::"
23952457

23962458
#: library/ctypes.rst:1770
23972459
msgid ""
@@ -2400,6 +2462,9 @@ msgid ""
24002462
"copying them into ``RECT`` structure that the caller has to supply. Here is "
24012463
"the C declaration::"
24022464
msgstr ""
2465+
"L'exemple qui suit traite des paramètres en sortie. La fonction win32 "
2466+
"``GetWindowRect`` donne les dimensions d'une fenêtre en les copiant dans une "
2467+
"structure ``RECT`` que l'appelant doit fournir. Sa déclaration en C est ::"
24032468

24042469
#: library/ctypes.rst:1788
24052470
msgid ""
@@ -2408,6 +2473,11 @@ msgid ""
24082473
"parameter values when there are more than one, so the GetWindowRect function "
24092474
"now returns a RECT instance, when called."
24102475
msgstr ""
2476+
"Les fonctions avec des paramètres en sortie renvoient automatiquement la "
2477+
"valeur du paramètre de sortie s'il n'y en a qu'un seul, ou un *n*-uplet avec "
2478+
"les valeurs de sortie de chaque paramètre s'il y en a plusieurs. Ici, la "
2479+
"fonction *GetWindowRect* renvoie donc une instance de *RECT* quand elle est "
2480+
"appelée."
24112481

24122482
#: library/ctypes.rst:1793
24132483
msgid ""
@@ -2417,6 +2487,11 @@ msgid ""
24172487
"function could do the error checking, and raises an exception when the api "
24182488
"call failed::"
24192489
msgstr ""
2490+
"Il est possible de combiner des paramètres en sortie avec le protocole :attr:"
2491+
"`errcheck` pour post-traiter les sorties et faire de la vérification "
2492+
"d'erreur. La fonction de l'API win32 ``GetWindowRect`` renvoie un ``BOOL`` "
2493+
"pour indiquer le succès ou l'échec de l'exécution, donc cette fonction peut "
2494+
"vérifier le résultat et lever une exception quand l'appel à l'API a échoué ::"
24202495

24212496
#: library/ctypes.rst:1806
24222497
msgid ""
@@ -2426,6 +2501,12 @@ msgid ""
24262501
"instead of a ``RECT`` instance, you can retrieve the fields in the function "
24272502
"and return them instead, the normal processing will no longer take place::"
24282503
msgstr ""
2504+
"Si la fonction :attr:`errcheck` renvoie le *n*-uplet passé en paramètre sans "
2505+
"rien y changer, :mod:`ctypes` continue l'exécution habituelle des paramètres "
2506+
"en sortie. Si on préfère renvoyer un *n*-uplet de coordonnées au lieu de "
2507+
"renvoyer une instance de ``RECT``, il faut récupérer les champs "
2508+
"correspondants et les renvoyer en retour. Dans ce cas, l'exécution "
2509+
"habituelle n'a plus lieu ::"
24292510

24302511
#: library/ctypes.rst:1825
24312512
msgid "Utility functions"

0 commit comments

Comments
 (0)