This commit is contained in:
Julien Palard 2017-01-20 14:39:07 +01:00
parent 53d20251cd
commit 8f4be2b252
2 changed files with 105 additions and 100 deletions

View File

@ -27,12 +27,12 @@ msgstr "Tshepang Lekhonkhobe"
#: ../Doc/howto/argparse.rst:9 #: ../Doc/howto/argparse.rst:9
msgid "" msgid ""
"This tutorial is intended to be a gentle introduction to :mod:`argparse`, the " "This tutorial is intended to be a gentle introduction to :mod:`argparse`, "
"recommended command-line parsing module in the Python standard library." "the recommended command-line parsing module in the Python standard library."
msgstr "" msgstr ""
"Ce tutoriel est destiné à être une introduction en douceur à :mod:`argparse`, " "Ce tutoriel est destiné à être une introduction en douceur à :mod:"
"le module d'analyse de ligne de commande recommandé dans la bibliothèque " "`argparse`, le module d'analyse de ligne de commande recommandé dans la "
"standard de Python." "bibliothèque standard de Python."
#: ../Doc/howto/argparse.rst:14 #: ../Doc/howto/argparse.rst:14
msgid "" msgid ""
@ -55,8 +55,8 @@ msgid ""
"Let's show the sort of functionality that we are going to explore in this " "Let's show the sort of functionality that we are going to explore in this "
"introductory tutorial by making use of the :command:`ls` command:" "introductory tutorial by making use of the :command:`ls` command:"
msgstr "" msgstr ""
"Commençons par l'utilisation de la commande :command:`ls` pour voir le type de " "Commençons par l'utilisation de la commande :command:`ls` pour voir le type "
"fonctionnalité que nous allons étudier dans ce tutoriel d'introduction :" "de fonctionnalité que nous allons étudier dans ce tutoriel d'introduction :"
#: ../Doc/howto/argparse.rst:46 #: ../Doc/howto/argparse.rst:46
msgid "A few concepts we can learn from the four commands:" msgid "A few concepts we can learn from the four commands:"
@ -72,29 +72,29 @@ msgstr ""
#: ../Doc/howto/argparse.rst:51 #: ../Doc/howto/argparse.rst:51
msgid "" msgid ""
"If we want beyond what it provides by default, we tell it a bit more. In this " "If we want beyond what it provides by default, we tell it a bit more. In "
"case, we want it to display a different directory, ``pypy``. What we did is " "this case, we want it to display a different directory, ``pypy``. What we "
"specify what is known as a positional argument. It's named so because the " "did is specify what is known as a positional argument. It's named so because "
"program should know what to do with the value, solely based on where it " "the program should know what to do with the value, solely based on where it "
"appears on the command line. This concept is more relevant to a command like :" "appears on the command line. This concept is more relevant to a command "
"command:`cp`, whose most basic usage is ``cp SRC DEST``. The first position is " "like :command:`cp`, whose most basic usage is ``cp SRC DEST``. The first "
"*what you want copied,* and the second position is *where you want it copied " "position is *what you want copied,* and the second position is *where you "
"to*." "want it copied to*."
msgstr "" msgstr ""
"Si l'on veut plus que ce qui est proposé par défaut, il faut l'indiquer. Dans " "Si l'on veut plus que ce qui est proposé par défaut, il faut l'indiquer. "
"le cas présent, on veut afficher un dossier différent : ``pypy``. Ce que l'on " "Dans le cas présent, on veut afficher un dossier différent : ``pypy``. Ce "
"a fait c'est spécifier un argument positionnel. C'est appelé ainsi car cela " "que l'on a fait c'est spécifier un argument positionnel. C'est appelé ainsi "
"permet au programme de savoir quoi faire avec la valeur seulement en se basant " "car cela permet au programme de savoir quoi faire avec la valeur seulement "
"sur sa position dans la ligne de commande. Ce concept est plus pertinent pour " "en se basant sur sa position dans la ligne de commande. Ce concept est plus "
"une commande comme :command:`cp` dont l'usage de base est ``cp SRC DEST``. Le " "pertinent pour une commande comme :command:`cp` dont l'usage de base est "
"premier argument est *ce que vous voulez copier* et le second est *où vous " "``cp SRC DEST``. Le premier argument est *ce que vous voulez copier* et le "
"voulez le copier*." "second est *où vous voulez le copier*."
#: ../Doc/howto/argparse.rst:60 #: ../Doc/howto/argparse.rst:60
msgid "" msgid ""
"Now, say we want to change behaviour of the program. In our example, we " "Now, say we want to change behaviour of the program. In our example, we "
"display more info for each file instead of just showing the file names. The ``-" "display more info for each file instead of just showing the file names. The "
"l`` in that case is known as an optional argument." "``-l`` in that case is known as an optional argument."
msgstr "" msgstr ""
"Maintenant, supposons que l'on veut changer la façon dont le programme agit. " "Maintenant, supposons que l'on veut changer la façon dont le programme agit. "
"Dans notre exemple, on affiche plus d'information pour chaque ficher que " "Dans notre exemple, on affiche plus d'information pour chaque ficher que "
@ -116,7 +116,8 @@ msgstr "Les bases"
#: ../Doc/howto/argparse.rst:72 #: ../Doc/howto/argparse.rst:72
msgid "Let us start with a very simple example which does (almost) nothing::" msgid "Let us start with a very simple example which does (almost) nothing::"
msgstr "Commençons par un exemple très simple qui ne fait (quasiment) rien : ::" msgstr ""
"Commençons par un exemple très simple qui ne fait (quasiment) rien : ::"
#: ../Doc/howto/argparse.rst:78 ../Doc/howto/argparse.rst:186 #: ../Doc/howto/argparse.rst:78 ../Doc/howto/argparse.rst:186
#: ../Doc/howto/argparse.rst:207 #: ../Doc/howto/argparse.rst:207
@ -130,16 +131,16 @@ msgstr "Voilà ce qu'il ce passe :"
#: ../Doc/howto/argparse.rst:97 #: ../Doc/howto/argparse.rst:97
msgid "" msgid ""
"Running the script without any options results in nothing displayed to stdout. " "Running the script without any options results in nothing displayed to "
"Not so useful." "stdout. Not so useful."
msgstr "" msgstr ""
"Exécuter le script sans aucune option à pour effet que rien est affiché sur " "Exécuter le script sans aucune option à pour effet que rien est affiché sur "
"stdout. Ce n'est pas très utile." "stdout. Ce n'est pas très utile."
#: ../Doc/howto/argparse.rst:100 #: ../Doc/howto/argparse.rst:100
msgid "" msgid ""
"The second one starts to display the usefulness of the :mod:`argparse` module. " "The second one starts to display the usefulness of the :mod:`argparse` "
"We have done almost nothing, but already we get a nice help message." "module. We have done almost nothing, but already we get a nice help message."
msgstr "" msgstr ""
"Le deuxième commence à montrer l'intérêt du module :mod:`argparse`. On a " "Le deuxième commence à montrer l'intérêt du module :mod:`argparse`. On a "
"quasiment rien fait mais on a déjà un beau message d'aide." "quasiment rien fait mais on a déjà un beau message d'aide."
@ -147,14 +148,14 @@ msgstr ""
#: ../Doc/howto/argparse.rst:103 #: ../Doc/howto/argparse.rst:103
msgid "" msgid ""
"The ``--help`` option, which can also be shortened to ``-h``, is the only " "The ``--help`` option, which can also be shortened to ``-h``, is the only "
"option we get for free (i.e. no need to specify it). Specifying anything else " "option we get for free (i.e. no need to specify it). Specifying anything "
"results in an error. But even then, we do get a useful usage message, also for " "else results in an error. But even then, we do get a useful usage message, "
"free." "also for free."
msgstr "" msgstr ""
"L'option ``--help``, que l'on peut aussi raccourcir en ``-h``, est la seule " "L'option ``--help``, que l'on peut aussi raccourcir en ``-h``, est la seule "
"option que l'on a gratuitement (i.e. pas besoin de la préciser). Préciser quoi " "option que l'on a gratuitement (i.e. pas besoin de la préciser). Préciser "
"que ce soit d'autre entrainera une erreur. Mais même dans ce cas, on reçoit " "quoi que ce soit d'autre entrainera une erreur. Mais même dans ce cas, on "
"aussi un message utile, toujours gratuitement." "reçoit aussi un message utile, toujours gratuitement."
#: ../Doc/howto/argparse.rst:110 #: ../Doc/howto/argparse.rst:110
msgid "Introducing Positional arguments" msgid "Introducing Positional arguments"
@ -184,21 +185,23 @@ msgstr ""
#: ../Doc/howto/argparse.rst:144 #: ../Doc/howto/argparse.rst:144
msgid "Calling our program now requires us to specify an option." msgid "Calling our program now requires us to specify an option."
msgstr "Utiliser le programme nécessite maintenant que l'on précise une option." msgstr ""
"Utiliser le programme nécessite maintenant que l'on précise une option."
#: ../Doc/howto/argparse.rst:146 #: ../Doc/howto/argparse.rst:146
msgid "" msgid ""
"The :meth:`parse_args` method actually returns some data from the options " "The :meth:`parse_args` method actually returns some data from the options "
"specified, in this case, ``echo``." "specified, in this case, ``echo``."
msgstr "" msgstr ""
"La méthode :meth:`parse_args` renvoie en réalité certaines données des options " "La méthode :meth:`parse_args` renvoie en réalité certaines données des "
"précisées, dans le cas présent : ``echo``." "options précisées, dans le cas présent : ``echo``."
#: ../Doc/howto/argparse.rst:149 #: ../Doc/howto/argparse.rst:149
msgid "" msgid ""
"The variable is some form of 'magic' that :mod:`argparse` performs for free (i." "The variable is some form of 'magic' that :mod:`argparse` performs for free "
"e. no need to specify which variable that value is stored in). You will also " "(i.e. no need to specify which variable that value is stored in). You will "
"notice that its name matches the string argument given to the method, ``echo``." "also notice that its name matches the string argument given to the method, "
"``echo``."
msgstr "" msgstr ""
"La variable est comme une forme de 'magie' que :mod:`argparse` effectue " "La variable est comme une forme de 'magie' que :mod:`argparse` effectue "
"gratuitement (i.e. pas besoin de préciser dans quelle variable la valeur est " "gratuitement (i.e. pas besoin de préciser dans quelle variable la valeur est "
@ -207,16 +210,17 @@ msgstr ""
#: ../Doc/howto/argparse.rst:154 #: ../Doc/howto/argparse.rst:154
msgid "" msgid ""
"Note however that, although the help display looks nice and all, it currently " "Note however that, although the help display looks nice and all, it "
"is not as helpful as it can be. For example we see that we got ``echo`` as a " "currently is not as helpful as it can be. For example we see that we got "
"positional argument, but we don't know what it does, other than by guessing or " "``echo`` as a positional argument, but we don't know what it does, other "
"by reading the source code. So, let's make it a bit more useful::" "than by guessing or by reading the source code. So, let's make it a bit more "
"useful::"
msgstr "" msgstr ""
"Notez cependant que, même si l'affichage d'aide paraît bien , il n'est pas " "Notez cependant que, même si l'affichage d'aide paraît bien , il n'est pas "
"aussi utile qu'il pourrait l'être. Par exemple, on peut lire que ``echo`` est " "aussi utile qu'il pourrait l'être. Par exemple, on peut lire que ``echo`` "
"un argument positionnel mais on ne peut pas savoir ce que cela fait autrement " "est un argument positionnel mais on ne peut pas savoir ce que cela fait "
"qu'en le devinant ou en lisant le code source. Donc, rendons le un peu plus " "autrement qu'en le devinant ou en lisant le code source. Donc, rendons le un "
"utile : ::" "peu plus utile : ::"
#: ../Doc/howto/argparse.rst:165 #: ../Doc/howto/argparse.rst:165
msgid "And we get:" msgid "And we get:"
@ -234,18 +238,18 @@ msgid ""
"give it as strings, unless we tell it otherwise. So, let's tell :mod:" "give it as strings, unless we tell it otherwise. So, let's tell :mod:"
"`argparse` to treat that input as an integer::" "`argparse` to treat that input as an integer::"
msgstr "" msgstr ""
"Cela n'a pas très bien fonctionné. C'est parce que :mod:`argparse` traite les " "Cela n'a pas très bien fonctionné. C'est parce que :mod:`argparse` traite "
"options que l'on donnes comme des chaînes de caractères à moins qu'on ne lui " "les options que l'on donnes comme des chaînes de caractères à moins qu'on ne "
"indique de faire autrement. Donc, disons à :mod:`argparse` de traiter cette " "lui indique de faire autrement. Donc, disons à :mod:`argparse` de traiter "
"entrée comme un entier : ::" "cette entrée comme un entier : ::"
#: ../Doc/howto/argparse.rst:217 #: ../Doc/howto/argparse.rst:217
msgid "" msgid ""
"That went well. The program now even helpfully quits on bad illegal input " "That went well. The program now even helpfully quits on bad illegal input "
"before proceeding." "before proceeding."
msgstr "" msgstr ""
"Cela a bien fonctionné. Maintenant le programme va même s'arrêter si l'entrée " "Cela a bien fonctionné. Maintenant le programme va même s'arrêter si "
"n'est pas légale avant de procéder à l'exécution." "l'entrée n'est pas légale avant de procéder à l'exécution."
#: ../Doc/howto/argparse.rst:222 #: ../Doc/howto/argparse.rst:222
msgid "Introducing Optional arguments" msgid "Introducing Optional arguments"
@ -253,8 +257,8 @@ msgstr "Introduction aux arguments optionnels"
#: ../Doc/howto/argparse.rst:224 #: ../Doc/howto/argparse.rst:224
msgid "" msgid ""
"So far we, have been playing with positional arguments. Let us have a look on " "So far we, have been playing with positional arguments. Let us have a look "
"how to add optional ones::" "on how to add optional ones::"
msgstr "" msgstr ""
"Jusqu'à maintenant, on a joué avec les arguments positionnels. Regardons " "Jusqu'à maintenant, on a joué avec les arguments positionnels. Regardons "
"comment en ajouter des optionnels : ::" "comment en ajouter des optionnels : ::"
@ -311,18 +315,18 @@ msgstr ""
#: ../Doc/howto/argparse.rst:298 #: ../Doc/howto/argparse.rst:298
msgid "" msgid ""
"The option is now more of a flag than something that requires a value. We even " "The option is now more of a flag than something that requires a value. We "
"changed the name of the option to match that idea. Note that we now specify a " "even changed the name of the option to match that idea. Note that we now "
"new keyword, ``action``, and give it the value ``\"store_true\"``. This means " "specify a new keyword, ``action``, and give it the value ``\"store_true\"``. "
"that, if the option is specified, assign the value ``True`` to :data:`args." "This means that, if the option is specified, assign the value ``True`` to :"
"verbose`. Not specifying it implies ``False``." "data:`args.verbose`. Not specifying it implies ``False``."
msgstr "" msgstr ""
"Maintenant l'option est plus un flag (ou drapeau) que quelque chose qui " "Maintenant l'option est plus un flag (ou drapeau) que quelque chose qui "
"nécessite une valeur. On a même changé le nom de l'option pour qu'elle " "nécessite une valeur. On a même changé le nom de l'option pour qu'elle "
"corresponde à cette idée. Notez que maintenant on précise une nouvelle " "corresponde à cette idée. Notez que maintenant on précise une nouvelle "
"``action`` clavier et qu'on lui donne la valeur ``\"store_true\"``. Cela " "``action`` clavier et qu'on lui donne la valeur ``\"store_true\"``. Cela "
"signifie que si l'option est précisée la valeur ``True`` est assignée à :data:" "signifie que si l'option est précisée la valeur ``True`` est assignée à :"
"`args.verbose`. Ne rien préciser implique la valeur ``False``." "data:`args.verbose`. Ne rien préciser implique la valeur ``False``."
#: ../Doc/howto/argparse.rst:305 #: ../Doc/howto/argparse.rst:305
msgid "" msgid ""
@ -343,11 +347,12 @@ msgstr "Les options raccourcies"
#: ../Doc/howto/argparse.rst:314 #: ../Doc/howto/argparse.rst:314
msgid "" msgid ""
"If you are familiar with command line usage, you will notice that I haven't " "If you are familiar with command line usage, you will notice that I haven't "
"yet touched on the topic of short versions of the options. It's quite simple::" "yet touched on the topic of short versions of the options. It's quite "
"simple::"
msgstr "" msgstr ""
"Si vous êtes familier avec l'utilisation des ligne de commande vous avez dû " "Si vous êtes familier avec l'utilisation des ligne de commande vous avez dû "
"remarqué que je n'ai pour l'instant rien dit au sujet des versions raccourcies " "remarqué que je n'ai pour l'instant rien dit au sujet des versions "
"des options. C'est très simple : ::" "raccourcies des options. C'est très simple : ::"
#: ../Doc/howto/argparse.rst:326 #: ../Doc/howto/argparse.rst:326
msgid "And here goes:" msgid "And here goes:"
@ -386,7 +391,8 @@ msgstr ""
#: ../Doc/howto/argparse.rst:412 #: ../Doc/howto/argparse.rst:412
msgid "" msgid ""
"These all look good except the last one, which exposes a bug in our program. " "These all look good except the last one, which exposes a bug in our program. "
"Let's fix it by restricting the values the ``--verbosity`` option can accept::" "Let's fix it by restricting the values the ``--verbosity`` option can "
"accept::"
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:448 #: ../Doc/howto/argparse.rst:448
@ -397,9 +403,9 @@ msgstr ""
#: ../Doc/howto/argparse.rst:451 #: ../Doc/howto/argparse.rst:451
msgid "" msgid ""
"Now, let's use a different approach of playing with verbosity, which is pretty " "Now, let's use a different approach of playing with verbosity, which is "
"common. It also matches the way the CPython executable handles its own " "pretty common. It also matches the way the CPython executable handles its "
"verbosity argument (check the output of ``python --help``)::" "own verbosity argument (check the output of ``python --help``)::"
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:470 #: ../Doc/howto/argparse.rst:470
@ -420,8 +426,8 @@ msgstr ""
#: ../Doc/howto/argparse.rst:503 #: ../Doc/howto/argparse.rst:503
msgid "" msgid ""
"Now here's a demonstration of what the \"count\" action gives. You've probably " "Now here's a demonstration of what the \"count\" action gives. You've "
"seen this sort of usage before." "probably seen this sort of usage before."
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:506 #: ../Doc/howto/argparse.rst:506
@ -432,15 +438,15 @@ msgstr ""
#: ../Doc/howto/argparse.rst:509 #: ../Doc/howto/argparse.rst:509
msgid "" msgid ""
"As should be expected, specifying the long form of the flag, we should get the " "As should be expected, specifying the long form of the flag, we should get "
"same output." "the same output."
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:512 #: ../Doc/howto/argparse.rst:512
msgid "" msgid ""
"Sadly, our help output isn't very informative on the new ability our script " "Sadly, our help output isn't very informative on the new ability our script "
"has acquired, but that can always be fixed by improving the documentation for " "has acquired, but that can always be fixed by improving the documentation "
"our script (e.g. via the ``help`` keyword argument)." "for our script (e.g. via the ``help`` keyword argument)."
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:516 #: ../Doc/howto/argparse.rst:516
@ -457,8 +463,8 @@ msgstr ""
#: ../Doc/howto/argparse.rst:553 #: ../Doc/howto/argparse.rst:553
msgid "" msgid ""
"First output went well, and fixes the bug we had before. That is, we want any " "First output went well, and fixes the bug we had before. That is, we want "
"value >= 2 to be as verbose as possible." "any value >= 2 to be as verbose as possible."
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:556 #: ../Doc/howto/argparse.rst:556
@ -471,11 +477,11 @@ msgstr ""
#: ../Doc/howto/argparse.rst:575 #: ../Doc/howto/argparse.rst:575
msgid "" msgid ""
"We've just introduced yet another keyword, ``default``. We've set it to ``0`` " "We've just introduced yet another keyword, ``default``. We've set it to "
"in order to make it comparable to the other int values. Remember that by " "``0`` in order to make it comparable to the other int values. Remember that "
"default, if an optional argument isn't specified, it gets the ``None`` value, " "by default, if an optional argument isn't specified, it gets the ``None`` "
"and that cannot be compared to an int value (hence the :exc:`TypeError` " "value, and that cannot be compared to an int value (hence the :exc:"
"exception)." "`TypeError` exception)."
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:582 #: ../Doc/howto/argparse.rst:582
@ -485,8 +491,8 @@ msgstr ""
#: ../Doc/howto/argparse.rst:589 #: ../Doc/howto/argparse.rst:589
msgid "" msgid ""
"You can go quite far just with what we've learned so far, and we have only " "You can go quite far just with what we've learned so far, and we have only "
"scratched the surface. The :mod:`argparse` module is very powerful, and we'll " "scratched the surface. The :mod:`argparse` module is very powerful, and "
"explore a bit more of it before we end this tutorial." "we'll explore a bit more of it before we end this tutorial."
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:596 #: ../Doc/howto/argparse.rst:596
@ -495,8 +501,8 @@ msgstr ""
#: ../Doc/howto/argparse.rst:598 #: ../Doc/howto/argparse.rst:598
msgid "" msgid ""
"What if we wanted to expand our tiny program to perform other powers, not just " "What if we wanted to expand our tiny program to perform other powers, not "
"squares::" "just squares::"
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:615 ../Doc/howto/argparse.rst:653 #: ../Doc/howto/argparse.rst:615 ../Doc/howto/argparse.rst:653
@ -505,9 +511,9 @@ msgstr "Sortie :"
#: ../Doc/howto/argparse.rst:636 #: ../Doc/howto/argparse.rst:636
msgid "" msgid ""
"Notice that so far we've been using verbosity level to *change* the text that " "Notice that so far we've been using verbosity level to *change* the text "
"gets displayed. The following example instead uses verbosity level to display " "that gets displayed. The following example instead uses verbosity level to "
"*more* text instead::" "display *more* text instead::"
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:667 #: ../Doc/howto/argparse.rst:667
@ -526,15 +532,15 @@ msgstr ""
#: ../Doc/howto/argparse.rst:695 #: ../Doc/howto/argparse.rst:695
msgid "" msgid ""
"Our program is now simpler, and we've lost some functionality for the sake of " "Our program is now simpler, and we've lost some functionality for the sake "
"demonstration. Anyways, here's the output:" "of demonstration. Anyways, here's the output:"
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:713 #: ../Doc/howto/argparse.rst:713
msgid "" msgid ""
"That should be easy to follow. I've added that last output so you can see the " "That should be easy to follow. I've added that last output so you can see "
"sort of flexibility you get, i.e. mixing long form options with short form " "the sort of flexibility you get, i.e. mixing long form options with short "
"ones." "form ones."
msgstr "" msgstr ""
#: ../Doc/howto/argparse.rst:717 #: ../Doc/howto/argparse.rst:717

View File

@ -29,9 +29,8 @@ msgid ""
msgstr "" msgstr ""
"Les Python HOWTOs sont des documents, les plus complets possible , qui " "Les Python HOWTOs sont des documents, les plus complets possible , qui "
"couvrent chacun un sujet unique et spécifique. Modélisé comme le recueil de " "couvrent chacun un sujet unique et spécifique. Modélisé comme le recueil de "
"Documentation Project, ce recueil est un effort pour favoriser une " "Documentation Project, ce recueil est un effort pour favoriser une HOWTOs de "
"HOWTOs de The Linux documentation plus détaillée que celle du Python Library " "The Linux documentation plus détaillée que celle du Python Library Reference."
"Reference."
#: ../Doc/howto/index.rst:11 #: ../Doc/howto/index.rst:11
msgid "Currently, the HOWTOs are:" msgid "Currently, the HOWTOs are:"