1
0
Fork 0
python-docs-fr/library/argparse.po

2865 lines
122 KiB
Plaintext
Raw Normal View History

2018-07-04 09:06:45 +00:00
# Copyright (C) 2001-2018, Python Software Foundation
2018-07-04 09:08:42 +00:00
# For licence information, see README file.
2016-10-30 09:46:26 +00:00
#
msgid ""
msgstr ""
2019-12-05 22:15:54 +00:00
"Project-Id-Version: Python 3\n"
2016-10-30 09:46:26 +00:00
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-01-15 22:33+0100\n"
"PO-Revision-Date: 2023-02-17 16:38+0100\n"
"Last-Translator: Jean Abou Samra <jean@abou-samra.fr>\n"
2018-07-04 09:14:25 +00:00
"Language-Team: FRENCH <traductions@lists.afpy.org>\n"
2017-05-23 22:40:56 +00:00
"Language: fr\n"
2016-10-30 09:46:26 +00:00
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 3.0.1\n"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2
2016-10-30 09:46:26 +00:00
msgid ""
":mod:`argparse` --- Parser for command-line options, arguments and sub-"
"commands"
msgstr ""
":mod:`argparse` -- Analyseur d'arguments, d'options, et de sous-commandes de "
2017-08-30 11:28:19 +00:00
"ligne de commande"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:12
2016-10-30 09:46:26 +00:00
msgid "**Source code:** :source:`Lib/argparse.py`"
msgstr "**Code source:** :source:`Lib/argparse.py`"
#: library/argparse.rst:None
2018-06-10 09:32:30 +00:00
msgid "Tutorial"
msgstr "Tutoriel"
#: library/argparse.rst:18
2016-10-30 09:46:26 +00:00
msgid ""
"This page contains the API reference information. For a more gentle "
"introduction to Python command-line parsing, have a look at the :ref:"
"`argparse tutorial <argparse-tutorial>`."
msgstr ""
2017-08-30 11:28:19 +00:00
"Cette page est la référence de l'API. Pour une introduction plus en douceur "
2017-09-24 21:19:43 +00:00
"à l'analyse des arguments de la ligne de commande, regardez :ref:`le "
"tutoriel argparse <argparse-tutorial>`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:22
2016-10-30 09:46:26 +00:00
msgid ""
"The :mod:`argparse` module makes it easy to write user-friendly command-line "
"interfaces. The program defines what arguments it requires, and :mod:"
"`argparse` will figure out how to parse those out of :data:`sys.argv`. The :"
2022-05-22 21:15:02 +00:00
"mod:`argparse` module also automatically generates help and usage messages. "
"The module will also issue errors when users give the program invalid "
"arguments."
2016-10-30 09:46:26 +00:00
msgstr ""
"Le module :mod:`argparse` facilite l'écriture d'interfaces en ligne de "
"commande agréables à l'emploi. Le programme définit les arguments requis et :"
"mod:`argparse` s'arrange pour analyser ceux provenant de :data:`sys.argv`. "
"Le module :mod:`argparse` génère aussi automatiquement les messages d'aide, "
"le mode d'emploi, et lève des erreurs lorsque les utilisateurs fournissent "
"des arguments invalides."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:30
2022-05-22 21:15:02 +00:00
msgid "Core Functionality"
msgstr "Fonctionnalité principale"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:32
msgid ""
"The :mod:`argparse` module's support for command-line interfaces is built "
"around an instance of :class:`argparse.ArgumentParser`. It is a container "
"for argument specifications and has options that apply the parser as whole::"
msgstr ""
"L'interface en ligne de commande du module :mod:`argparse` est basée sur une "
"instance d':class:`argparse.ArgumentParser` sur laquelle les arguments et "
"options de l'analyseur sont déclarés ::"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:41
msgid ""
"The :meth:`ArgumentParser.add_argument` method attaches individual argument "
"specifications to the parser. It supports positional arguments, options "
"that accept values, and on/off flags::"
msgstr ""
"La méthode :meth:`ArgumentParser.add_argument` permet de définir les "
"arguments de l'analyseur. Ceux-ci peuvent être des arguments positionnels, "
"des arguments optionnels ou des drapeaux (qui sont alors traduits en valeurs "
"booléennes). Les arguments ont la possibilité d'être complétés par des "
"valeurs ::"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:50
msgid ""
"The :meth:`ArgumentParser.parse_args` method runs the parser and places the "
"extracted data in a :class:`argparse.Namespace` object::"
msgstr ""
"La méthode :meth:`ArgumentParser.parse_args` lance l'analyseur et stocke les "
"résultats dans un objet :class:`argparse.Namespace` ::"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:58
msgid "Quick Links for add_argument()"
msgstr "Référence pour ``add_argument()``"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:61
msgid "Name"
msgstr "Nom"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:61
msgid "Description"
msgstr "Description"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:61
msgid "Values"
msgstr "Valeurs"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:63
msgid "action_"
msgstr "action_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:63
msgid "Specify how an argument should be handled"
msgstr "Précise la gestion d'un argument"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:63
msgid ""
"``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, "
"``'append_const'``, ``'count'``, ``'help'``, ``'version'``"
msgstr ""
"``'store'``, ``'store_const'``, ``'store_true'``, ``'append'``, "
"``'append_const'``, ``'count'``, ``'help'``, ``'version'``"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:64
msgid "choices_"
msgstr "choices_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:64
msgid "Limit values to a specific set of choices"
msgstr "Limite le choix à certaines valeurs"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:64
msgid ""
"``['foo', 'bar']``, ``range(1, 10)``, or :class:`~collections.abc.Container` "
"instance"
msgstr ""
"``['foo', 'bar']``, ``range(1, 10)`` ou une instance de :class:"
"`~collections.abc.Container`"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:65
msgid "const_"
msgstr "const_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:65
msgid "Store a constant value"
msgstr "Utilise une valeur constante"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:66
msgid "default_"
msgstr "default_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:66
msgid "Default value used when an argument is not provided"
msgstr "Valeur à utiliser en l'absence d'un argument"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:66
msgid "Defaults to ``None``"
msgstr "``None`` par défaut"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:67
msgid "dest_"
msgstr "dest_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:67
msgid "Specify the attribute name used in the result namespace"
msgstr ""
"Définit le nom de l'attribut à utiliser dans l'espace de nommage résultant"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:68
msgid "help_"
msgstr "help_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:68
msgid "Help message for an argument"
msgstr "Message d'aide pour l'argument"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:69
msgid "metavar_"
msgstr "metavar_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:69
msgid "Alternate display name for the argument as shown in help"
msgstr "Autre nom possible pour l'argument, est affiché dans l'aide"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:70
msgid "nargs_"
msgstr "nargs_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:70
msgid "Number of times the argument can be used"
msgstr "Précise le nombre de répétitions de l'argument"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:70
msgid ":class:`int`, ``'?'``, ``'*'``, ``'+'``, or ``argparse.REMAINDER``"
msgstr ":class:`int`, ``'?'``, ``'*'``, ``'+'`` ou ``argparse.REMAINDER``"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:71
msgid "required_"
msgstr "required_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:71
msgid "Indicate whether an argument is required or optional"
msgstr "Précise si l'argument est obligatoire ou optionnel"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:71
msgid "``True`` or ``False``"
msgstr "``True`` ou ``False``"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:72
msgid "type_"
msgstr "type_"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:72
msgid "Automatically convert an argument to the given type"
msgstr "Conversion automatique vers le type fourni"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:72
msgid ""
":class:`int`, :class:`float`, ``argparse.FileType('w')``, or callable "
"function"
msgstr ""
":class:`int`, :class:`float`, ``argparse.FileType('w')`` ou une fonction"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:77
2016-10-30 09:46:26 +00:00
msgid "Example"
msgstr "Exemple"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:79
2016-10-30 09:46:26 +00:00
msgid ""
"The following code is a Python program that takes a list of integers and "
"produces either the sum or the max::"
msgstr ""
"Le code suivant est un programme Python acceptant une liste de nombres "
"entiers et en donnant soit la somme, soit le maximum ::"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:94
2016-10-30 09:46:26 +00:00
msgid ""
2022-05-22 21:15:02 +00:00
"Assuming the above Python code is saved into a file called ``prog.py``, it "
"can be run at the command line and it provides useful help messages:"
2016-10-30 09:46:26 +00:00
msgstr ""
"Après avoir sauvegardé le code Python ci-dessus dans un fichier nommé ``prog."
"py``, il peut être lancé en ligne de commande et fournit le message d'aide "
"suivant :"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:111
2016-10-30 09:46:26 +00:00
msgid ""
"When run with the appropriate arguments, it prints either the sum or the max "
"of the command-line integers:"
msgstr ""
"Lorsqu'il est lancé avec les arguments appropriés, il affiche la somme ou le "
"maximum des entiers fournis :"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:122
msgid "If invalid arguments are passed in, an error will be displayed:"
msgstr "Si des arguments invalides sont passés, il affiche une erreur :"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:130
2016-10-30 09:46:26 +00:00
msgid "The following sections walk you through this example."
msgstr "Les sections suivantes vous guident au travers de cet exemple."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:134
2016-10-30 09:46:26 +00:00
msgid "Creating a parser"
msgstr "Créer un analyseur (*parser* en anglais)"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:136
2016-10-30 09:46:26 +00:00
msgid ""
"The first step in using the :mod:`argparse` is creating an :class:"
"`ArgumentParser` object::"
msgstr ""
"La première étape dans l'utilisation de :mod:`argparse` est de créer un "
"objet :class:`ArgumentParser` ::"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:141
2016-10-30 09:46:26 +00:00
msgid ""
"The :class:`ArgumentParser` object will hold all the information necessary "
"to parse the command line into Python data types."
msgstr ""
"L'objet :class:`ArgumentParser` contiendra toutes les informations "
"nécessaires pour interpréter la ligne de commande comme des types de données "
"de Python."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:146
2016-10-30 09:46:26 +00:00
msgid "Adding arguments"
msgstr "Ajouter des arguments"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:148
2016-10-30 09:46:26 +00:00
msgid ""
"Filling an :class:`ArgumentParser` with information about program arguments "
"is done by making calls to the :meth:`~ArgumentParser.add_argument` method. "
"Generally, these calls tell the :class:`ArgumentParser` how to take the "
"strings on the command line and turn them into objects. This information is "
"stored and used when :meth:`~ArgumentParser.parse_args` is called. For "
"example::"
msgstr ""
"Alimenter un :class:`ArgumentParser` avec des informations sur les arguments "
"du programme s'effectue en faisant des appels à la méthode :meth:"
"`~ArgumentParser.add_argument`. En général ces appels disent à l':class:"
"`ArgumentParser` comment prendre les chaînes de caractères de la ligne de "
"commande et les transformer en objets. Cette information est stockée et "
"utilisée lorsque :meth:`~ArgumentParser.parse_args` est appelée. Par "
"exemple ::"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:160
2016-10-30 09:46:26 +00:00
msgid ""
"Later, calling :meth:`~ArgumentParser.parse_args` will return an object with "
"two attributes, ``integers`` and ``accumulate``. The ``integers`` attribute "
2022-05-22 21:15:02 +00:00
"will be a list of one or more integers, and the ``accumulate`` attribute "
"will be either the :func:`sum` function, if ``--sum`` was specified at the "
"command line, or the :func:`max` function if it was not."
2016-10-30 09:46:26 +00:00
msgstr ""
"Ensuite, appeler :meth:`~ArgumentParser.parse_args` va renvoyer un objet "
"avec deux attributs, ``integers`` et ``accumulate``. L'attribut ``integers`` "
"est une liste d'un ou plusieurs entiers, et l'attribut ``accumulate`` est "
"soit la fonction :func:`sum`, si ``--sum`` était fourni à la ligne de "
"commande, soit la fonction :func:`max` dans le cas contraire."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:168
2016-10-30 09:46:26 +00:00
msgid "Parsing arguments"
msgstr "Analyse des arguments"
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:170
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentParser` parses arguments through the :meth:`~ArgumentParser."
"parse_args` method. This will inspect the command line, convert each "
"argument to the appropriate type and then invoke the appropriate action. In "
"most cases, this means a simple :class:`Namespace` object will be built up "
"from attributes parsed out of the command line::"
msgstr ""
":class:`ArgumentParser` analyse les arguments avec la méthode :meth:"
"`~ArgumentParser.parse_args`. Cette méthode inspecte la ligne de commande, "
"convertit chaque argument au type approprié et invoque l'action requise. "
"Dans la plupart des cas, le résultat est la construction d'un objet :class:"
"`Namespace` à partir des attributs analysés dans la ligne de commande ::"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:179
2016-10-30 09:46:26 +00:00
msgid ""
"In a script, :meth:`~ArgumentParser.parse_args` will typically be called "
"with no arguments, and the :class:`ArgumentParser` will automatically "
"determine the command-line arguments from :data:`sys.argv`."
msgstr ""
"Dans un script, :meth:`~ArgumentParser.parse_args` est généralement appelée "
"sans arguments et l'objet :class:`ArgumentParser` détermine automatiquement "
"les arguments de la ligne de commande à partir de :data:`sys.argv`."
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:185
2016-10-30 09:46:26 +00:00
msgid "ArgumentParser objects"
msgstr "Objets ``ArgumentParser``"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:194
2016-10-30 09:46:26 +00:00
msgid ""
"Create a new :class:`ArgumentParser` object. All parameters should be passed "
"as keyword arguments. Each parameter has its own more detailed description "
"below, but in short they are:"
msgstr ""
"Crée un nouvel objet :class:`ArgumentParser`. Tous les paramètres doivent "
"être passés en arguments nommés. Chaque paramètre a sa propre description "
"détaillée ci-dessous, mais en résumé ils sont :"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:198
2022-03-23 17:40:12 +00:00
msgid ""
"prog_ - The name of the program (default: ``os.path.basename(sys.argv[0])``)"
msgstr ""
"prog_ Nom du programme (par défaut : ``os.path.basename(sys.argv[0])``) ;"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:201
2016-10-30 09:46:26 +00:00
msgid ""
"usage_ - The string describing the program usage (default: generated from "
"arguments added to parser)"
msgstr ""
"usage_ Chaîne décrivant l'utilisation du programme (par défaut : générée à "
"partir des arguments ajoutés à l'analyseur) ;"
2016-10-30 09:46:26 +00:00
2022-05-22 21:15:02 +00:00
#: library/argparse.rst:204
msgid ""
"description_ - Text to display before the argument help (by default, no text)"
2016-10-30 09:46:26 +00:00
msgstr ""
"description_ Texte à afficher au dessus de l'aide pour les arguments (vide "
"par défaut) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:207
msgid "epilog_ - Text to display after the argument help (by default, no text)"
2016-10-30 09:46:26 +00:00
msgstr ""
"epilog_ Texte à afficher après l'aide des arguments (vide par défaut) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:209
2016-10-30 09:46:26 +00:00
msgid ""
"parents_ - A list of :class:`ArgumentParser` objects whose arguments should "
"also be included"
msgstr ""
"parents_ Liste d'objets :class:`ArgumentParser` contenant des arguments "
"qui devraient aussi être inclus ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:212
2016-10-30 09:46:26 +00:00
msgid "formatter_class_ - A class for customizing the help output"
msgstr ""
"formatter_class_ Classe pour personnaliser la sortie du message d'aide ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:214
2016-10-30 09:46:26 +00:00
msgid ""
"prefix_chars_ - The set of characters that prefix optional arguments "
"(default: '-')"
msgstr ""
"prefix_chars_ Jeu de caractères qui précède les arguments optionnels (par "
"défaut : ``'-'``) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:217
2016-10-30 09:46:26 +00:00
msgid ""
"fromfile_prefix_chars_ - The set of characters that prefix files from which "
"additional arguments should be read (default: ``None``)"
msgstr ""
"fromfile_prefix_chars_ Jeu de caractères qui précède les fichiers d'où des "
"arguments additionnels doivent être lus (par défaut : ``None``) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:220
2016-10-30 09:46:26 +00:00
msgid ""
"argument_default_ - The global default value for arguments (default: "
"``None``)"
msgstr ""
"argument_default_ Valeur globale par défaut pour les arguments (par "
"défaut : ``None``) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:223
2016-10-30 09:46:26 +00:00
msgid ""
"conflict_handler_ - The strategy for resolving conflicting optionals "
"(usually unnecessary)"
msgstr ""
"conflict_handler_ Stratégie pour résoudre les conflits entre les arguments "
"optionnels (non-nécessaire en général) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:226
2017-04-02 20:14:06 +00:00
msgid ""
"add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)"
2016-10-30 09:46:26 +00:00
msgstr ""
"add_help_ Ajoute une option d'aide ``-h/--help`` à l'analyseur (par "
"défaut : ``True``) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:228
2016-10-30 09:46:26 +00:00
msgid ""
"allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is "
"unambiguous. (default: ``True``)"
msgstr ""
"allow_abbrev_ Permet l'acceptation d'abréviations non-ambigües pour les "
"options longues (par défaut : ``True``) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:231
2020-07-20 08:56:42 +00:00
msgid ""
"exit_on_error_ - Determines whether or not ArgumentParser exits with error "
"info when an error occurs. (default: ``True``)"
msgstr ""
"exit_on_error_ Détermine si l'objet ``ArgumentParser`` termine l'exécution "
"avec un message d'erreur quand une erreur est rencontrée (par défaut : "
"``True``)."
2020-07-20 08:56:42 +00:00
#: library/argparse.rst:234
2016-10-30 09:46:26 +00:00
msgid "*allow_abbrev* parameter was added."
msgstr "Le paramètre *allow_abbrev* est ajouté."
#: library/argparse.rst:237
2019-09-04 09:35:23 +00:00
msgid ""
"In previous versions, *allow_abbrev* also disabled grouping of short flags "
"such as ``-vv`` to mean ``-v -v``."
msgstr ""
"Dans les versions précédentes, *allow_abbrev* désactivait aussi le "
"regroupement de plusieurs options courtes telles que ``-vv`` pour signifier "
"``-v -v``."
2019-09-04 09:35:23 +00:00
#: library/argparse.rst:241
2020-07-20 08:56:42 +00:00
msgid "*exit_on_error* parameter was added."
msgstr "Le paramètre *exit_on_error* est ajouté."
2020-07-20 08:56:42 +00:00
#: library/argparse.rst:770
2016-10-30 09:46:26 +00:00
msgid "The following sections describe how each of these are used."
msgstr ""
"Les sections suivantes décrivent comment chacune de ces options sont "
"utilisées."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:250
2016-10-30 09:46:26 +00:00
msgid "prog"
msgstr "Le paramètre *prog*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:252
2016-10-30 09:46:26 +00:00
msgid ""
"By default, :class:`ArgumentParser` objects use ``sys.argv[0]`` to determine "
"how to display the name of the program in help messages. This default is "
"almost always desirable because it will make the help messages match how the "
"program was invoked on the command line. For example, consider a file named "
"``myprogram.py`` with the following code::"
msgstr ""
"Par défaut, l'objet :class:`ArgumentParser` utilise ``sys.argv[0]`` pour "
"déterminer comment afficher le nom du programme dans les messages d'aide. "
"Cette valeur par défaut est presque toujours souhaitable, car elle produit "
"un message d'aide qui correspond à la méthode utilisée pour lancer le "
"programme sur la ligne de commande. Par exemple, si on a un fichier nommé "
"``myprogram.py`` avec le code suivant ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:263
2016-10-30 09:46:26 +00:00
msgid ""
"The help for this program will display ``myprogram.py`` as the program name "
"(regardless of where the program was invoked from):"
msgstr ""
"Le message d'aide pour ce programme affiche ``myprogram.py`` pour le nom du "
"programme (peu importe d'où le programme est lancé) :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:282
2016-10-30 09:46:26 +00:00
msgid ""
"To change this default behavior, another value can be supplied using the "
"``prog=`` argument to :class:`ArgumentParser`::"
msgstr ""
"Pour changer ce comportement, une valeur alternative est passée par "
"l'argument ``prog=`` du constructeur d':class:`ArgumentParser` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:292
2016-10-30 09:46:26 +00:00
msgid ""
"Note that the program name, whether determined from ``sys.argv[0]`` or from "
"the ``prog=`` argument, is available to help messages using the ``%(prog)s`` "
"format specifier."
msgstr ""
"Prenez note que le nom du programme, peu importe s'il provient de ``sys."
"argv[0]`` ou de l'argument ``prog=``, est accessible aux messages d'aide "
"grâce au spécificateur de formatage ``%(prog)s``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:309
2016-10-30 09:46:26 +00:00
msgid "usage"
msgstr "Le paramètre *usage*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:311
2016-10-30 09:46:26 +00:00
msgid ""
"By default, :class:`ArgumentParser` calculates the usage message from the "
"arguments it contains::"
msgstr ""
"Par défaut, l'objet :class:`ArgumentParser` construit le message relatif à "
"l'utilisation à partir des arguments qu'il contient ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:327
2016-10-30 09:46:26 +00:00
msgid ""
"The default message can be overridden with the ``usage=`` keyword argument::"
msgstr ""
"Le message par défaut peut être remplacé en utilisant l'argument nommé "
"``usage=`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:342
2016-10-30 09:46:26 +00:00
msgid ""
"The ``%(prog)s`` format specifier is available to fill in the program name "
"in your usage messages."
msgstr ""
"Le spécificateur de formatage ``%(prog)s`` est disponible pour insérer le "
"nom du programme dans vos messages d'utilisation."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:349
2016-10-30 09:46:26 +00:00
msgid "description"
msgstr "Le paramètre *description*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:351
2016-10-30 09:46:26 +00:00
msgid ""
"Most calls to the :class:`ArgumentParser` constructor will use the "
"``description=`` keyword argument. This argument gives a brief description "
"of what the program does and how it works. In help messages, the "
"description is displayed between the command-line usage string and the help "
"messages for the various arguments::"
msgstr ""
"La plupart des appels au constructeur d':class:`ArgumentParser` utilisent "
"l'argument nommé ``description=``. Cet argument donne une brève description "
"de ce que fait le programme et de comment il fonctionne. Dans les messages "
"d'aide, cette description est affichée entre le prototype de ligne de "
"commande et les messages d'aide des arguments ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:366
2016-10-30 09:46:26 +00:00
msgid ""
"By default, the description will be line-wrapped so that it fits within the "
"given space. To change this behavior, see the formatter_class_ argument."
msgstr ""
"Par défaut, la description est sujette au retour à la ligne automatique pour "
"se conformer à l'espace disponible. Pour changer ce comportement, voyez "
"l'argument formatter_class_."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:371
2016-10-30 09:46:26 +00:00
msgid "epilog"
msgstr "Le paramètre *epilog*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:373
2016-10-30 09:46:26 +00:00
msgid ""
"Some programs like to display additional description of the program after "
"the description of the arguments. Such text can be specified using the "
"``epilog=`` argument to :class:`ArgumentParser`::"
msgstr ""
"Certains programmes aiment afficher un texte supplémentaire après la "
"description des arguments. Un tel texte peut être spécifié grâce à "
"l'argument ``epilog=`` du constructeur d':class:`ArgumentParser` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:390
2016-10-30 09:46:26 +00:00
msgid ""
"As with the description_ argument, the ``epilog=`` text is by default line-"
"wrapped, but this behavior can be adjusted with the formatter_class_ "
"argument to :class:`ArgumentParser`."
msgstr ""
"De même que pour l'argument description_, le texte passé à ``epilog=`` est "
"sujet au retour à la ligne automatique. Ce comportement peut être ajusté "
"grâce à l'argument formatter_class_ du constructeur d':class:"
"`ArgumentParser`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:396
2016-10-30 09:46:26 +00:00
msgid "parents"
msgstr "Le paramètre *parents*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:398
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes, several parsers share a common set of arguments. Rather than "
"repeating the definitions of these arguments, a single parser with all the "
"shared arguments and passed to ``parents=`` argument to :class:"
"`ArgumentParser` can be used. The ``parents=`` argument takes a list of :"
"class:`ArgumentParser` objects, collects all the positional and optional "
"actions from them, and adds these actions to the :class:`ArgumentParser` "
"object being constructed::"
msgstr ""
"Parfois, plusieurs analyseurs partagent un jeu commun d'arguments. Plutôt "
"que de répéter les définitions de ces arguments, un analyseur commun qui "
"contient tous les arguments partagés peut être utilisé, puis passé à "
"l'argument ``parents=`` du constructeur d':class:`ArgumentParser`. "
"L'argument ``parents=`` accepte une liste d'objets :class:`ArgumentParser`, "
"accumule toutes les actions positionnelles et optionnelles de ces objets, "
"puis les ajoute à l'instance d':class:`ArgumentParser` en cours de "
"création ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:418
2016-10-30 09:46:26 +00:00
msgid ""
"Note that most parent parsers will specify ``add_help=False``. Otherwise, "
"the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the "
"parent and one in the child) and raise an error."
msgstr ""
"Prenez note que la majorité des analyseurs parents doivent définir "
"``add_help=False``. Autrement, le constructeur d':class:`ArgumentParser` va "
"voir plus d'une option ``-h/--help`` (une pour le parent et une pour "
"l'instance en cours de création) et va lever une erreur."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:423
2016-10-30 09:46:26 +00:00
msgid ""
"You must fully initialize the parsers before passing them via ``parents=``. "
"If you change the parent parsers after the child parser, those changes will "
"not be reflected in the child."
msgstr ""
"Vous devez initialiser complètement les analyseurs avant de les passer à "
"``parents=``. Si vous changez les analyseurs parents après la création de "
"l'analyseur enfant, ces changements ne sont pas répercutés sur l'enfant."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:431
2016-10-30 09:46:26 +00:00
msgid "formatter_class"
msgstr "Le paramètre *formatter_class*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:433
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentParser` objects allow the help formatting to be customized "
"by specifying an alternate formatting class. Currently, there are four such "
"classes:"
msgstr ""
"Les objets :class:`ArgumentParser` permettent la personnalisation de la mise "
"en page des messages d'aide en spécifiant une classe de formatage "
"alternative. Il y a actuellement quatre classes de formatage :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:442
2016-10-30 09:46:26 +00:00
msgid ""
":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give "
"more control over how textual descriptions are displayed. By default, :class:"
"`ArgumentParser` objects line-wrap the description_ and epilog_ texts in "
"command-line help messages::"
msgstr ""
":class:`RawDescriptionHelpFormatter` et :class:`RawTextHelpFormatter` vous "
"donnent plus de contrôle sur comment les descriptions textuelles sont "
"affichées. Par défaut, les contenus de description_ et epilog_ des objets :"
"class:`ArgumentParser` font l'objet du retour à la ligne automatique dans "
"les messages d'aide ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:467
2016-10-30 09:46:26 +00:00
msgid ""
"Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` "
"indicates that description_ and epilog_ are already correctly formatted and "
"should not be line-wrapped::"
msgstr ""
"Passer :class:`RawDescriptionHelpFormatter` à ``formatter_class=`` indique "
"que les textes de description_ et d'epilog_ ont déjà été formatés "
"correctement et qu'ils ne doivent pas faire l'objet d'un retour à la ligne "
"automatique ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:493
2016-10-30 09:46:26 +00:00
msgid ""
":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help "
2017-09-12 11:40:22 +00:00
"text, including argument descriptions. However, multiple new lines are "
"replaced with one. If you wish to preserve multiple blank lines, add spaces "
"between the newlines."
2016-10-30 09:46:26 +00:00
msgstr ""
":class:`RawTextHelpFormatter` conserve les espaces pour toutes les "
"catégories de textes d'aide, y compris les descriptions des arguments. Notez "
"bien que plusieurs retours à la ligne consécutifs sont remplacés par un "
"seul. Si vous voulez garder plusieurs sauts de ligne, ajoutez des espaces "
"entre les caractères de changement de ligne."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:498
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentDefaultsHelpFormatter` automatically adds information about "
"default values to each of the argument help messages::"
msgstr ""
":class:`ArgumentDefaultsHelpFormatter` ajoute automatiquement l'information "
"sur les valeurs par défaut aux messages d'aide de tous les arguments ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:516
2016-10-30 09:46:26 +00:00
msgid ""
":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for "
"each argument as the display name for its values (rather than using the "
"dest_ as the regular formatter does)::"
msgstr ""
":class:`MetavarTypeHelpFormatter` utilise le nom du type_ de l'argument pour "
"chacun des arguments comme nom d'affichage pour leurs valeurs (contrairement "
"au formateur standard qui utilise dest_) ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:537
2016-10-30 09:46:26 +00:00
msgid "prefix_chars"
msgstr "Le paramètre *prefix_chars*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:539
2016-10-30 09:46:26 +00:00
msgid ""
"Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. "
"Parsers that need to support different or additional prefix characters, e.g. "
"for options like ``+f`` or ``/foo``, may specify them using the "
"``prefix_chars=`` argument to the ArgumentParser constructor::"
msgstr ""
"La majorité des options sur la ligne de commande utilisent ``-`` comme "
"préfixe (par exemple : ``-f/--foo``). Pour les analyseurs qui doivent "
"accepter des caractères préfixes autres ou additionnels (par exemple pour "
"les options ``+f`` ou ``/foo``), vous devez les préciser en utilisant "
"l'argument ``prefix_chars=`` du constructeur d'``ArgumentParser`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:551
2016-10-30 09:46:26 +00:00
msgid ""
"The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of "
"characters that does not include ``-`` will cause ``-f/--foo`` options to be "
"disallowed."
msgstr ""
"La valeur par défaut de ``prefix_chars=`` est ``'-'``. Passer un jeu de "
"caractères qui n'inclut pas ``-`` provoquera le refus des options comme ``-"
"f/--foo``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:557
2016-10-30 09:46:26 +00:00
msgid "fromfile_prefix_chars"
msgstr "Le paramètre *fromfile_prefix_chars*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:559
2016-10-30 09:46:26 +00:00
msgid ""
2022-05-22 21:15:02 +00:00
"Sometimes, when dealing with a particularly long argument list, it may make "
"sense to keep the list of arguments in a file rather than typing it out at "
"the command line. If the ``fromfile_prefix_chars=`` argument is given to "
"the :class:`ArgumentParser` constructor, then arguments that start with any "
"of the specified characters will be treated as files, and will be replaced "
"by the arguments they contain. For example::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Parfois, par exemple quand on traite une liste d'arguments particulièrement "
"longue, il est logique de stocker la liste d'arguments dans un fichier "
"plutôt que de la saisir sur la ligne de commande. Si un jeu de caractères "
"est passé à l'argument ``fromfile_prefix_chars=`` du constructeur de :class:"
"`ArgumentParser`, alors les arguments qui commencent par l'un des caractères "
"spécifiés sont traités comme des fichiers et sont remplacés par les "
"arguments contenus dans ces fichiers. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:573
2016-10-30 09:46:26 +00:00
msgid ""
"Arguments read from a file must by default be one per line (but see also :"
"meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they "
"were in the same place as the original file referencing argument on the "
"command line. So in the example above, the expression ``['-f', 'foo', "
"'@args.txt']`` is considered equivalent to the expression ``['-f', 'foo', '-"
"f', 'bar']``."
msgstr ""
"Par défaut, les arguments lus à partir d'un fichier doivent être chacun sur "
"une nouvelle ligne (voir aussi :meth:`~ArgumentParser."
"convert_arg_line_to_args`) et ils sont traités comme s'ils étaient au même "
"emplacement que le fichier original référençant les arguments de la ligne de "
"commande. Ainsi dans l'exemple ci-dessus, l'expression ``['-f', 'foo', "
"'@args.txt']`` est équivalente à l'expression ``['-f', 'foo', '-f', 'bar']``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:579
2016-10-30 09:46:26 +00:00
msgid ""
"The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that "
"arguments will never be treated as file references."
msgstr ""
"Par défaut, l'argument ``fromfile_prefix_chars=`` est ``None``, ce qui "
"signifie que les arguments ne sont pas traités en tant que références à des "
"fichiers."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:584
2016-10-30 09:46:26 +00:00
msgid "argument_default"
msgstr "Le paramètre *argument_default*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:586
2016-10-30 09:46:26 +00:00
msgid ""
"Generally, argument defaults are specified either by passing a default to :"
"meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser."
"set_defaults` methods with a specific set of name-value pairs. Sometimes "
"however, it may be useful to specify a single parser-wide default for "
"arguments. This can be accomplished by passing the ``argument_default=`` "
"keyword argument to :class:`ArgumentParser`. For example, to globally "
"suppress attribute creation on :meth:`~ArgumentParser.parse_args` calls, we "
"supply ``argument_default=SUPPRESS``::"
msgstr ""
"Généralement, les valeurs par défaut des arguments sont définies soit en "
"passant la valeur désirée à :meth:`~ArgumentParser.add_argument` soit par un "
"appel à la méthode :meth:`~ArgumentParser.set_defaults`. Cette méthode "
"accepte un ensemble de paires nom-valeur. Il est parfois pertinent de "
"configurer une valeur par défaut pour tous les arguments d'un analyseur. On "
"peut activer ce comportement en passant la valeur désirée à l'argument nommé "
"``argument_default=`` du constructeur de :class:`ArgumentParser`. Par "
"exemple, pour supprimer globalement la création d'attributs pendant l'appel "
"de :meth:`~ArgumentParser.parse_args`, on fournit "
"``argument_default=SUPPRESS`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:606
2016-10-30 09:46:26 +00:00
msgid "allow_abbrev"
msgstr "Le paramètre *allow_abbrev*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:608
2016-10-30 09:46:26 +00:00
msgid ""
"Normally, when you pass an argument list to the :meth:`~ArgumentParser."
"parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes "
"abbreviations <prefix-matching>` of long options."
msgstr ""
"En temps normal, lorsque vous passez une liste d'arguments à la méthode :"
"meth:`~ArgumentParser.parse_args` d':class:`ArgumentParser` :ref:`elle "
"accepte les abréviations <prefix-matching>` des options longues."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:612
2016-10-30 09:46:26 +00:00
msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::"
msgstr ""
"Cette fonctionnalité peut être désactivée en passant ``False`` à "
"``allow_abbrev`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:625
2016-10-30 09:46:26 +00:00
msgid "conflict_handler"
msgstr "Le paramètre *conflict_handler*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:627
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentParser` objects do not allow two actions with the same "
"option string. By default, :class:`ArgumentParser` objects raise an "
"exception if an attempt is made to create an argument with an option string "
"that is already in use::"
msgstr ""
"Les objets :class:`ArgumentParser` ne peuvent pas avoir plus d'une option "
"avec la même chaîne d'option. Par défaut, les objets :class:`ArgumentParser` "
"lèvent une exception si on essaie de créer un argument avec une chaîne "
"d'option qui est déjà utilisée ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:639
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes (e.g. when using parents_) it may be useful to simply override any "
"older arguments with the same option string. To get this behavior, the "
"value ``'resolve'`` can be supplied to the ``conflict_handler=`` argument "
"of :class:`ArgumentParser`::"
msgstr ""
"Parfois, par exemple si on utilise des analyseurs parents_, il est "
"souhaitable de surcharger les anciens arguments qui partagent la même chaîne "
"d'option. Pour obtenir ce comportement, vous devez passer ``'resolve'`` à "
"l'argument ``conflict_handler=`` du constructeur d':class:`ArgumentParser` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:655
2016-10-30 09:46:26 +00:00
msgid ""
"Note that :class:`ArgumentParser` objects only remove an action if all of "
"its option strings are overridden. So, in the example above, the old ``-f/--"
"foo`` action is retained as the ``-f`` action, because only the ``--foo`` "
"option string was overridden."
msgstr ""
"Prenez note que les objets :class:`ArgumentParser` n'enlèvent une action que "
"si toutes ses chaînes d'options sont surchargées. Ainsi dans l'exemple ci-"
"dessus, l'action ``-f/--foo`` du parent est conservée comme l'action ``-f`` "
"puisque ``--foo`` est la seule chaîne d'options qui a été surchargée."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:662
2016-10-30 09:46:26 +00:00
msgid "add_help"
msgstr "Le paramètre *add_help*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:664
2016-10-30 09:46:26 +00:00
msgid ""
"By default, ArgumentParser objects add an option which simply displays the "
"parser's help message. For example, consider a file named ``myprogram.py`` "
"containing the following code::"
msgstr ""
"Par défaut, les objets ``ArgumentParser`` ajoutent une option qui offre "
"l'affichage du message d'aide de l'analyseur. Par exemple, prenons le "
"fichier ``myprogram.py`` qui contient le code suivant ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:673
2016-10-30 09:46:26 +00:00
msgid ""
"If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser "
"help will be printed:"
msgstr ""
"Si ``-h`` ou ``--help`` est passé sur la ligne de commande, le message "
"d'aide de l'``ArgumentParser`` est affiché :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:685
2016-10-30 09:46:26 +00:00
msgid ""
"Occasionally, it may be useful to disable the addition of this help option. "
"This can be achieved by passing ``False`` as the ``add_help=`` argument to :"
"class:`ArgumentParser`::"
msgstr ""
"Il est parfois utile de désactiver l'ajout de cette option d'aide. Pour ce "
"faire, vous devez passer ``False`` à l'argument ``add_help=`` du "
"constructeur d':class:`ArgumentParser` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:697
2016-10-30 09:46:26 +00:00
msgid ""
"The help option is typically ``-h/--help``. The exception to this is if the "
"``prefix_chars=`` is specified and does not include ``-``, in which case ``-"
"h`` and ``--help`` are not valid options. In this case, the first character "
"in ``prefix_chars`` is used to prefix the help options::"
msgstr ""
"En général, l'option d'aide est ``-h/--help``. L'exception à cette règle est "
"quand une valeur est passée à ``prefix_chars=`` et qu'elle n'inclue pas ``-"
"``, auquel cas, ``-h`` et ``--help`` ne sont pas des options valides. Dans "
"ce cas, le premier caractère de ``prefix_chars`` est utilisé comme préfixe "
"des options d'aide ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:712
2020-07-20 08:56:42 +00:00
msgid "exit_on_error"
msgstr "Le paramètre *exit_on_error*"
2020-07-20 08:56:42 +00:00
#: library/argparse.rst:714
2020-07-20 08:56:42 +00:00
msgid ""
"Normally, when you pass an invalid argument list to the :meth:"
"`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will "
"exit with error info."
msgstr ""
"En général, quand vous passez une liste d'arguments dont au moins un est "
"invalide à la méthode :meth:`~ArgumentParser.parse_args` d'une instance d':"
"class:`ArgumentParser`, l'exécution se termine avec un message d'erreur."
2020-07-20 08:56:42 +00:00
#: library/argparse.rst:717
2020-07-20 08:56:42 +00:00
msgid ""
"If the user would like to catch errors manually, the feature can be enabled "
"by setting ``exit_on_error`` to ``False``::"
2020-07-20 08:56:42 +00:00
msgstr ""
"Si vous souhaitez intercepter les erreurs manuellement, la fonctionnalité "
"peut être activée en assignant ``False`` à ``exit_on_error`` ::"
2020-07-20 08:56:42 +00:00
#: library/argparse.rst:734
2016-10-30 09:46:26 +00:00
msgid "The add_argument() method"
msgstr "La méthode *add_argument()*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:740
2016-10-30 09:46:26 +00:00
msgid ""
"Define how a single command-line argument should be parsed. Each parameter "
"has its own more detailed description below, but in short they are:"
msgstr ""
"Définie comment une option de ligne de commande doit être analysée. Chacun "
"des paramètres est décrit plus en détails ci-bas, mais en résumé ils sont :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:743
2016-10-30 09:46:26 +00:00
msgid ""
"`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` "
"or ``-f, --foo``."
msgstr ""
"`name_or_flags`_ Nom ou liste de chaînes d'options. Par exemple : ``foo`` "
"ou ``-f, --foo`` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:746
2016-10-30 09:46:26 +00:00
msgid ""
"action_ - The basic type of action to be taken when this argument is "
"encountered at the command line."
msgstr ""
"action_ Type élémentaire de l'action à entreprendre quand cet argument est "
"reconnu sur la ligne de commande ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:749
2016-10-30 09:46:26 +00:00
msgid "nargs_ - The number of command-line arguments that should be consumed."
msgstr "nargs_ Nombre d'arguments de la ligne de commande à capturer ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:751
2016-10-30 09:46:26 +00:00
msgid ""
"const_ - A constant value required by some action_ and nargs_ selections."
msgstr ""
"const_ Valeur constante requise par certains choix d'action_ et de nargs_ ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:753
2016-10-30 09:46:26 +00:00
msgid ""
"default_ - The value produced if the argument is absent from the command "
2020-12-18 06:09:57 +00:00
"line and if it is absent from the namespace object."
2016-10-30 09:46:26 +00:00
msgstr ""
"default_ Valeur produite si l'argument est absent de la ligne de commande "
"et absent de l'objet ``namespace`` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:756
2016-10-30 09:46:26 +00:00
msgid ""
"type_ - The type to which the command-line argument should be converted."
msgstr ""
"type_ Type vers lequel l'argument sur la ligne de commande doit être "
"converti ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:758
msgid "choices_ - A sequence of the allowable values for the argument."
msgstr "choices_ La séquence de valeurs autorisées pour cet argument ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:760
2016-10-30 09:46:26 +00:00
msgid ""
"required_ - Whether or not the command-line option may be omitted (optionals "
"only)."
msgstr ""
"required_ ``True`` si l'option sur la ligne de commande est obligatoire "
"(ne s'applique qu'aux arguments optionnels) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:763
2016-10-30 09:46:26 +00:00
msgid "help_ - A brief description of what the argument does."
msgstr "help_ Brève description de ce que fait l'argument ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:765
2016-10-30 09:46:26 +00:00
msgid "metavar_ - A name for the argument in usage messages."
msgstr "metavar_ Nom de l'argument dans les messages d'utilisations ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:767
2016-10-30 09:46:26 +00:00
msgid ""
"dest_ - The name of the attribute to be added to the object returned by :"
"meth:`parse_args`."
msgstr ""
"dest_ Nom de l'attribut qui est ajouté à l'objet retourné par :meth:"
"`parse_args`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:776
2016-10-30 09:46:26 +00:00
msgid "name or flags"
msgstr "Le paramètre *name_or_flags*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:778
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.add_argument` method must know whether an "
"optional argument, like ``-f`` or ``--foo``, or a positional argument, like "
"a list of filenames, is expected. The first arguments passed to :meth:"
"`~ArgumentParser.add_argument` must therefore be either a series of flags, "
2022-03-23 17:40:12 +00:00
"or a simple argument name."
2016-10-30 09:46:26 +00:00
msgstr ""
"La méthode :meth:`~ArgumentParser.add_argument` doit savoir s'il s'agit d'un "
"argument optionnel (tel que ``-f`` ou ``--foo``) ou d'un argument "
"positionnel (tel qu'une liste de noms de fichiers) qui est attendu. Le "
"premier argument passé à :meth:`~ArgumentParser.add_argument` doit donc être "
"soit une série de drapeaux, soit le nom de l'argument."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:784
2022-03-23 17:40:12 +00:00
msgid "For example, an optional argument could be created like::"
msgstr "Par exemple, un argument optionnel est créé comme suit ::"
2022-03-23 17:40:12 +00:00
#: library/argparse.rst:788
2016-10-30 09:46:26 +00:00
msgid "while a positional argument could be created like::"
msgstr "alors qu'un argument positionnel est créé comme suit ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:792
2016-10-30 09:46:26 +00:00
msgid ""
"When :meth:`~ArgumentParser.parse_args` is called, optional arguments will "
"be identified by the ``-`` prefix, and the remaining arguments will be "
"assumed to be positional::"
msgstr ""
"Lors le l'appel de :meth:`~ArgumentParser.parse_args`, les arguments qui "
"commencent par le préfixe ``-`` sont présumés optionnels et tous les autres "
"sont présumés positionnels ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:811
2016-10-30 09:46:26 +00:00
msgid "action"
msgstr "Le paramètre *action*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:813
2016-10-30 09:46:26 +00:00
msgid ""
":class:`ArgumentParser` objects associate command-line arguments with "
"actions. These actions can do just about anything with the command-line "
"arguments associated with them, though most actions simply add an attribute "
"to the object returned by :meth:`~ArgumentParser.parse_args`. The "
"``action`` keyword argument specifies how the command-line arguments should "
"be handled. The supplied actions are:"
msgstr ""
"Les objets :class:`ArgumentParser` associent les arguments de la ligne de "
"commande avec des actions. Ces actions peuvent soumettre les arguments de la "
"ligne de commande auxquels elles sont associées à un traitement arbitraire, "
"mais la majorité des actions se contentent d'ajouter un attribut à l'objet "
"renvoyé par :meth:`~ArgumentParser.parse_args`. L'argument nommé ``action`` "
"indique comment l'argument de la ligne de commande est traité. Les actions "
"natives sont :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:819
2016-10-30 09:46:26 +00:00
msgid ""
"``'store'`` - This just stores the argument's value. This is the default "
"action. For example::"
msgstr ""
"``'store'`` Stocke la valeur de l'argument sans autre traitement. Ceci est "
"l'action par défaut. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:827
2016-10-30 09:46:26 +00:00
msgid ""
"``'store_const'`` - This stores the value specified by the const_ keyword "
2022-03-23 17:40:12 +00:00
"argument; note that the const_ keyword argument defaults to ``None``. The "
"``'store_const'`` action is most commonly used with optional arguments that "
"specify some sort of flag. For example::"
2016-10-30 09:46:26 +00:00
msgstr ""
"``'store_const'`` Stocke la valeur passée à l'argument nommé const_. La "
"valeur par défaut de const_ est ``None``. L'action ``'store_const'`` est "
"généralement utilisée avec des arguments optionnels représentant un drapeau "
"ou une condition similaire. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:837
2016-10-30 09:46:26 +00:00
msgid ""
"``'store_true'`` and ``'store_false'`` - These are special cases of "
"``'store_const'`` used for storing the values ``True`` and ``False`` "
"respectively. In addition, they create default values of ``False`` and "
"``True`` respectively. For example::"
msgstr ""
"``'store_true'`` et ``'store_false'`` Ces actions sont des cas "
"particuliers de ``'store_const'`` pour lesquelles la valeur stockée est "
"``True`` et ``False``, respectivement. Aussi, ces actions ont comme valeur "
"par défaut ``False`` et ``True``, respectivement. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:849
2016-10-30 09:46:26 +00:00
msgid ""
"``'append'`` - This stores a list, and appends each argument value to the "
2022-05-22 21:15:02 +00:00
"list. It is useful to allow an option to be specified multiple times. If the "
"default value is non-empty, the default elements will be present in the "
"parsed value for the option, with any values from the command line appended "
"after those default values. Example usage::"
2016-10-30 09:46:26 +00:00
msgstr ""
"``'append'`` Stocke une liste et ajoute la valeur de son argument à cette "
"liste. Il est donc généralement utile d'accepter la répétition de cet "
"argument. Si une valeur par défaut est précisée, alors cette valeur est "
"également présente dans la liste et précède les valeurs passées sur la ligne "
"de commande ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:860
2016-10-30 09:46:26 +00:00
msgid ""
"``'append_const'`` - This stores a list, and appends the value specified by "
2022-03-23 17:40:12 +00:00
"the const_ keyword argument to the list; note that the const_ keyword "
"argument defaults to ``None``. The ``'append_const'`` action is typically "
2016-10-30 09:46:26 +00:00
"useful when multiple arguments need to store constants to the same list. For "
"example::"
msgstr ""
"``'append_const'`` Stocke une liste et ajoute la valeur de son argument "
"const_ à cette liste. Notez que la valeur par défaut de l'argument const_ "
"est ``None``. L'action ``'append_const'`` est pratique quand plusieurs "
"arguments ont besoin de stocker des constantes dans une seule liste. Par "
"exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:872
2016-10-30 09:46:26 +00:00
msgid ""
"``'count'`` - This counts the number of times a keyword argument occurs. For "
"example, this is useful for increasing verbosity levels::"
msgstr ""
"``'count'`` Compte le nombre d'occurrences de l'argument nommé. Ceci est "
"pratique, par exemple, pour augmenter le niveau de verbosité ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:880
2019-12-05 22:41:32 +00:00
msgid "Note, the *default* will be ``None`` unless explicitly set to *0*."
msgstr ""
"Prenez note que la valeur de *default* est ``None`` à moins qu'elle soit "
"explicitement définie à ``0``."
2019-12-05 22:41:32 +00:00
#: library/argparse.rst:882
2016-10-30 09:46:26 +00:00
msgid ""
"``'help'`` - This prints a complete help message for all the options in the "
"current parser and then exits. By default a help action is automatically "
"added to the parser. See :class:`ArgumentParser` for details of how the "
"output is created."
msgstr ""
"``'help'`` Affiche le message d'aide complet pour toutes les options de "
"l'analyseur puis termine l'exécution. Une action ``help`` est "
"automatiquement ajoutée à l'analyseur par défaut. Consultez :class:"
"`ArgumentParser` pour les détails de la création du contenu de l'aide."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:887
2016-10-30 09:46:26 +00:00
msgid ""
"``'version'`` - This expects a ``version=`` keyword argument in the :meth:"
"`~ArgumentParser.add_argument` call, and prints version information and "
"exits when invoked::"
msgstr ""
"``'version'`` Affiche la version du programme puis termine l'exécution. "
"Cette action requiert l'argument nommé ``version=`` dans l'appel à :meth:"
"`~ArgumentParser.add_argument` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:897
2019-09-04 09:35:23 +00:00
msgid ""
"``'extend'`` - This stores a list, and extends each argument value to the "
"list. Example usage::"
msgstr ""
"``'extend'`` Stocke une liste et ajoute à la liste chacune des valeurs de "
"l'argument reçues. Voici un exemple de son utilisation ::"
2019-09-04 09:35:23 +00:00
#: library/argparse.rst:908
2016-10-30 09:46:26 +00:00
msgid ""
"You may also specify an arbitrary action by passing an Action subclass or "
2020-07-20 08:56:42 +00:00
"other object that implements the same interface. The "
"``BooleanOptionalAction`` is available in ``argparse`` and adds support for "
"boolean actions such as ``--foo`` and ``--no-foo``::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Vous pouvez aussi spécifier une action arbitraire en passant une sous-classe "
"d'``Action`` ou un objet qui implémente la même interface. La classe "
"``BooleanOptionalAction`` est disponible dans ``argparse`` et elle ajoute la "
"gestion des options booléennes telles que ``--foo`` et ``--no-foo`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:921
2020-07-20 08:56:42 +00:00
msgid ""
"The recommended way to create a custom action is to extend :class:`Action`, "
"overriding the ``__call__`` method and optionally the ``__init__`` and "
"``format_usage`` methods."
msgstr ""
"La façon recommandée pour créer une action personnalisée est d'hériter d':"
"class:`Action` en surchargeant la méthode ``__call__``. Vous avez également "
"l'option de surcharger les méthodes ``__init__`` et ``format_usage``."
2020-07-20 08:56:42 +00:00
#: library/argparse.rst:925
2016-10-30 09:46:26 +00:00
msgid "An example of a custom action::"
msgstr "Un exemple d'action personnalisée ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:945
2016-10-30 09:46:26 +00:00
msgid "For more details, see :class:`Action`."
msgstr "Pour plus d'information, voir :class:`Action`."
#: library/argparse.rst:951
2016-10-30 09:46:26 +00:00
msgid "nargs"
msgstr "Le paramètre *nargs*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:953
2016-10-30 09:46:26 +00:00
msgid ""
"ArgumentParser objects usually associate a single command-line argument with "
"a single action to be taken. The ``nargs`` keyword argument associates a "
"different number of command-line arguments with a single action. The "
"supported values are:"
msgstr ""
"En général, les objets ``ArgumentParser`` associent un seul argument de la "
"ligne de commande à une seule action à entreprendre. L'argument nommé "
"``nargs`` associe un nombre différent d'arguments de la ligne de commande à "
"une action. Les valeurs reconnues sont :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:958
2016-10-30 09:46:26 +00:00
msgid ""
"``N`` (an integer). ``N`` arguments from the command line will be gathered "
"together into a list. For example::"
msgstr ""
"``N`` (un entier). ``N`` arguments de la ligne de commande sont capturés "
"ensemble et stockés dans une liste. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:967
2016-10-30 09:46:26 +00:00
msgid ""
"Note that ``nargs=1`` produces a list of one item. This is different from "
"the default, in which the item is produced by itself."
msgstr ""
"Prenez note que ``nargs=1`` produit une liste avec un seul élément. Ceci est "
"différent du comportement par défaut qui produit l'élément directement "
"(comme un scalaire)."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:972
2016-10-30 09:46:26 +00:00
msgid ""
"``'?'``. One argument will be consumed from the command line if possible, "
"and produced as a single item. If no command-line argument is present, the "
"value from default_ will be produced. Note that for optional arguments, "
"there is an additional case - the option string is present but not followed "
"by a command-line argument. In this case the value from const_ will be "
"produced. Some examples to illustrate this::"
msgstr ""
"``'?'``. Un argument de la ligne de commande est capturé et produit "
"directement. Si aucun argument n'est présent sur la ligne de commande, la "
"valeur de default_ est produite. Prenez note que pour les arguments "
"optionnels, il est aussi possible que la chaîne d'option soit présente mais "
"qu'elle ne soit pas suivie d'un argument. Dans ce cas, la valeur de const_ "
"est produite. Voici quelques exemples pour illustrer ceci ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:989
2016-10-30 09:46:26 +00:00
msgid ""
"One of the more common uses of ``nargs='?'`` is to allow optional input and "
"output files::"
msgstr ""
"``nargs='?'`` est fréquemment utilisé pour accepter des fichiers d'entrée et "
"de sortie optionnels ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1006
2016-10-30 09:46:26 +00:00
msgid ""
"``'*'``. All command-line arguments present are gathered into a list. Note "
"that it generally doesn't make much sense to have more than one positional "
"argument with ``nargs='*'``, but multiple optional arguments with "
"``nargs='*'`` is possible. For example::"
msgstr ""
"``'*'``. Tous les arguments présents sur la ligne de commande sont capturés "
"dans une liste. Prenez note qu'il n'est pas logique d'avoir plus d'un "
"argument positionnel avec ``nargs='*'``, mais il est par contre possible "
"d'avoir plusieurs arguments optionnels qui spécifient ``nargs='*'``. Par "
"exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1020
2016-10-30 09:46:26 +00:00
msgid ""
"``'+'``. Just like ``'*'``, all command-line args present are gathered into "
"a list. Additionally, an error message will be generated if there wasn't at "
"least one command-line argument present. For example::"
msgstr ""
"``'+'``. Comme pour ``'*'``, tous les arguments présents sur la ligne de "
"commande sont capturés dans une liste. De plus, un message d'erreur est "
"produit s'il n'y a pas au moins un argument présent sur la ligne de "
"commande. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1032
2016-10-30 09:46:26 +00:00
msgid ""
"If the ``nargs`` keyword argument is not provided, the number of arguments "
"consumed is determined by the action_. Generally this means a single "
"command-line argument will be consumed and a single item (not a list) will "
"be produced."
msgstr ""
"Si l'argument nommé ``nargs`` n'est pas fourni, le nombre d'arguments "
"capturés est déterminé par l'action_. En général, c'est un seul argument de "
"la ligne de commande qui est capturé et il est produit directement."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1040
2016-10-30 09:46:26 +00:00
msgid "const"
msgstr "Le paramètre *const*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1042
2016-10-30 09:46:26 +00:00
msgid ""
"The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to "
"hold constant values that are not read from the command line but are "
"required for the various :class:`ArgumentParser` actions. The two most "
"common uses of it are:"
msgstr ""
"L'argument ``const`` d':meth:`~ArgumentParser.add_argument` est utilisé pour "
"stocker une constante qui n'est pas lue depuis la ligne de commande mais qui "
"est requise par certaines actions d':class:`ArgumentParser`. Les deux "
"utilisations les plus communes sont :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1046
2016-10-30 09:46:26 +00:00
msgid ""
"When :meth:`~ArgumentParser.add_argument` is called with "
"``action='store_const'`` or ``action='append_const'``. These actions add "
"the ``const`` value to one of the attributes of the object returned by :meth:"
2022-03-23 17:40:12 +00:00
"`~ArgumentParser.parse_args`. See the action_ description for examples. If "
"``const`` is not provided to :meth:`~ArgumentParser.add_argument`, it will "
"receive a default value of ``None``."
2016-10-30 09:46:26 +00:00
msgstr ""
"quand :meth:`~ArgumentParser.add_argument` est appelée avec "
"``action='store_const'`` ou ``action='append_const'``, ces actions ajoutent "
"la valeur de ``const`` à l'un des attributs de l'objet renvoyé par :meth:"
"`~ArgumentParser.parse_args`. Consultez la description d'action_ pour voir "
"quelques exemples. La valeur de ``const`` est ``None`` par défaut pour :meth:"
"`~ArgumentParser.add_argument` ;"
2016-10-30 09:46:26 +00:00
2021-05-19 16:06:14 +00:00
# Nous sommes dans une énumération après un :, donc pas de majuscule et le
# paragraphe doit se terminer par ;.
#: library/argparse.rst:1054
2016-10-30 09:46:26 +00:00
msgid ""
"When :meth:`~ArgumentParser.add_argument` is called with option strings "
"(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional "
"argument that can be followed by zero or one command-line arguments. When "
"parsing the command line, if the option string is encountered with no "
"command-line argument following it, the value of ``const`` will be assumed "
2022-03-23 17:40:12 +00:00
"to be ``None`` instead. See the nargs_ description for examples."
2016-10-30 09:46:26 +00:00
msgstr ""
"appeler la méthode :meth:`~ArgumentParser.add_argument` avec des chaînes "
"d'options (telles ``-f``, ``--foo`` ou avec ``nargs='?'``) crée un argument "
"optionnel auquel peut être attribué une valeur. Si celle-ci est omise, "
"l'analyseur prend ``None`` comme la valeur de ``const``. La description de "
"nargs_ offre quelques exemples."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1061
2016-10-30 09:46:26 +00:00
msgid ""
2022-03-23 17:40:12 +00:00
"``const=None`` by default, including when ``action='append_const'`` or "
"``action='store_const'``."
2016-10-30 09:46:26 +00:00
msgstr ""
"``const=None`` par défaut, y compris avec ``action='append_const'`` ou "
"``action='store_const'``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1068
2016-10-30 09:46:26 +00:00
msgid "default"
msgstr "Le paramètre *default*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1070
2016-10-30 09:46:26 +00:00
msgid ""
"All optional arguments and some positional arguments may be omitted at the "
"command line. The ``default`` keyword argument of :meth:`~ArgumentParser."
"add_argument`, whose value defaults to ``None``, specifies what value should "
"be used if the command-line argument is not present. For optional arguments, "
"the ``default`` value is used when the option string was not present at the "
"command line::"
msgstr ""
"Tous les arguments optionnels et certains arguments positionnels peuvent "
"être omis à la ligne de commande. L'argument nommé ``default`` de la "
"méthode :meth:`~ArgumentParser.add_argument` (qui vaut ``None`` par défaut), "
"indique quelle valeur est utilisée si l'argument est absent de la ligne de "
"commande. Pour les arguments optionnels, la valeur de ``default`` est "
"utilisée si la chaîne d'option n'est pas présente sur la ligne de commande ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1084
2016-10-30 09:46:26 +00:00
msgid ""
2020-12-18 06:09:57 +00:00
"If the target namespace already has an attribute set, the action *default* "
"will not over write it::"
msgstr ""
"Si l'objet ``namespace`` cible a déjà un attribut assigné, l'action "
"*default* ne l'écrase pas ::"
2020-12-18 06:09:57 +00:00
#: library/argparse.rst:1092
2020-12-18 06:09:57 +00:00
msgid ""
2016-10-30 09:46:26 +00:00
"If the ``default`` value is a string, the parser parses the value as if it "
"were a command-line argument. In particular, the parser applies any type_ "
"conversion argument, if provided, before setting the attribute on the :class:"
"`Namespace` return value. Otherwise, the parser uses the value as is::"
msgstr ""
"Si la valeur de ``default`` est une chaîne, l'analyseur analyse cette valeur "
"comme si c'était un argument de la ligne de commande. En particulier, "
"l'analyseur applique la conversion définie par l'argument type_ (si elle est "
"fournie) avant d'affecter l'attribut à l'objet :class:`Namespace` renvoyé. "
"Autrement, l'analyseur utilise la valeur telle qu'elle ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1103
2016-10-30 09:46:26 +00:00
msgid ""
"For positional arguments with nargs_ equal to ``?`` or ``*``, the "
"``default`` value is used when no command-line argument was present::"
msgstr ""
"Pour les arguments positionnels pour lesquels nargs_ est ``?`` ou ``*``, la "
"valeur de ``default`` est utilisée quand l'argument est absent de la ligne "
"de commande ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1114
2016-10-30 09:46:26 +00:00
msgid ""
"Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if "
2018-06-10 09:32:30 +00:00
"the command-line argument was not present::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Si vous passez ``default=argparse.SUPPRESS``, aucun attribut n'est ajouté à "
"l'objet ``Namespace`` quand l'argument est absent de la ligne de commande ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1128
2016-10-30 09:46:26 +00:00
msgid "type"
msgstr "Le paramètre *type*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1130
2016-10-30 09:46:26 +00:00
msgid ""
2021-01-27 19:42:04 +00:00
"By default, the parser reads command-line arguments in as simple strings. "
"However, quite often the command-line string should instead be interpreted "
"as another type, such as a :class:`float` or :class:`int`. The ``type`` "
"keyword for :meth:`~ArgumentParser.add_argument` allows any necessary type-"
"checking and type conversions to be performed."
2016-10-30 09:46:26 +00:00
msgstr ""
"Par défaut, l'analyseur capture les arguments de la ligne de commande comme "
"des chaînes. Très souvent par contre, on désire interpréter les chaînes de "
"la ligne de commande comme un autre type, tel que :class:`float` ou :class:"
"`int`. L'argument nommé ``type`` d':meth:`~ArgumentParser.add_argument` nous "
"permet de faire les vérifications et les conversions de type nécessaires."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1136
2016-10-30 09:46:26 +00:00
msgid ""
2021-01-27 19:42:04 +00:00
"If the type_ keyword is used with the default_ keyword, the type converter "
"is only applied if the default is a string."
2016-10-30 09:46:26 +00:00
msgstr ""
"Si l'argument nommé type_ est utilisé en conjonction avec l'argument nommé "
"default_, le convertisseur de type n'est appliqué que si la valeur par "
"défaut est une chaîne."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1139
2016-10-30 09:46:26 +00:00
msgid ""
2021-01-27 19:42:04 +00:00
"The argument to ``type`` can be any callable that accepts a single string. "
"If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:"
"`ValueError`, the exception is caught and a nicely formatted error message "
"is displayed. No other exception types are handled."
msgstr ""
"La valeur de l'argument ``type`` peut être n'importe quel appelable qui "
"accepte une seule chaîne. Si la fonction lève :exc:`ArgumentTypeError`, :exc:"
"`TypeError` ou :exc:`ValueError`, l'exception est traitée et un message "
"d'erreur agréablement formaté est affiché. Aucun autre type d'exception "
"n'est géré."
2021-01-27 19:42:04 +00:00
#: library/argparse.rst:1144
2021-01-27 19:42:04 +00:00
msgid "Common built-in types and functions can be used as type converters:"
msgstr ""
"Les types et les fonctions natives peuvent être utilisés comme "
"convertisseurs de types :"
2021-01-27 19:42:04 +00:00
#: library/argparse.rst:1160
2021-01-27 19:42:04 +00:00
msgid "User defined functions can be used as well:"
msgstr ""
"Des fonctions définies par l'utilisateur peuvent aussi être utilisées :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1172
2016-10-30 09:46:26 +00:00
msgid ""
2021-01-27 19:42:04 +00:00
"The :func:`bool` function is not recommended as a type converter. All it "
"does is convert empty strings to ``False`` and non-empty strings to "
"``True``. This is usually not what is desired."
2016-10-30 09:46:26 +00:00
msgstr ""
"La fonction :func:`bool` est déconseillée comme convertisseur de type. Son "
"comportement se limite à convertir les chaînes vides à ``False`` et les "
"chaînes non-vides à ``True``. Ce n'est généralement pas le résultat désiré."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1176
2016-10-30 09:46:26 +00:00
msgid ""
2021-01-27 19:42:04 +00:00
"In general, the ``type`` keyword is a convenience that should only be used "
"for simple conversions that can only raise one of the three supported "
"exceptions. Anything with more interesting error-handling or resource "
"management should be done downstream after the arguments are parsed."
msgstr ""
"En général, l'argument nommé ``type`` est un raccourci qui ne devrait être "
"utilisé que pour les conversions simples qui ne peuvent lever qu'une des "
"trois exceptions gérées. Les conversions qui demandent un traitement "
"d'erreurs plus intéressant ou une gestion de ressources devraient être "
"effectuées plus tard dans lexécution suivant l'analyse des arguments."
2021-01-27 19:42:04 +00:00
#: library/argparse.rst:1181
2021-01-27 19:42:04 +00:00
msgid ""
"For example, JSON or YAML conversions have complex error cases that require "
"better reporting than can be given by the ``type`` keyword. A :exc:`~json."
2021-01-27 19:42:04 +00:00
"JSONDecodeError` would not be well formatted and a :exc:`FileNotFound` "
"exception would not be handled at all."
2016-10-30 09:46:26 +00:00
msgstr ""
"Par exemple, les conversions de documents *JSON* ou *YAML* ont des cas "
"d'erreurs complexes qui requièrent un meilleur signalement que ce qui est "
"fourni par l'argument nommé ``type``. Une exception :exc:`~json."
"JSONDecodeError` ne serait pas adéquatement formatée et une exception :exc:"
"`FileNotFound` ne serait pas du tout traitée."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1186
2021-01-27 19:42:04 +00:00
msgid ""
"Even :class:`~argparse.FileType` has its limitations for use with the "
"``type`` keyword. If one argument uses *FileType* and then a subsequent "
"argument fails, an error is reported but the file is not automatically "
"closed. In this case, it would be better to wait until after the parser has "
"run and then use the :keyword:`with`-statement to manage the files."
msgstr ""
"Même la classe :class:`~argparse.FileType` a ses limitations quand elle est "
"utilisée pour l'argument nommé ``type``. Si un argument utilise *FileType* "
"et qu'un argument ultérieur échoue, une erreur est annoncée mais le fichier "
"n'est pas automatiquement fermé. Dans ce cas, il serait mieux d'attendre la "
"fin de l'exécution de l'analyseur puis de gérer les fichiers à l'aide d'un "
"bloc :keyword:`with`."
2021-01-27 19:42:04 +00:00
#: library/argparse.rst:1192
2021-01-27 19:42:04 +00:00
msgid ""
"For type checkers that simply check against a fixed set of values, consider "
"using the choices_ keyword instead."
msgstr ""
"Pour les vérificateurs de types qui ne font que tester l'appartenance à un "
"ensemble de valeurs, pensez plutôt à utiliser l'argument nommé choices_."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1199
2016-10-30 09:46:26 +00:00
msgid "choices"
msgstr "Le paramètre *choices*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1201
2016-10-30 09:46:26 +00:00
msgid ""
"Some command-line arguments should be selected from a restricted set of "
"values. These can be handled by passing a sequence object as the *choices* "
2016-10-30 09:46:26 +00:00
"keyword argument to :meth:`~ArgumentParser.add_argument`. When the command "
"line is parsed, argument values will be checked, and an error message will "
"be displayed if the argument was not one of the acceptable values::"
msgstr ""
"Certains arguments de la ligne de commande doivent être choisis parmi un "
"ensemble prédéfini de valeurs. Celles-ci doivent être déclarées dans la "
"séquence passée à l'argument *choices* de la méthode :meth:`~ArgumentParser."
"add_argument`. Un message d'erreur est alors affiché si l'utilisateur passe "
"un argument qui n'est pas parmi les valeurs acceptables ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1216
2016-10-30 09:46:26 +00:00
msgid ""
"Note that inclusion in the *choices* sequence is checked after any type_ "
2016-10-30 09:46:26 +00:00
"conversions have been performed, so the type of the objects in the *choices* "
"sequence should match the type_ specified::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Prenez note que le test d'inclusion dans le conteneur *choices* est fait "
"après la conversion de type_. Le type des objets dans le conteneur *choices* "
"doit donc correspondre au type_ spécifié ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1228
2016-10-30 09:46:26 +00:00
msgid ""
"Any sequence can be passed as the *choices* value, so :class:`list` "
"objects, :class:`tuple` objects, and custom sequences are all supported."
2016-10-30 09:46:26 +00:00
msgstr ""
"N'importe quel séquence peut être utilisée comme valeur de *choices*, dont "
"les objets de type :class:`list`, :class:`set` ou des conteneurs "
"personnalisés."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1231
2020-12-18 06:09:57 +00:00
msgid ""
"Use of :class:`enum.Enum` is not recommended because it is difficult to "
"control its appearance in usage, help, and error messages."
msgstr ""
"L'utilisation d':class:`enum.Enum` est déconseillée, car il est difficile de "
"contrôler son apparence dans les messages d'usage, d'aide et d'erreur."
2020-12-18 06:09:57 +00:00
#: library/argparse.rst:1234
2021-01-27 19:42:04 +00:00
msgid ""
2022-05-22 21:15:02 +00:00
"Formatted choices override the default *metavar* which is normally derived "
2021-01-27 19:42:04 +00:00
"from *dest*. This is usually what you want because the user never sees the "
"*dest* parameter. If this display isn't desirable (perhaps because there "
"are many choices), just specify an explicit metavar_."
msgstr ""
"Les choix formatés écrasent la valeur par défaut de *metavar* qui est "
"normalement dérivée de *dest*. C'est en général le comportement recherché "
"car l'utilisateur ne voit jamais le paramètre *dest*. Si cet affichage n'est "
"pas souhaité (comme lorsque les choix sont trop nombreux) spécifiez "
"simplement metavar_ de façon explicite."
2021-01-27 19:42:04 +00:00
#: library/argparse.rst:1243
2016-10-30 09:46:26 +00:00
msgid "required"
msgstr "Le paramètre *required*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1245
2016-10-30 09:46:26 +00:00
msgid ""
"In general, the :mod:`argparse` module assumes that flags like ``-f`` and "
"``--bar`` indicate *optional* arguments, which can always be omitted at the "
"command line. To make an option *required*, ``True`` can be specified for "
"the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::"
msgstr ""
"En général, le module :mod:`argparse` prend pour acquis que les drapeaux "
"comme ``-f`` et ``--bar`` annoncent un argument *optionnel* qui peut "
"toujours être omis de la ligne de commande. Pour rendre une option "
"*obligatoire*, ``True`` peut être passé à l'argument nommé ``required=`` d':"
"meth:`~ArgumentParser.add_argument` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1258
2016-10-30 09:46:26 +00:00
msgid ""
"As the example shows, if an option is marked as ``required``, :meth:"
"`~ArgumentParser.parse_args` will report an error if that option is not "
"present at the command line."
msgstr ""
"Tel qu'illustré dans l'exemple, quand l'option est marquée comme "
"``required``, :meth:`~ArgumentParser.parse_args` mentionne une erreur si "
"l'option est absente de la ligne de commande."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1264
2016-10-30 09:46:26 +00:00
msgid ""
"Required options are generally considered bad form because users expect "
"*options* to be *optional*, and thus they should be avoided when possible."
msgstr ""
"En général, les options obligatoires manifestent un style boiteux, car les "
"utilisateurs s'attendent à ce que les *options* soient *optionnelles*. Elles "
"devraient donc être évitées si possible."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1271
2016-10-30 09:46:26 +00:00
msgid "help"
msgstr "Le paramètre *help*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1273
2016-10-30 09:46:26 +00:00
msgid ""
"The ``help`` value is a string containing a brief description of the "
"argument. When a user requests help (usually by using ``-h`` or ``--help`` "
"at the command line), these ``help`` descriptions will be displayed with "
"each argument::"
msgstr ""
"La valeur de ``help`` est une chaîne qui contient une brève description de "
"l'argument. Quand un utilisateur demande de l'aide (en général par "
"l'utilisation de ``-h`` ou ``--help`` sur la ligne de commande), ces "
"descriptions d'aide sont affichées pour chacun des arguments ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1293
2016-10-30 09:46:26 +00:00
msgid ""
"The ``help`` strings can include various format specifiers to avoid "
"repetition of things like the program name or the argument default_. The "
"available specifiers include the program name, ``%(prog)s`` and most keyword "
"arguments to :meth:`~ArgumentParser.add_argument`, e.g. ``%(default)s``, "
"``%(type)s``, etc.::"
2016-10-30 09:46:26 +00:00
msgstr ""
"La chaîne ``help`` peut contenir des définitions de formatage permettant "
"d'éviter la répétition de contenu tel que le nom du programme et la valeur "
"par défaut de l'argument (voir default_). Les définitions disponibles "
"comprennent entre autres le nom du programme, ``%(prog)s``, et la plupart "
"des arguments nommés d':meth:`~ArgumentParser.add_argument`, tels que "
"``%(default)s``, ``%(type)s``, etc ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1310
2016-10-30 09:46:26 +00:00
msgid ""
"As the help string supports %-formatting, if you want a literal ``%`` to "
"appear in the help string, you must escape it as ``%%``."
msgstr ""
"Comme la chaîne d'aide utilise le caractère ``%`` pour le formatage, si vous "
"désirez afficher un ``%`` littéral dans la chaîne d'aide, vous devez en "
"faire léchappement avec ``%%``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1313
2016-10-30 09:46:26 +00:00
msgid ""
":mod:`argparse` supports silencing the help entry for certain options, by "
"setting the ``help`` value to ``argparse.SUPPRESS``::"
msgstr ""
":mod:`argparse` peut supprimer la rubrique d'aide de certaines options. Pour "
"ce faire, passez ``argparse.SUPPRESS`` à ``help`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1328
2016-10-30 09:46:26 +00:00
msgid "metavar"
msgstr "Le paramètre *metavar*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1330
2016-10-30 09:46:26 +00:00
msgid ""
"When :class:`ArgumentParser` generates help messages, it needs some way to "
"refer to each expected argument. By default, ArgumentParser objects use the "
"dest_ value as the \"name\" of each object. By default, for positional "
"argument actions, the dest_ value is used directly, and for optional "
"argument actions, the dest_ value is uppercased. So, a single positional "
"argument with ``dest='bar'`` will be referred to as ``bar``. A single "
"optional argument ``--foo`` that should be followed by a single command-line "
"argument will be referred to as ``FOO``. An example::"
msgstr ""
"Quand un objet :class:`ArgumentParser` construit le message d'aide, il doit "
"pouvoir faire référence à chacun des arguments attendus. Par défaut, les "
"objets ``ArgumentParser`` utilisent la valeur de dest_ pour le nom de chaque "
"objet. La valeur de dest_ est alors utilisée telle quelle pour les actions "
"d'arguments positionnels et elle (dest_) est convertie en majuscules pour "
"les actions d'arguments optionnels. Ainsi, un argument positionnel unique "
"avec ``dest='bar'`` est affiché comme ``bar`` et un argument positionnel "
"unique ``--foo`` qui prend un seul argument sur la ligne de commande est "
"affiché comme ``FOO``. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1354
2016-10-30 09:46:26 +00:00
msgid "An alternative name can be specified with ``metavar``::"
msgstr "Un nom alternatif peut être fourni à ``metavar`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1371
2016-10-30 09:46:26 +00:00
msgid ""
"Note that ``metavar`` only changes the *displayed* name - the name of the "
"attribute on the :meth:`~ArgumentParser.parse_args` object is still "
"determined by the dest_ value."
msgstr ""
"Prenez note que ``metavar`` ne change que le nom *affiché*. Le nom de "
"l'attribut ajouté à l'objet renvoyé par :meth:`~ArgumentParser.parse_args` "
"est toujours déterminé par la valeur de dest_."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1375
2016-10-30 09:46:26 +00:00
msgid ""
"Different values of ``nargs`` may cause the metavar to be used multiple "
"times. Providing a tuple to ``metavar`` specifies a different display for "
"each of the arguments::"
msgstr ""
"Certaines valeurs de ``nargs`` peuvent provoquer l'affichage de ``metavar`` "
"plus d'une fois. Passer un *n-uplet* à ``metavar`` indique les différents "
"noms à afficher pour chacun des arguments ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1394
2016-10-30 09:46:26 +00:00
msgid "dest"
msgstr "Le paramètre *dest*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1396
2016-10-30 09:46:26 +00:00
msgid ""
"Most :class:`ArgumentParser` actions add some value as an attribute of the "
"object returned by :meth:`~ArgumentParser.parse_args`. The name of this "
"attribute is determined by the ``dest`` keyword argument of :meth:"
"`~ArgumentParser.add_argument`. For positional argument actions, ``dest`` "
"is normally supplied as the first argument to :meth:`~ArgumentParser."
"add_argument`::"
msgstr ""
"La plupart des actions d':class:`ArgumentParser` ajoutent une valeur dans un "
"attribut de l'objet renvoyé par :meth:`~ArgumentParser.parse_args`. Le nom "
"de l'attribut est déterminé par l'argument nommé ``dest`` d':meth:"
"`~ArgumentParser.add_argument`. Pour les arguments positionnels, ``dest`` "
"est généralement le premier argument d':meth:`~ArgumentParser."
"add_argument` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1408
2016-10-30 09:46:26 +00:00
msgid ""
"For optional argument actions, the value of ``dest`` is normally inferred "
"from the option strings. :class:`ArgumentParser` generates the value of "
"``dest`` by taking the first long option string and stripping away the "
"initial ``--`` string. If no long option strings were supplied, ``dest`` "
"will be derived from the first short option string by stripping the initial "
"``-`` character. Any internal ``-`` characters will be converted to ``_`` "
"characters to make sure the string is a valid attribute name. The examples "
"below illustrate this behavior::"
msgstr ""
"Pour les actions d'arguments optionnels, la valeur de ``dest`` est "
"généralement inférée des chaînes d'options. :class:`ArgumentParser` génère "
"la valeur de ``dest`` en retirant le préfixe ``--`` de la première chaîne "
"d'options longues. Si aucune n'est fournie, ``dest`` est alors dérivée de la "
"première chaîne d'options courtes sans le préfixe ``-``. Tous les ``-`` "
"suivants sont convertis en ``_`` pour s'assurer que la chaîne est un nom "
"d'attribut valide. Les exemples suivants illustrent ce comportement ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1425
2016-10-30 09:46:26 +00:00
msgid "``dest`` allows a custom attribute name to be provided::"
msgstr "``dest`` vous permet de fournir un nom d'attribut personnalisé ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1433
2016-10-30 09:46:26 +00:00
msgid "Action classes"
msgstr "Classes Action"
#: library/argparse.rst:1435
2016-10-30 09:46:26 +00:00
msgid ""
"Action classes implement the Action API, a callable which returns a callable "
"which processes arguments from the command-line. Any object which follows "
"this API may be passed as the ``action`` parameter to :meth:`add_argument`."
msgstr ""
"Les classes ``Action`` implémentent l'API Action, un appelable qui renvoie "
"un appelable qui traite les arguments de la ligne de commande. Tout objet "
"qui suit cette API peut être passé comme paramètre ``action`` d':meth:"
"`add_argument`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1444
2016-10-30 09:46:26 +00:00
msgid ""
"Action objects are used by an ArgumentParser to represent the information "
"needed to parse a single argument from one or more strings from the command "
"line. The Action class must accept the two positional arguments plus any "
"keyword arguments passed to :meth:`ArgumentParser.add_argument` except for "
"the ``action`` itself."
msgstr ""
"Les objets ``Action`` sont utilisés par un ``ArgumentParser`` pour "
"représenter l'information nécessaire à l'analyse d'un seul argument à partir "
"d'une ou plusieurs chaînes de la ligne de commande. La classe ``Action`` "
"doit accepter les deux arguments positionnels d':meth:`ArgumentParser."
"add_argument` ainsi que tous ses arguments nommés, sauf ``action``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1450
2016-10-30 09:46:26 +00:00
msgid ""
"Instances of Action (or return value of any callable to the ``action`` "
"parameter) should have attributes \"dest\", \"option_strings\", \"default\", "
"\"type\", \"required\", \"help\", etc. defined. The easiest way to ensure "
"these attributes are defined is to call ``Action.__init__``."
msgstr ""
"Les instances d'``Action`` (ou la valeur de retour de l'appelable passé au "
"paramètre ``action``) doivent définir les attributs nécessaires : *dest*, "
"*option_strings*, *default*, *type*, *required*, *help*, etc. La façon la "
"plus simple de s'assurer que ces attributs sont définis est d'appeler "
"``Action.__init__``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1455
2016-10-30 09:46:26 +00:00
msgid ""
"Action instances should be callable, so subclasses must override the "
"``__call__`` method, which should accept four parameters:"
msgstr ""
"Les instances d'``Action`` doivent être appelables et donc les sous-classes "
"doivent surcharger la méthode ``__call__``. Cette méthode doit accepter "
"quatre paramètres :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1458
2016-10-30 09:46:26 +00:00
msgid "``parser`` - The ArgumentParser object which contains this action."
msgstr "``parser`` L'objet ``ArgumentParser`` qui contient cette action ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1460
2016-10-30 09:46:26 +00:00
msgid ""
"``namespace`` - The :class:`Namespace` object that will be returned by :meth:"
"`~ArgumentParser.parse_args`. Most actions add an attribute to this object "
"using :func:`setattr`."
msgstr ""
"``namespace`` L'objet :class:`Namespace` qui est renvoyé par :meth:"
"`~ArgumentParser.parse_args`. La majorité des actions ajoutent un attribut à "
"cet objet avec :func:`setattr` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1464
2016-10-30 09:46:26 +00:00
msgid ""
"``values`` - The associated command-line arguments, with any type "
"conversions applied. Type conversions are specified with the type_ keyword "
"argument to :meth:`~ArgumentParser.add_argument`."
msgstr ""
"``values`` Les arguments de la ligne de commande associés à l'action après "
"les avoir soumis à la conversion de type. Les conversions de types sont "
"spécifiées grâce à largument nommé type_ d':meth:`~ArgumentParser."
"add_argument` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1468
2016-10-30 09:46:26 +00:00
msgid ""
"``option_string`` - The option string that was used to invoke this action. "
"The ``option_string`` argument is optional, and will be absent if the action "
"is associated with a positional argument."
msgstr ""
"``option_string`` La chaîne d'option utilisée pour invoquer cette action. "
"L'argument ``option_string`` est optionnel et est absent si l'action est "
"associée à un argument positionnel."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1472
2016-10-30 09:46:26 +00:00
msgid ""
"The ``__call__`` method may perform arbitrary actions, but will typically "
"set attributes on the ``namespace`` based on ``dest`` and ``values``."
msgstr ""
"La méthode ``__call__`` peut réaliser un traitement arbitraire, mais en "
"général elle affecte des attributs sur le ``namespace`` en fonction de "
"``dest`` et de ``values``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1475
2020-07-20 08:56:42 +00:00
msgid ""
"Action subclasses can define a ``format_usage`` method that takes no "
"argument and return a string which will be used when printing the usage of "
"the program. If such method is not provided, a sensible default will be used."
msgstr ""
"Les classes dérivées d'``Action`` peuvent définir une méthode "
"``format_usage`` qui ne prend aucun argument et qui renvoie une chaîne "
"utilisée lors de l'affichage du message d'utilisation du programme. Si cette "
"méthode n'est pas fournie, une valeur raisonnable est utilisée par défaut."
2020-07-20 08:56:42 +00:00
#: library/argparse.rst:1480
2016-10-30 09:46:26 +00:00
msgid "The parse_args() method"
msgstr "La méthode *parse_args()*"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1484
2016-10-30 09:46:26 +00:00
msgid ""
"Convert argument strings to objects and assign them as attributes of the "
"namespace. Return the populated namespace."
msgstr ""
"Convertie les chaînes d'arguments en objets et les assigne comme attributs "
"de l'espace de nommage ``namespace``. Renvoie un objet ``namespace`` rempli."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1487
2016-10-30 09:46:26 +00:00
msgid ""
"Previous calls to :meth:`add_argument` determine exactly what objects are "
"created and how they are assigned. See the documentation for :meth:"
"`add_argument` for details."
msgstr ""
"Les appels à :meth:`add_argument` qui ont été faits déterminent exactement "
"quels objets sont créés et comment ils sont affectés. Consultez la rubrique "
"d':meth:`add_argument` pour les détails."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1491
2017-09-12 11:40:22 +00:00
msgid ""
"args_ - List of strings to parse. The default is taken from :data:`sys."
"argv`."
msgstr ""
"args_ Liste de chaînes à analyser. La valeur par défaut est récupérée "
"dans :data:`sys.argv`."
2017-09-12 11:40:22 +00:00
#: library/argparse.rst:1494
2016-10-30 09:46:26 +00:00
msgid ""
2017-09-12 11:40:22 +00:00
"namespace_ - An object to take the attributes. The default is a new empty :"
"class:`Namespace` object."
2016-10-30 09:46:26 +00:00
msgstr ""
"namespace_ Un objet pour recevoir les attributs. Par défaut, une nouvelle "
"instance (vide) de :class:`Namespace`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1499
2016-10-30 09:46:26 +00:00
msgid "Option value syntax"
msgstr "Syntaxe de la valeur des options"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1501
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.parse_args` method supports several ways of "
"specifying the value of an option (if it takes one). In the simplest case, "
"the option and its value are passed as two separate arguments::"
msgstr ""
"La méthode :meth:`~ArgumentParser.parse_args` offre plusieurs façons "
"d'indiquer la valeur d'une option si elle en prend une. Dans le cas le plus "
"simple, l'option et sa valeur sont passées en tant que deux arguments "
"distincts ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1513
2016-10-30 09:46:26 +00:00
msgid ""
"For long options (options with names longer than a single character), the "
"option and value can also be passed as a single command-line argument, using "
"``=`` to separate them::"
msgstr ""
"Pour les options longues (les options qui ont un nom de plus d'un "
"caractère), l'option et sa valeur peuvent être passées comme un seul "
"argument de la ligne de commande en utilisant ``=`` comme séparateur ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1520
2016-10-30 09:46:26 +00:00
msgid ""
"For short options (options only one character long), the option and its "
"value can be concatenated::"
msgstr ""
"Pour les options courtes (un seul caractère), l'option et sa valeur peuvent "
"être concaténées ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1526
2016-10-30 09:46:26 +00:00
msgid ""
"Several short options can be joined together, using only a single ``-`` "
"prefix, as long as only the last option (or none of them) requires a value::"
msgstr ""
"Plusieurs options courtes peuvent être groupées ensemble après un seul "
"préfixe ``-`` pour autant que seule la dernière, au maximum, ne nécessite "
"une valeur ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1538
2016-10-30 09:46:26 +00:00
msgid "Invalid arguments"
msgstr "Arguments invalides"
#: library/argparse.rst:1540
2016-10-30 09:46:26 +00:00
msgid ""
"While parsing the command line, :meth:`~ArgumentParser.parse_args` checks "
"for a variety of errors, including ambiguous options, invalid types, invalid "
"options, wrong number of positional arguments, etc. When it encounters such "
"an error, it exits and prints the error along with a usage message::"
msgstr ""
"Quand elle fait l'analyse de la ligne de commande, la méthode :meth:"
"`~ArgumentParser.parse_args` vérifie plusieurs erreurs possibles : entre "
"autres, options ambigües, types invalides, options invalides, nombre "
"incorrect d'arguments positionnels, etc. Quand une erreur est rencontrée, "
"elle affiche l'erreur accompagnée du message d'aide puis termine "
"l'exécution ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1566
2016-10-30 09:46:26 +00:00
msgid "Arguments containing ``-``"
msgstr "Arguments contenant ``-``"
#: library/argparse.rst:1568
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.parse_args` method attempts to give errors "
"whenever the user has clearly made a mistake, but some situations are "
"inherently ambiguous. For example, the command-line argument ``-1`` could "
"either be an attempt to specify an option or an attempt to provide a "
"positional argument. The :meth:`~ArgumentParser.parse_args` method is "
"cautious here: positional arguments may only begin with ``-`` if they look "
"like negative numbers and there are no options in the parser that look like "
"negative numbers::"
msgstr ""
"La méthode :meth:`~ArgumentParser.parse_args` tente de signaler une erreur "
"quand l'utilisateur s'est clairement trompé. Par contre, certaines "
"situations sont intrinsèquement ambigües. Par exemple, l'argument de la "
"ligne de commande ``-1`` peut aussi bien être une tentative de spécifier une "
"option qu'une tentative de passer un argument positionnel. La méthode :meth:"
"`~ArgumentParser.parse_args` est prudente : les arguments positionnels ne "
"peuvent commencer par ``-`` que s'ils ont l'apparence d'un nombre négatif et "
"que l'analyseur ne contient aucune option qui a l'apparence d'un nombre "
"négatif ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1606
2016-10-30 09:46:26 +00:00
msgid ""
"If you have positional arguments that must begin with ``-`` and don't look "
"like negative numbers, you can insert the pseudo-argument ``'--'`` which "
"tells :meth:`~ArgumentParser.parse_args` that everything after that is a "
"positional argument::"
msgstr ""
"Si l'utilisateur a des arguments positionnels qui commencent par ``-`` et "
"qui n'ont pas l'apparence d'un nombre négatif, il peut insérer le pseudo-"
"argument ``'--'`` qui indique à :meth:`~ArgumentParser.parse_args` de "
"traiter tout ce qui suit comme un argument positionnel ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1617
2016-10-30 09:46:26 +00:00
msgid "Argument abbreviations (prefix matching)"
msgstr "Arguments abrégés (par comparaison de leurs préfixes)"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1619
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`~ArgumentParser.parse_args` method :ref:`by default "
"<allow_abbrev>` allows long options to be abbreviated to a prefix, if the "
"abbreviation is unambiguous (the prefix matches a unique option)::"
msgstr ""
"Par défaut, la méthode :meth:`~ArgumentParser.parse_args` accepte que les "
"options longues soient :ref:`abrégées <allow_abbrev>` par un préfixe pour "
"autant que labréviation soit non-ambigüe, c'est-à-dire qu'elle ne "
"corresponde à aucune autre option ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1634
2016-10-30 09:46:26 +00:00
msgid ""
"An error is produced for arguments that could produce more than one options. "
"This feature can be disabled by setting :ref:`allow_abbrev` to ``False``."
msgstr ""
"Une erreur est générée pour les arguments qui peuvent produire plus d'une "
"option. Ce comportement peut être désactivé en passant ``False`` à :ref:"
"`allow_abbrev`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1640
2016-10-30 09:46:26 +00:00
msgid "Beyond ``sys.argv``"
msgstr "Au-delà de ``sys.argv``"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1642
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes it may be useful to have an ArgumentParser parse arguments other "
"than those of :data:`sys.argv`. This can be accomplished by passing a list "
"of strings to :meth:`~ArgumentParser.parse_args`. This is useful for "
"testing at the interactive prompt::"
msgstr ""
"Il est parfois désirable de demander à un objet ``ArgumentParser`` de faire "
"l'analyse d'arguments autres que ceux de :data:`sys.argv`. On peut faire ce "
"traitement en passant une liste de chaînes à :meth:`~ArgumentParser."
"parse_args`. Cette approche est pratique pour faire des tests depuis "
"l'invite de commande ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1662
2016-10-30 09:46:26 +00:00
msgid "The Namespace object"
msgstr "L'objet ``Namespace``"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1666
2016-10-30 09:46:26 +00:00
msgid ""
"Simple class used by default by :meth:`~ArgumentParser.parse_args` to create "
"an object holding attributes and return it."
msgstr ""
"Classe rudimentaire utilisée par défaut par :meth:`~ArgumentParser."
"parse_args` pour créer un objet qui stocke les attributs. Cet objet est "
"renvoyé par ``ArgumentParser.parse_args``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1669
2016-10-30 09:46:26 +00:00
msgid ""
"This class is deliberately simple, just an :class:`object` subclass with a "
"readable string representation. If you prefer to have dict-like view of the "
"attributes, you can use the standard Python idiom, :func:`vars`::"
msgstr ""
"Cette classe est délibérément rudimentaire : une sous-classe d':class:"
"`object` avec une représentation textuelle intelligible. Si vous préférez "
"une vue *dict-compatible*, vous devez utiliser :func:`vars` (un idiome "
"Python classique) ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1679
2016-10-30 09:46:26 +00:00
msgid ""
"It may also be useful to have an :class:`ArgumentParser` assign attributes "
"to an already existing object, rather than a new :class:`Namespace` object. "
"This can be achieved by specifying the ``namespace=`` keyword argument::"
msgstr ""
"Il est parfois utile de demander à :class:`ArgumentParser` de faire "
"l'affectation des attributs sur un objet existant plutôt que de faire la "
"création d'un nouvel objet :class:`Namespace`. Ceci peut être réalisé avec "
"l'argument nommé ``namespace=`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1695
2016-10-30 09:46:26 +00:00
msgid "Other utilities"
msgstr "Autres outils"
#: library/argparse.rst:1698
2016-10-30 09:46:26 +00:00
msgid "Sub-commands"
msgstr "Sous commandes"
#: library/argparse.rst:1705
2016-10-30 09:46:26 +00:00
msgid ""
"Many programs split up their functionality into a number of sub-commands, "
"for example, the ``svn`` program can invoke sub-commands like ``svn "
"checkout``, ``svn update``, and ``svn commit``. Splitting up functionality "
"this way can be a particularly good idea when a program performs several "
"different functions which require different kinds of command-line "
"arguments. :class:`ArgumentParser` supports the creation of such sub-"
"commands with the :meth:`add_subparsers` method. The :meth:`add_subparsers` "
"method is normally called with no arguments and returns a special action "
"object. This object has a single method, :meth:`~ArgumentParser."
"add_parser`, which takes a command name and any :class:`ArgumentParser` "
"constructor arguments, and returns an :class:`ArgumentParser` object that "
"can be modified as usual."
msgstr ""
"Certains programmes organisent leurs fonctionnalités grâce à des sous-"
"commandes. Par exemple : le programme ``svn`` peut être invoqué comme ``svn "
"checkout``, ``svn update`` et ``svn commit``. Cette manière d'organiser les "
"fonctionnalités est judicieuse quand le programme effectue plusieurs "
"fonctions différentes qui requièrent différents types de lignes de "
"commandes. :class:`ArgumentParser` prend en charge la création de ce genre "
"de sous-commandes grâce à la méthode :meth:`add_subparsers`. La méthode :"
"meth:`add_subparsers` est généralement appelée sans argument et elle renvoie "
"un objet ``Action`` spécial. Cet objet possède une seule méthode, :meth:"
"`~ArgumentParser.add_parser`, qui prend le nom d'une commande et n'importe "
"quels arguments du constructeur d':class:`ArgumentParser` ; elle renvoie un "
"objet :class:`ArgumentParser` qui peut être modifié normalement."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1717
2016-10-30 09:46:26 +00:00
msgid "Description of parameters:"
msgstr "Description des paramètres :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1719
2016-10-30 09:46:26 +00:00
msgid ""
"title - title for the sub-parser group in help output; by default "
"\"subcommands\" if description is provided, otherwise uses title for "
"positional arguments"
msgstr ""
"``title`` titre du groupe de ce sous-analyseur dans la sortie d'aide ; par "
"défaut : ``\"subcommands\"`` si ``description`` est fournie, sinon utilise "
"la valeur de ``title`` de la section sur les arguments positionnels ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1723
2016-10-30 09:46:26 +00:00
msgid ""
"description - description for the sub-parser group in help output, by "
"default ``None``"
msgstr ""
"``description`` description du groupe de ce sous-analyseur dans la sortie "
"d'aide ; par défaut : ``None`` ;"
2016-10-30 09:46:26 +00:00
2021-05-19 16:06:14 +00:00
# I think the English version is very misleading here. Even for subcommands,
# ``prog`` is only a tiny prefix of the auto generater usage string.
#: library/argparse.rst:1726
2016-10-30 09:46:26 +00:00
msgid ""
"prog - usage information that will be displayed with sub-command help, by "
"default the name of the program and any positional arguments before the "
"subparser argument"
msgstr ""
"``prog`` nom du programme dans le message d'utilisation de l'aide des sous-"
"commandes ; par défaut : le nom du programme et les arguments positionnels "
"qui arrivent avant l'argument de ce sous-analyseur ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1730
2016-10-30 09:46:26 +00:00
msgid ""
"parser_class - class which will be used to create sub-parser instances, by "
"default the class of the current parser (e.g. ArgumentParser)"
msgstr ""
"``parser_class`` classe utilisée pour créer les instances de sous-"
"analyseurs ; par défaut : la classe de l'analyseur courant (par exemple "
"``ArgumentParser``) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1733
2016-10-30 09:46:26 +00:00
msgid ""
"action_ - the basic type of action to be taken when this argument is "
"encountered at the command line"
msgstr ""
"action_ action à entreprendre quand cet argument est reconnu sur la ligne "
"de commande ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1736
2016-10-30 09:46:26 +00:00
msgid ""
"dest_ - name of the attribute under which sub-command name will be stored; "
"by default ``None`` and no value is stored"
msgstr ""
"dest_ nom de l'attribut sous lequel la sous-commande est stockée ; par "
"défaut : ``None`` et aucune valeur n'est stockée ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1739
2018-06-28 13:32:56 +00:00
msgid ""
"required_ - Whether or not a subcommand must be provided, by default "
2019-10-09 16:10:12 +00:00
"``False`` (added in 3.7)"
2018-06-28 13:32:56 +00:00
msgstr ""
"required_ ``True`` si la sous-commande est obligatoire ; par défaut : "
"``False`` (ajouté dans 3.7) ;"
2018-06-28 13:32:56 +00:00
#: library/argparse.rst:1742
2016-10-30 09:46:26 +00:00
msgid "help_ - help for sub-parser group in help output, by default ``None``"
msgstr ""
"help_ message d'aide pour le groupe du sous-analyseur dans la sortie "
"d'aide ; par défaut : ``None`` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1744
2016-10-30 09:46:26 +00:00
msgid ""
"metavar_ - string presenting available sub-commands in help; by default it "
"is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}"
msgstr ""
"metavar_ chaîne qui représente les sous-commandes disponibles dans les "
"messages d'aide ; par défaut : ``None``, ce qui entraine la génération d'une "
"chaîne suivant le format ``'{cmd1, cmd2, …}'``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1747
2016-10-30 09:46:26 +00:00
msgid "Some example usage::"
msgstr "Quelques exemples d'utilisation ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1768
2016-10-30 09:46:26 +00:00
msgid ""
"Note that the object returned by :meth:`parse_args` will only contain "
"attributes for the main parser and the subparser that was selected by the "
"command line (and not any other subparsers). So in the example above, when "
"the ``a`` command is specified, only the ``foo`` and ``bar`` attributes are "
"present, and when the ``b`` command is specified, only the ``foo`` and "
"``baz`` attributes are present."
msgstr ""
"Prenez note que l'objet renvoyé par :meth:`parse_args` ne contient que les "
"attributs reconnus par l'analyseur principal et le sous-analyseur "
"sélectionné par la ligne de commande. Les autres sous-analyseurs n'ont pas "
"d'influence sur l'objet renvoyé. Ainsi dans l'exemple précédent, quand la "
"commande ``a`` est donnée, seuls les attributs ``foo`` et ``bar`` sont "
"présents alors que la commande ``b`` présente les attributs ``foo`` et "
"``baz``."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1775
2016-10-30 09:46:26 +00:00
msgid ""
"Similarly, when a help message is requested from a subparser, only the help "
"for that particular parser will be printed. The help message will not "
"include parent parser or sibling parser messages. (A help message for each "
"subparser command, however, can be given by supplying the ``help=`` argument "
"to :meth:`add_parser` as above.)"
msgstr ""
"De même, quand le message d'aide est demandé depuis l'un des sous-"
"analyseurs, seul le message d'aide de cet analyseur est affiché. Le message "
"d'aide n'inclut pas le message de l'analyseur parent ni celui des sous-"
"analyseurs au même niveau. Il est toutefois possible de fournir un message "
"d'aide pour chacun des sous-analyseurs grâce à l'argument ``help=`` d':meth:"
"`add_parser` tel qu'illustré ci-dessus."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1811
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`add_subparsers` method also supports ``title`` and "
"``description`` keyword arguments. When either is present, the subparser's "
"commands will appear in their own group in the help output. For example::"
msgstr ""
"La méthode :meth:`add_subparsers` accepte les arguments nommés ``title`` et "
"``description``. Quand au moins l'un des deux est présent, les commandes du "
"sous-analyseur sont affichées dans leur propre groupe dans la sortie d'aide. "
"Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1832
2016-10-30 09:46:26 +00:00
msgid ""
"Furthermore, ``add_parser`` supports an additional ``aliases`` argument, "
"which allows multiple strings to refer to the same subparser. This example, "
"like ``svn``, aliases ``co`` as a shorthand for ``checkout``::"
msgstr ""
"De plus, ``add_parser`` accepte l'argument additionnel ``aliases`` qui "
"permet à plusieurs chaînes de faire référence au même sous-analyseur. "
"L'exemple suivant, à la manière de ``svn``, utilise ``co`` comme une "
"abréviation de ``checkout`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1843
2016-10-30 09:46:26 +00:00
msgid ""
"One particularly effective way of handling sub-commands is to combine the "
"use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` "
"so that each subparser knows which Python function it should execute. For "
"example::"
msgstr ""
"Une façon efficace de traiter les sous-commandes est de combiner "
"l'utilisation de la méthode :meth:`add_subparsers` avec des appels à :meth:"
"`set_defaults` pour que chaque sous-analyseur sache quelle fonction Python "
"doit être exécutée. Par exemple ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1880
2016-10-30 09:46:26 +00:00
msgid ""
"This way, you can let :meth:`parse_args` do the job of calling the "
"appropriate function after argument parsing is complete. Associating "
"functions with actions like this is typically the easiest way to handle the "
"different actions for each of your subparsers. However, if it is necessary "
"to check the name of the subparser that was invoked, the ``dest`` keyword "
"argument to the :meth:`add_subparsers` call will work::"
msgstr ""
"Ainsi, vous pouvez laisser à :meth:`parse_args` la responsabilité de faire "
"appel à la bonne fonction après avoir analysé les arguments. Associer "
"fonctions et actions est en général la façon la plus facile de gérer des "
"actions différentes pour chacun de vos sous-analyseurs. Par contre, si vous "
"avez besoin de consulter le nom du sous-analyseur qui a été invoqué, vous "
"pouvez utiliser l'argument nommé ``dest`` d':meth:`add_subparsers` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1896
2019-10-09 16:10:12 +00:00
msgid "New *required* keyword argument."
msgstr "Introduction des arguments nommés obligatoires."
2019-10-09 16:10:12 +00:00
#: library/argparse.rst:1901
2016-10-30 09:46:26 +00:00
msgid "FileType objects"
msgstr "Objets ``FileType``"
#: library/argparse.rst:1905
2016-10-30 09:46:26 +00:00
msgid ""
"The :class:`FileType` factory creates objects that can be passed to the type "
"argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:"
"`FileType` objects as their type will open command-line arguments as files "
"with the requested modes, buffer sizes, encodings and error handling (see "
"the :func:`open` function for more details)::"
msgstr ""
"Le type fabrique :class:`FileType` crée des objets qui peuvent être passés à "
"l'argument ``type`` d':meth:`ArgumentParser.add_argument`. Les arguments qui "
"ont comme ``type`` un objet :class:`FileType` ouvrent les arguments de la "
"ligne de commande en tant que fichiers avec les options spécifiées : mode, "
"taille du tampon, encodage et gestion des erreurs (voir la fonction :func:"
"`open` pour plus de détails) ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1917
2016-10-30 09:46:26 +00:00
msgid ""
"FileType objects understand the pseudo-argument ``'-'`` and automatically "
"convert this into :data:`sys.stdin` for readable :class:`FileType` objects "
"and :data:`sys.stdout` for writable :class:`FileType` objects::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Les objets ``FileType`` reconnaissent le pseudo-argument ``'-'`` et le "
"convertissent automatiquement vers :data:`sys.stdin` pour les objets :class:"
"`FileType` ouverts en lecture, et vers :data:`sys.stdout` pour les objets :"
"class:`FileType` ouverts en écriture ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1926
2016-10-30 09:46:26 +00:00
msgid "The *encodings* and *errors* keyword arguments."
msgstr "Les arguments nommés ``encodings`` et ``errors``."
#: library/argparse.rst:1931
2016-10-30 09:46:26 +00:00
msgid "Argument groups"
msgstr "Groupes d'arguments"
#: library/argparse.rst:1935
2016-10-30 09:46:26 +00:00
msgid ""
"By default, :class:`ArgumentParser` groups command-line arguments into "
"\"positional arguments\" and \"options\" when displaying help messages. When "
"there is a better conceptual grouping of arguments than this default one, "
"appropriate groups can be created using the :meth:`add_argument_group` "
"method::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Par défaut, :class:`ArgumentParser` regroupe les arguments de la ligne de "
"commande entre « arguments positionnels » et « arguments optionnels » dans "
"l'affichage de l'aide. Lorsqu'un meilleur regroupement conceptuel est "
"possible, celui-ci peut être créé avec la méthode :meth:"
"`add_argument_group` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1952
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`add_argument_group` method returns an argument group object which "
"has an :meth:`~ArgumentParser.add_argument` method just like a regular :"
"class:`ArgumentParser`. When an argument is added to the group, the parser "
"treats it just like a normal argument, but displays the argument in a "
"separate group for help messages. The :meth:`add_argument_group` method "
"accepts *title* and *description* arguments which can be used to customize "
"this display::"
msgstr ""
"La méthode :meth:`add_argument_group` renvoie un objet représentant le "
"groupe d'arguments. Cet objet possède une méthode :meth:`~ArgumentParser."
"add_argument` semblable à celle d':class:`ArgumentParser`. Quand un argument "
"est ajouté au groupe, l'analyseur le traite comme un argument normal, mais "
"il affiche le nouvel argument dans un groupe séparé dans les messages "
"d'aide. Afin de personnaliser l'affichage, la méthode :meth:"
"`add_argument_group` accepte les arguments ``title`` et ``description`` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1978
2016-10-30 09:46:26 +00:00
msgid ""
"Note that any arguments not in your user-defined groups will end up back in "
"the usual \"positional arguments\" and \"optional arguments\" sections."
msgstr ""
"Prenez note que tout argument qui n'est pas dans l'un de vos groupes est "
"affiché dans l'une des sections usuelles *positional arguments* et *optional "
"arguments*."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:1981
2022-03-23 17:40:12 +00:00
msgid ""
"Calling :meth:`add_argument_group` on an argument group is deprecated. This "
"feature was never supported and does not always work correctly. The function "
"exists on the API by accident through inheritance and will be removed in the "
"future."
msgstr ""
"Appeler :meth:`add_argument_group` sur un groupe d'arguments est obsolète. "
"Cet emploi n'a jamais été pris en charge et ne fonctionne pas dans tous les "
"cas. La présence de cette fonction dans l'API est purement accidentelle et "
"celle-ci disparaîtra."
2022-03-23 17:40:12 +00:00
#: library/argparse.rst:1989
2016-10-30 09:46:26 +00:00
msgid "Mutual exclusion"
msgstr "Exclusion mutuelle"
#: library/argparse.rst:1993
2016-10-30 09:46:26 +00:00
msgid ""
"Create a mutually exclusive group. :mod:`argparse` will make sure that only "
"one of the arguments in the mutually exclusive group was present on the "
"command line::"
msgstr ""
"Crée un groupe mutuellement exclusif. Le module :mod:`argparse` vérifie "
"qu'au plus un des arguments du groupe mutuellement exclusif est présent sur "
"la ligne de commande ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2009
2016-10-30 09:46:26 +00:00
msgid ""
"The :meth:`add_mutually_exclusive_group` method also accepts a *required* "
"argument, to indicate that at least one of the mutually exclusive arguments "
"is required::"
msgstr ""
"La méthode :meth:`add_mutually_exclusive_group` accepte aussi l'argument "
"``required`` pour indiquer qu'au moins un des arguments mutuellement "
"exclusifs est nécessaire ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2021
2016-10-30 09:46:26 +00:00
msgid ""
"Note that currently mutually exclusive argument groups do not support the "
"*title* and *description* arguments of :meth:`~ArgumentParser."
"add_argument_group`."
msgstr ""
"Prenez note que présentement les groupes d'arguments mutuellement exclusifs "
"n'acceptent pas les arguments ``title`` et ``description`` d':meth:"
"`~ArgumentParser.add_argument_group`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2025
2022-03-23 17:40:12 +00:00
msgid ""
"Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` "
"on a mutually exclusive group is deprecated. These features were never "
"supported and do not always work correctly. The functions exist on the API "
"by accident through inheritance and will be removed in the future."
msgstr ""
"Appeler :meth:`add_argument_group` ou :meth:`add_mutually_exclusive_group` "
"sur un groupe mutuellement exclusif est obsolète. Cet emploi n'a jamais été "
"pris en charge et ne fonctionne pas dans tous les cas. La présence de cette "
"fonction dans l'API est purement accidentelle et celle-ci disparaîtra."
2022-03-23 17:40:12 +00:00
#: library/argparse.rst:2033
2016-10-30 09:46:26 +00:00
msgid "Parser defaults"
msgstr "Valeurs par défaut de l'analyseur"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2037
2016-10-30 09:46:26 +00:00
msgid ""
"Most of the time, the attributes of the object returned by :meth:"
"`parse_args` will be fully determined by inspecting the command-line "
"arguments and the argument actions. :meth:`set_defaults` allows some "
"additional attributes that are determined without any inspection of the "
"command line to be added::"
msgstr ""
"Dans la majorité des cas, les attributs de l'objet renvoyé par :meth:"
"`parse_args` sont entièrement définis par l'inspection des arguments de la "
"ligne de commande et par les actions des arguments. La méthode :meth:"
"`set_defaults` permet l'ajout d'attributs additionnels qui sont définis sans "
"nécessiter l'inspection de la ligne de commande ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2049
2016-10-30 09:46:26 +00:00
msgid ""
"Note that parser-level defaults always override argument-level defaults::"
msgstr ""
"Prenez note que les valeurs par défaut au niveau de l'analyseur ont "
"précédence sur les valeurs par défaut au niveau de l'argument ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2057
2016-10-30 09:46:26 +00:00
msgid ""
"Parser-level defaults can be particularly useful when working with multiple "
"parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an "
"example of this type."
msgstr ""
"Les valeurs par défaut au niveau de l'analyseur sont particulièrement utiles "
"quand on travaille avec plusieurs analyseurs. Voir la méthode :meth:"
"`~ArgumentParser.add_subparsers` pour un exemple de cette utilisation."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2063
2016-10-30 09:46:26 +00:00
msgid ""
"Get the default value for a namespace attribute, as set by either :meth:"
"`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::"
msgstr ""
"Renvoie la valeur par défaut d'un attribut de l'objet ``Namespace`` tel "
"qu'il a été défini soit par :meth:`~ArgumentParser.add_argument` ou par :"
"meth:`~ArgumentParser.set_defaults` ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2074
2016-10-30 09:46:26 +00:00
msgid "Printing help"
msgstr "Afficher l'aide"
#: library/argparse.rst:2076
2016-10-30 09:46:26 +00:00
msgid ""
"In most typical applications, :meth:`~ArgumentParser.parse_args` will take "
"care of formatting and printing any usage or error messages. However, "
"several formatting methods are available:"
msgstr ""
"Pour la majorité des applications, :meth:`~ArgumentParser.parse_args` se "
"charge du formatage et de l'affichage des messages d'erreur et "
"d'utilisation. Plusieurs méthodes de formatage sont toutefois disponibles :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2082
2016-10-30 09:46:26 +00:00
msgid ""
"Print a brief description of how the :class:`ArgumentParser` should be "
"invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is "
"assumed."
msgstr ""
"Affiche une brève description sur la façon d'invoquer l':class:"
"`ArgumentParser` depuis la ligne de commande. Si ``file`` est ``None``, "
"utilise :data:`sys.stdout`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2088
2016-10-30 09:46:26 +00:00
msgid ""
"Print a help message, including the program usage and information about the "
"arguments registered with the :class:`ArgumentParser`. If *file* is "
"``None``, :data:`sys.stdout` is assumed."
msgstr ""
"Affiche un message d'aide qui inclut l'utilisation du programme et "
"l'information sur les arguments répertoriés dans l':class:`ArgumentParser`. "
"Si ``file`` est ``None``, utilise :data:`sys.stdout`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2092
2016-10-30 09:46:26 +00:00
msgid ""
"There are also variants of these methods that simply return a string instead "
"of printing it:"
msgstr ""
"Des variantes de ces méthodes sont fournies pour renvoyer la chaîne plutôt "
"que de l'afficher :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2097
2016-10-30 09:46:26 +00:00
msgid ""
"Return a string containing a brief description of how the :class:"
"`ArgumentParser` should be invoked on the command line."
msgstr ""
"Renvoie une chaîne contenant une brève description sur la façon d'invoquer "
"l':class:`ArgumentParser` depuis la ligne de commande."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2102
2016-10-30 09:46:26 +00:00
msgid ""
"Return a string containing a help message, including the program usage and "
"information about the arguments registered with the :class:`ArgumentParser`."
msgstr ""
"Renvoie une chaîne représentant un message d'aide qui inclut des "
"informations sur l'utilisation du programme et sur les arguments définis "
"dans l':class:`ArgumentParser`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2107
2016-10-30 09:46:26 +00:00
msgid "Partial parsing"
msgstr "Analyse partielle"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2111
2016-10-30 09:46:26 +00:00
msgid ""
"Sometimes a script may only parse a few of the command-line arguments, "
"passing the remaining arguments on to another script or program. In these "
"cases, the :meth:`~ArgumentParser.parse_known_args` method can be useful. "
"It works much like :meth:`~ArgumentParser.parse_args` except that it does "
"not produce an error when extra arguments are present. Instead, it returns "
"a two item tuple containing the populated namespace and the list of "
"remaining argument strings."
msgstr ""
"Parfois, un script n'analyse que quelques-uns des arguments de la ligne de "
"commande avant de passer les arguments non-traités à un autre script ou "
"programme. La méthode :meth:`~ArgumentParser.parse_known_args` est utile "
"dans ces cas. Elle fonctionne similairement à :meth:`~ArgumentParser."
"parse_args`, mais elle ne lève pas d'erreur quand des arguments non-reconnus "
"sont présents. Au lieu, elle renvoie une paire de valeurs : l'objet "
"``Namespace`` rempli et la liste des arguments non-traités."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2127
2016-10-30 09:46:26 +00:00
msgid ""
":ref:`Prefix matching <prefix-matching>` rules apply to :meth:"
"`parse_known_args`. The parser may consume an option even if it's just a "
"prefix of one of its known options, instead of leaving it in the remaining "
"arguments list."
msgstr ""
"Les règles d':ref:`acceptation des abréviations <prefix-matching>` sont "
"applicables à :meth:`parse_known_args`. L'analyseur peut ainsi capturer une "
"option même si elle n'est que le préfixe d'une option reconnue plutôt que de "
"la laisser dans la liste des arguments non-traités."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2134
2016-10-30 09:46:26 +00:00
msgid "Customizing file parsing"
msgstr "Personnaliser le *parsing* de fichiers"
#: library/argparse.rst:2138
2016-10-30 09:46:26 +00:00
msgid ""
"Arguments that are read from a file (see the *fromfile_prefix_chars* keyword "
"argument to the :class:`ArgumentParser` constructor) are read one argument "
"per line. :meth:`convert_arg_line_to_args` can be overridden for fancier "
"reading."
msgstr ""
"Les arguments qui proviennent d'un fichier sont lus un par ligne. La "
"méthode :meth:`convert_arg_line_to_args` peut être surchargée pour accomplir "
"un traitement plus élaboré. Voir aussi l'argument nommé "
"``fromfile_prefix_chars`` du constructeur d':class:`ArgumentParser`."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2143
2016-10-30 09:46:26 +00:00
msgid ""
"This method takes a single argument *arg_line* which is a string read from "
"the argument file. It returns a list of arguments parsed from this string. "
"The method is called once per line read from the argument file, in order."
msgstr ""
"La méthode ``convert_arg_line_to_args`` accepte un seul argument, "
"``arg_line``, qui est une chaîne lue dans le fichier d'arguments. Elle "
"renvoie une liste d'arguments analysés dans cette chaîne. La méthode est "
"appelée une fois pour chaque ligne lue du fichier d'arguments. L'ordre est "
"préservé."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2147
2016-10-30 09:46:26 +00:00
msgid ""
"A useful override of this method is one that treats each space-separated "
"word as an argument. The following example demonstrates how to do this::"
msgstr ""
"Une surcharge utile de cette méthode est de permettre à chaque mot délimité "
"par des espaces d'être traité comme un argument. L'exemple suivant illustre "
"comment réaliser ceci ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2156
2016-10-30 09:46:26 +00:00
msgid "Exiting methods"
msgstr "Méthodes d'interruptions"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2160
2016-10-30 09:46:26 +00:00
msgid ""
"This method terminates the program, exiting with the specified *status* and, "
2019-10-09 16:10:12 +00:00
"if given, it prints a *message* before that. The user can override this "
"method to handle these steps differently::"
2016-10-30 09:46:26 +00:00
msgstr ""
"Cette méthode interrompt l'exécution du programme et renvoie ``status`` "
"comme valeur de retour du processus. Si ``message`` est fourni, la chaîne "
"est affichée avant la fin de l'exécution. Vous pouvez surcharger cette "
"méthode pour traiter ces étapes différemment ::"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2172
2016-10-30 09:46:26 +00:00
msgid ""
"This method prints a usage message including the *message* to the standard "
"error and terminates the program with a status code of 2."
msgstr ""
"Cette méthode affiche un message d'utilisation qui inclut la chaîne "
"``message`` sur la sortie d'erreur standard puis termine l'exécution avec le "
"code de fin d'exécution 2."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2177
2018-06-28 13:32:56 +00:00
msgid "Intermixed parsing"
2018-07-21 08:59:44 +00:00
msgstr "Analyse entremêlée"
2018-06-28 13:32:56 +00:00
#: library/argparse.rst:2182
2018-06-28 13:32:56 +00:00
msgid ""
"A number of Unix commands allow the user to intermix optional arguments with "
"positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` "
"and :meth:`~ArgumentParser.parse_known_intermixed_args` methods support this "
"parsing style."
msgstr ""
"De nombreuses commandes Unix permettent à l'utilisateur d'entremêler les "
"arguments optionnels et les arguments positionnels. Les méthodes :meth:"
"`~ArgumentParser.parse_intermixed_args` et :meth:`~ArgumentParser."
"parse_known_intermixed_args` permettent ce style d'analyse."
2018-06-28 13:32:56 +00:00
#: library/argparse.rst:2187
2018-06-28 13:32:56 +00:00
msgid ""
"These parsers do not support all the argparse features, and will raise "
"exceptions if unsupported features are used. In particular, subparsers, "
"``argparse.REMAINDER``, and mutually exclusive groups that include both "
"optionals and positionals are not supported."
msgstr ""
"Ces analyseurs n'offrent pas toutes les fonctionnalités d'``argparse`` et "
"ils lèvent une exception si une fonctionnalité non prise en charge est "
"utilisée. En particulier, les sous-analyseurs, ``argparse.REMAINDER`` et les "
"groupes mutuellement exclusifs qui contiennent à la fois des arguments "
"optionnels et des arguments positionnels ne sont pas pris en charge."
2018-06-28 13:32:56 +00:00
#: library/argparse.rst:2192
2018-06-28 13:32:56 +00:00
msgid ""
"The following example shows the difference between :meth:`~ArgumentParser."
"parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the "
"former returns ``['2', '3']`` as unparsed arguments, while the latter "
"collects all the positionals into ``rest``. ::"
msgstr ""
"L'exemple suivant illustre la différence entre :meth:`~ArgumentParser."
"parse_known_args` et :meth:`~ArgumentParser.parse_intermixed_args` : le "
"premier renvoie ``['2', '3']`` comme arguments non-traités alors que le "
"second capture tous les arguments positionnels dans ``rest`` ::"
2018-06-28 13:32:56 +00:00
#: library/argparse.rst:2207
2018-06-28 13:32:56 +00:00
msgid ""
":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple "
"containing the populated namespace and the list of remaining argument "
"strings. :meth:`~ArgumentParser.parse_intermixed_args` raises an error if "
"there are any remaining unparsed argument strings."
msgstr ""
":meth:`~ArgumentParser.parse_known_intermixed_args` renvoie une paire de "
"valeurs : l'objet ``Namespace`` rempli et une liste de chaînes d'arguments "
"non-traités. :meth:`~ArgumentParser.parse_intermixed_args` lève une erreur "
"s'il reste des chaînes d'arguments non-traités."
2018-06-28 13:32:56 +00:00
#: library/argparse.rst:2217
2016-10-30 09:46:26 +00:00
msgid "Upgrading optparse code"
msgstr "Mettre à jour du code ``optparse``"
2021-05-19 16:06:14 +00:00
# Surchargé n'est pas une traduction exact de monkey-patch, mais c'est
# probablement permission içi puisqu'on parle du context historique général
# plutôt que de détails d'implantation.
#: library/argparse.rst:2219
2016-10-30 09:46:26 +00:00
msgid ""
"Originally, the :mod:`argparse` module had attempted to maintain "
"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult "
"to extend transparently, particularly with the changes required to support "
"the new ``nargs=`` specifiers and better usage messages. When most "
"everything in :mod:`optparse` had either been copy-pasted over or monkey-"
"patched, it no longer seemed practical to try to maintain the backwards "
"compatibility."
msgstr ""
"Initialement, le module :mod:`argparse` tentait de rester compatible avec :"
"mod:`optparse`. Hélas, il était difficile de faire des améliorations à :mod:"
"`optparse` de façon transparente, en particulier pour les changements requis "
"pour gérer les nouveaux spécificateurs de ``nargs=`` et les messages "
"d'utilisation améliorés. Après avoir porté ou surchargé tout le code d':mod:"
"`optparse`, la rétro-compatibilité pouvait difficilement être conservée."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2226
2016-10-30 09:46:26 +00:00
msgid ""
"The :mod:`argparse` module improves on the standard library :mod:`optparse` "
"module in a number of ways including:"
msgstr ""
"Le module :mod:`argparse` fournit plusieurs améliorations par rapport au "
"module :mod:`optparse` de la bibliothèque standard :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2229
2016-10-30 09:46:26 +00:00
msgid "Handling positional arguments."
msgstr "gère les arguments positionnels ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2230
2016-10-30 09:46:26 +00:00
msgid "Supporting sub-commands."
msgstr "prise en charge des sous commandes ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2231
2016-10-30 09:46:26 +00:00
msgid "Allowing alternative option prefixes like ``+`` and ``/``."
msgstr ""
"permet d'utiliser les alternatives ``+`` ou ``/`` comme préfixes d'option ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2232
2016-10-30 09:46:26 +00:00
msgid "Handling zero-or-more and one-or-more style arguments."
msgstr "prend en charge la répétition de valeurs (zéro ou plus, un ou plus) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2233
2016-10-30 09:46:26 +00:00
msgid "Producing more informative usage messages."
msgstr "fournit des messages d'aide plus complets ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2234
2016-10-30 09:46:26 +00:00
msgid "Providing a much simpler interface for custom ``type`` and ``action``."
msgstr ""
"fournit une interface plus simple pour les types et les actions "
"personnalisés."
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2236
2016-10-30 09:46:26 +00:00
msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:"
msgstr "Le portage partiel d':mod:`optparse` à :mod:`argparse` :"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2238
2016-10-30 09:46:26 +00:00
msgid ""
"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:"
"`ArgumentParser.add_argument` calls."
msgstr ""
"remplacer tous les appels à :meth:`optparse.OptionParser.add_option` par des "
"appels à :meth:`ArgumentParser.add_argument` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2241
2016-10-30 09:46:26 +00:00
msgid ""
"Replace ``(options, args) = parser.parse_args()`` with ``args = parser."
"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls "
"for the positional arguments. Keep in mind that what was previously called "
2017-09-12 11:40:22 +00:00
"``options``, now in the :mod:`argparse` context is called ``args``."
2016-10-30 09:46:26 +00:00
msgstr ""
"remplacer ``(options, args) = parser.parse_args()`` par ``args = parser."
"parse_args()`` et ajouter des appels à :meth:`ArgumentParser.add_argument` "
"pour les arguments positionnels. Prenez note que les valeurs précédemment "
"appelées ``options`` sont appelées ``args`` dans le contexte d':mod:"
"`argparse` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2246
2017-09-12 11:40:22 +00:00
msgid ""
2018-06-28 13:32:56 +00:00
"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :"
"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:"
"`~ArgumentParser.parse_args`."
2017-09-12 11:40:22 +00:00
msgstr ""
"remplacer :meth:`optparse.OptionParser.disable_interspersed_args` en "
"appelant :meth:`~ArgumentParser.parse_intermixed_args` plutôt que :meth:"
"`~ArgumentParser.parse_args` ;"
2017-09-12 11:40:22 +00:00
#: library/argparse.rst:2250
2016-10-30 09:46:26 +00:00
msgid ""
"Replace callback actions and the ``callback_*`` keyword arguments with "
"``type`` or ``action`` arguments."
msgstr ""
"remplacer les actions de rappel (*callback actions* en anglais) et les "
"arguments nommés ``callback_*`` par des arguments ``type`` et ``actions`` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2253
2016-10-30 09:46:26 +00:00
msgid ""
"Replace string names for ``type`` keyword arguments with the corresponding "
"type objects (e.g. int, float, complex, etc)."
msgstr ""
"remplacer les chaînes représentant le nom des types pour l'argument nommé "
"``type`` par les objets types correspondants (par exemple : ``int``, "
"``float``, ``complex``, etc) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2256
2016-10-30 09:46:26 +00:00
msgid ""
"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse."
"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`."
msgstr ""
"remplacer :class:`optparse.Values` par :class:`Namespace` ; et :exc:"
"`optparse.OptionError` et :exc:`optparse.OptionValueError` par :exc:"
"`ArgumentError` ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2260
2016-10-30 09:46:26 +00:00
msgid ""
"Replace strings with implicit arguments such as ``%default`` or ``%prog`` "
"with the standard Python syntax to use dictionaries to format strings, that "
"is, ``%(default)s`` and ``%(prog)s``."
msgstr ""
"remplacer les chaînes avec des arguments de formatage implicite (tels que "
"``%default`` ou ``%prog``) par la syntaxe standard de Python pour "
"l'interpolation d'un dictionnaire dans les chaînes de formatage (c'est-à-"
"dire ``%(default)s`` et ``%(prog)s``) ;"
2016-10-30 09:46:26 +00:00
#: library/argparse.rst:2264
2016-10-30 09:46:26 +00:00
msgid ""
"Replace the OptionParser constructor ``version`` argument with a call to "
"``parser.add_argument('--version', action='version', version='<the "
"version>')``."
msgstr ""
"remplacer l'argument ``version`` du constructeur d'``OptionParser`` par un "
"appel à ``parser.add_argument('--version', action='version', version='<la "
"version>')``."
2021-01-27 19:42:04 +00:00
2022-03-23 17:40:12 +00:00
#~ msgid ""
#~ "With the ``'store_const'`` and ``'append_const'`` actions, the ``const`` "
#~ "keyword argument must be given. For other actions, it defaults to "
#~ "``None``."
#~ msgstr ""
#~ "Pour les actions ``'store_const'`` et ``'append_const'``, l'argument "
#~ "nommé ``const`` doit être spécifié. Pour toutes les autres actions, il "
#~ "est optionnel et sa valeur par défaut est ``None``."
2021-01-27 19:42:04 +00:00
#~ msgid ""
#~ "See the section on the default_ keyword argument for information on when "
#~ "the ``type`` argument is applied to default arguments."
#~ msgstr ""
#~ "Consultez la rubrique de l'argument nommé default_ pour plus "
#~ "d'information sur quand l'argument ``type`` est appliqué aux arguments "
#~ "par défaut."
#~ msgid ""
#~ "To ease the use of various types of files, the argparse module provides "
#~ "the factory FileType which takes the ``mode=``, ``bufsize=``, "
#~ "``encoding=`` and ``errors=`` arguments of the :func:`open` function. "
#~ "For example, ``FileType('w')`` can be used to create a writable file::"
#~ msgstr ""
#~ "Pour faciliter l'utilisation de types de fichiers variés, le module "
#~ "``argparse`` fournit le type fabrique ``FileType`` qui accepte les "
#~ "arguments ``mode=``, ``bufsize=``, ``encoding=`` et ``errors=`` de la "
#~ "fonction :func:`open`. Par exemple, ``FileType('w')`` peut être utilisé "
#~ "pour créer un fichier en mode écriture ::"
#~ msgid ""
#~ "``type=`` can take any callable that takes a single string argument and "
#~ "returns the converted value::"
#~ msgstr ""
#~ "``type=`` peut prendre n'importe quelle fonction ou objet appelable qui "
#~ "prend une seule chaîne de caractère comme argument et qui renvoie la "
#~ "valeur convertie ::"
#~ msgid ""
#~ "The choices_ keyword argument may be more convenient for type checkers "
#~ "that simply check against a range of values::"
#~ msgstr ""
#~ "L'argument nommé choices_ est parfois plus facile d'utilisation pour les "
#~ "vérificateurs de type qui comparent la valeur à une gamme prédéfinie ::"
#~ msgid "See the choices_ section for more details."
#~ msgstr "Voir la rubrique de choices_ pour plus de détails."