@@ -1815,6 +1815,8 @@ msgid ""
1815
1815
"``\" float\" `` and ``\" complex\" `` option arguments are converted directly "
1816
1816
"with :func:`float` and :func:`complex`, with similar error-handling."
1817
1817
msgstr ""
1818
+ "``\" float\" `` 和 ``\" complex\" `` 选项参数会直接通过 :func:`float` 和 :func:`complex` "
1819
+ "来转换,使用类似的错误处理。"
1818
1820
1819
1821
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1311
1820
1822
msgid ""
@@ -1824,6 +1826,9 @@ msgid ""
1824
1826
"user-supplied option arguments against this master list and raises "
1825
1827
":exc:`OptionValueError` if an invalid string is given."
1826
1828
msgstr ""
1829
+ "``\" choice\" `` 选项是 ``\" string\" `` 选项的子类型。 :attr:`~Option.choices` "
1830
+ "选项属性(由字符串组成的序列)定义了允许的选项参数的集合。 :func:`optparse.check_choice` "
1831
+ "将用户提供的选项参数与这个主列表进行比较并会在给出无效的字符串时引发 :exc:`OptionValueError`。"
1827
1832
1828
1833
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1321
1829
1834
msgid "Parsing arguments"
@@ -1833,7 +1838,7 @@ msgstr "解析参数"
1833
1838
msgid ""
1834
1839
"The whole point of creating and populating an OptionParser is to call its "
1835
1840
":meth:`parse_args` method::"
1836
- msgstr ""
1841
+ msgstr "创建和填充 OptionParser 的基本目的是调用其 :meth:`parse_args` 方法:: "
1837
1842
1838
1843
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1328
1839
1844
msgid "where the input parameters are"
@@ -1847,7 +1852,7 @@ msgstr "``args``"
1847
1852
1848
1853
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1331
1849
1854
msgid "the list of arguments to process (default: ``sys.argv[1:]``)"
1850
- msgstr ""
1855
+ msgstr "要处理的参数列表 (默认: ``sys.argv[1:]``) "
1851
1856
1852
1857
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1336
1853
1858
msgid "``values``"
@@ -1859,10 +1864,12 @@ msgid ""
1859
1864
"new instance of :class:`Values`) -- if you give an existing object, the "
1860
1865
"option defaults will not be initialized on it"
1861
1866
msgstr ""
1867
+ "要用于存储选项参数的 :class:`optparse.Values` 对象 (默认:一个新的 :class:`Values` 实例) -- "
1868
+ "如果你给出一个现有对象,则不会基于它来初始化选项的默认值"
1862
1869
1863
1870
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1338
1864
1871
msgid "and the return values are"
1865
- msgstr ""
1872
+ msgstr "返回值为 "
1866
1873
1867
1874
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1342
1868
1875
msgid "``options``"
@@ -1872,12 +1879,12 @@ msgstr "``options``"
1872
1879
msgid ""
1873
1880
"the same object that was passed in as ``values``, or the optparse.Values "
1874
1881
"instance created by :mod:`optparse`"
1875
- msgstr ""
1882
+ msgstr "同一个对象将作为 ``values``,或 :mod:`optparse` 所创建的 optparse.Values 实例传入 "
1876
1883
1877
1884
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1345
1878
1885
msgid ""
1879
1886
"the leftover positional arguments after all options have been processed"
1880
- msgstr ""
1887
+ msgstr "在所有选项被处理完毕后余下的位置参数 "
1881
1888
1882
1889
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1347
1883
1890
msgid ""
@@ -1886,6 +1893,8 @@ msgid ""
1886
1893
" one for every option argument stored to an option destination) and returned"
1887
1894
" by :meth:`parse_args`."
1888
1895
msgstr ""
1896
+ "最常见的用法是不提供任何关键字参数。 如果你提供了 ``values``,它将通过重复的 :func:`setattr` "
1897
+ "调用来修改(大致为每个存储到指定选项目标的选项参数调用一次)并由 :meth:`parse_args` 返回。"
1889
1898
1890
1899
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1352
1891
1900
msgid ""
@@ -1894,28 +1903,33 @@ msgid ""
1894
1903
"message. This ultimately terminates your process with an exit status of 2 "
1895
1904
"(the traditional Unix exit status for command-line errors)."
1896
1905
msgstr ""
1906
+ "如果 :meth:`parse_args` 在参数列表中遇到任何错误,它将调用 OptionParser 的 :meth:`error` "
1907
+ "方法并附带适当的最终用户错误消息。 这会完全终结你的进程并将退出状态设为 2 (传统的针对命令行错误的 Unix 退出状态)。"
1897
1908
1898
1909
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1361
1899
1910
msgid "Querying and manipulating your option parser"
1900
- msgstr ""
1911
+ msgstr "查询和操纵你的选项解析器 "
1901
1912
1902
1913
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1363
1903
1914
msgid ""
1904
1915
"The default behavior of the option parser can be customized slightly, and "
1905
1916
"you can also poke around your option parser and see what's there. "
1906
1917
"OptionParser provides several methods to help you out:"
1907
1918
msgstr ""
1919
+ "选项解析器的默认行为可被轻度地定制,并且你还可以调整你的选项解析器查看实际效果如何。 OptionParser 提供了一些方法来帮助你进行定制:"
1908
1920
1909
1921
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1369
1910
1922
msgid ""
1911
1923
"Set parsing to stop on the first non-option. For example, if ``-a`` and "
1912
1924
"``-b`` are both simple options that take no arguments, :mod:`optparse` "
1913
1925
"normally accepts this syntax::"
1914
1926
msgstr ""
1927
+ "设置解析在第一个非选项处停止。 举例来说,如果 ``-a`` 和 ``-b`` 都是不接受参数的简单选项,则 :mod:`optparse` "
1928
+ "通常会接受这样的语法::"
1915
1929
1916
1930
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1375
1917
1931
msgid "and treats it as equivalent to ::"
1918
- msgstr ""
1932
+ msgstr "并会这样处理它 :: "
1919
1933
1920
1934
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1379
1921
1935
msgid ""