@@ -11,7 +11,7 @@ msgid ""
1111msgstr ""
1212"Project-Id-Version : Python 3.13\n "
1313"Report-Msgid-Bugs-To : \n "
14- "POT-Creation-Date : 2024-12-13 14:18 +0000\n "
14+ "POT-Creation-Date : 2024-12-27 14:16 +0000\n "
1515"PO-Revision-Date : 2021-06-28 01:06+0000\n "
1616"Last-Translator : tomo, 2021\n "
1717"Language-Team : Japanese (https://app.transifex.com/python-doc/teams/5390/ "
@@ -30,22 +30,16 @@ msgstr ""
3030msgid "**Source code:** :source:`Lib/getopt.py`"
3131msgstr "**ソースコード:** :source:`Lib/getopt.py`"
3232
33- #: ../../library/getopt.rst:10
33+ #: ../../library/getopt.rst:12
3434msgid ""
35- "The :mod:`getopt` module is :term:`soft deprecated` and will not be "
36- "developed further; development will continue with the :mod:`argparse` module."
35+ "This module is considered feature complete. A more declarative and "
36+ "extensible alternative to this API is provided in the :mod:`optparse` "
37+ "module. Further functional enhancements for command line parameter "
38+ "processing are provided either as third party modules on PyPI, or else as "
39+ "features in the :mod:`argparse` module."
3740msgstr ""
3841
39- #: ../../library/getopt.rst:17
40- msgid ""
41- "The :mod:`getopt` module is a parser for command line options whose API is "
42- "designed to be familiar to users of the C :c:func:`!getopt` function. Users "
43- "who are unfamiliar with the C :c:func:`!getopt` function or who would like "
44- "to write less code and get better help and error messages should consider "
45- "using the :mod:`argparse` module instead."
46- msgstr ""
47-
48- #: ../../library/getopt.rst:25
42+ #: ../../library/getopt.rst:20
4943msgid ""
5044"This module helps scripts to parse the command line arguments in ``sys."
5145"argv``. It supports the same conventions as the Unix :c:func:`!getopt` "
@@ -54,11 +48,21 @@ msgid ""
5448"be used as well via an optional third argument."
5549msgstr ""
5650
57- #: ../../library/getopt.rst:31
51+ #: ../../library/getopt.rst:26
52+ msgid ""
53+ "Users who are unfamiliar with the Unix :c:func:`!getopt` function should "
54+ "consider using the :mod:`argparse` module instead. Users who are familiar "
55+ "with the Unix :c:func:`!getopt` function, but would like to get equivalent "
56+ "behavior while writing less code and getting better help and error messages "
57+ "should consider using the :mod:`optparse` module. See :ref:`choosing-an-"
58+ "argument-parser` for additional details."
59+ msgstr ""
60+
61+ #: ../../library/getopt.rst:33
5862msgid "This module provides two functions and an exception:"
5963msgstr "このモジュールは2つの関数と1つの例外を提供しています:"
6064
61- #: ../../library/getopt.rst:37
65+ #: ../../library/getopt.rst:39
6266msgid ""
6367"Parses command line options and parameter list. *args* is the argument list "
6468"to be parsed, without the leading reference to the running program. "
@@ -68,14 +72,14 @@ msgid ""
6872"func:`!getopt` uses)."
6973msgstr ""
7074
71- #: ../../library/getopt.rst:45
75+ #: ../../library/getopt.rst:47
7276msgid ""
7377"Unlike GNU :c:func:`!getopt`, after a non-option argument, all further "
7478"arguments are considered also non-options. This is similar to the way non-"
7579"GNU Unix systems work."
7680msgstr ""
7781
78- #: ../../library/getopt.rst:49
82+ #: ../../library/getopt.rst:51
7983msgid ""
8084"*longopts*, if specified, must be a list of strings with the names of the "
8185"long options which should be supported. The leading ``'--'`` characters "
@@ -97,7 +101,7 @@ msgstr ""
97101"foo`` にマッチしますが、``--f`` では一意に決定できないので、:exc:"
98102"`GetoptError` が送出されます。"
99103
100- #: ../../library/getopt.rst:60
104+ #: ../../library/getopt.rst:62
101105msgid ""
102106"The return value consists of two elements: the first is a list of ``(option, "
103107"value)`` pairs; the second is the list of program arguments left after the "
@@ -118,7 +122,7 @@ msgstr ""
118122"順に並んでいて、複数回同じオプションを指定できます。長形式と短形式のオプショ"
119123"ンは混在できます。"
120124
121- #: ../../library/getopt.rst:73
125+ #: ../../library/getopt.rst:75
122126msgid ""
123127"This function works like :func:`getopt`, except that GNU style scanning mode "
124128"is used by default. This means that option and non-option arguments may be "
@@ -130,14 +134,14 @@ msgstr ""
130134"混在させることができます。:func:`getopt` 関数はオプションでない引数を見つける"
131135"と解析を停止します。"
132136
133- #: ../../library/getopt.rst:78
137+ #: ../../library/getopt.rst:80
134138msgid ""
135139"If the first character of the option string is ``'+'``, or if the "
136140"environment variable :envvar:`!POSIXLY_CORRECT` is set, then option "
137141"processing stops as soon as a non-option argument is encountered."
138142msgstr ""
139143
140- #: ../../library/getopt.rst:85
144+ #: ../../library/getopt.rst:87
141145msgid ""
142146"This is raised when an unrecognized option is found in the argument list or "
143147"when an option requiring an argument is given none. The argument to the "
@@ -148,16 +152,16 @@ msgid ""
148152"which the exception relates, :attr:`!opt` is an empty string."
149153msgstr ""
150154
151- #: ../../library/getopt.rst:96
155+ #: ../../library/getopt.rst:98
152156msgid "Alias for :exc:`GetoptError`; for backward compatibility."
153157msgstr ""
154158":exc:`GetoptError` へのエイリアスです。後方互換性のために残されています。"
155159
156- #: ../../library/getopt.rst:98
160+ #: ../../library/getopt.rst:100
157161msgid "An example using only Unix style options:"
158162msgstr "Unix スタイルのオプションを使った例です:"
159163
160- #: ../../library/getopt.rst:100
164+ #: ../../library/getopt.rst:102
161165msgid ""
162166">>> import getopt\n"
163167">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n"
@@ -170,11 +174,11 @@ msgid ""
170174"['a1', 'a2']"
171175msgstr ""
172176
173- #: ../../library/getopt.rst:112
177+ #: ../../library/getopt.rst:114
174178msgid "Using long option names is equally easy:"
175179msgstr "長形式のオプションを使っても同様です:"
176180
177- #: ../../library/getopt.rst:114
181+ #: ../../library/getopt.rst:116
178182msgid ""
179183">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n"
180184">>> args = s.split()\n"
@@ -190,11 +194,11 @@ msgid ""
190194"['a1', 'a2']"
191195msgstr ""
192196
193- #: ../../library/getopt.rst:127
197+ #: ../../library/getopt.rst:129
194198msgid "In a script, typical usage is something like this:"
195199msgstr ""
196200
197- #: ../../library/getopt.rst:129
201+ #: ../../library/getopt.rst:131
198202msgid ""
199203"import getopt, sys\n"
200204"\n"
@@ -220,36 +224,69 @@ msgid ""
220224" output = a\n"
221225" else:\n"
222226" assert False, \" unhandled option\" \n"
223- " # ... \n"
227+ " process(args, output=output, verbose=verbose) \n"
224228"\n"
225229"if __name__ == \" __main__\" :\n"
226230" main()"
227231msgstr ""
228232
229- #: ../../library/getopt.rst:158
233+ #: ../../library/getopt.rst:160
230234msgid ""
231235"Note that an equivalent command line interface could be produced with less "
232236"code and more informative help and error messages by using the :mod:"
233- "`argparse` module:"
237+ "`optparse` module:"
238+ msgstr ""
239+
240+ #: ../../library/getopt.rst:163
241+ msgid ""
242+ "import optparse\n"
243+ "\n"
244+ "if __name__ == '__main__':\n"
245+ " parser = optparse.OptionParser()\n"
246+ " parser.add_option('-o', '--output')\n"
247+ " parser.add_option('-v', dest='verbose', action='store_true')\n"
248+ " opts, args = parser.parse_args()\n"
249+ " process(args, output=opts.output, verbose=opts.verbose)"
234250msgstr ""
235251
236- #: ../../library/getopt.rst:161
252+ #: ../../library/getopt.rst:174
253+ msgid ""
254+ "A roughly equivalent command line interface for this case can also be "
255+ "produced by using the :mod:`argparse` module:"
256+ msgstr ""
257+
258+ #: ../../library/getopt.rst:177
237259msgid ""
238260"import argparse\n"
239261"\n"
240262"if __name__ == '__main__':\n"
241263" parser = argparse.ArgumentParser()\n"
242264" parser.add_argument('-o', '--output')\n"
243265" parser.add_argument('-v', dest='verbose', action='store_true')\n"
266+ " parser.add_argument('rest', nargs='*')\n"
244267" args = parser.parse_args()\n"
245- " # ... do something with args.output ...\n"
246- " # ... do something with args.verbose .."
268+ " process(args.rest, output=args.output, verbose=args.verbose)"
247269msgstr ""
248270
249- #: ../../library/getopt.rst:175
271+ #: ../../library/getopt.rst:189
272+ msgid ""
273+ "See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` "
274+ "version of this code differs in behaviour from the ``optparse`` (and "
275+ "``getopt``) version."
276+ msgstr ""
277+
278+ #: ../../library/getopt.rst:195
279+ msgid "Module :mod:`optparse`"
280+ msgstr ""
281+
282+ #: ../../library/getopt.rst:196
283+ msgid "Declarative command line option parsing."
284+ msgstr ""
285+
286+ #: ../../library/getopt.rst:198
250287msgid "Module :mod:`argparse`"
251288msgstr ":mod:`argparse` モジュール"
252289
253- #: ../../library/getopt.rst:176
254- msgid "Alternative command line option and argument parsing library."
255- msgstr "別のコマンドラインオプションと引数の解析ライブラリ。 "
290+ #: ../../library/getopt.rst:199
291+ msgid "More opinionated command line option and argument parsing library."
292+ msgstr ""
0 commit comments