@@ -1937,31 +1937,36 @@ msgid ""
1937
1937
"restores traditional Unix syntax, where option parsing stops with the first "
1938
1938
"non-option argument."
1939
1939
msgstr ""
1940
+ "要禁用此特性,则调用 :meth:`disable_interspersed_args`。 这将恢复传统的 Unix "
1941
+ "语法,其中选项解析会在第一个非选项参数处停止。"
1940
1942
1941
1943
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1383
1942
1944
msgid ""
1943
1945
"Use this if you have a command processor which runs another command which "
1944
1946
"has options of its own and you want to make sure these options don't get "
1945
1947
"confused. For example, each command might have a different set of options."
1946
1948
msgstr ""
1949
+ "如果你用一个命令处理程序来运行另一个拥有它自己的选项的命令而你希望参确保这些选项不会被混淆就可以使用此方法。 例如,每个命令可能具有不同的选项集合。"
1947
1950
1948
1951
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1389
1949
1952
msgid ""
1950
1953
"Set parsing to not stop on the first non-option, allowing interspersing "
1951
1954
"switches with command arguments. This is the default behavior."
1952
- msgstr ""
1955
+ msgstr "设置解析不在第一个非选项处停止,允许多个命令行参数的插入相互切换。 这是默认的行为。 "
1953
1956
1954
1957
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1394
1955
1958
msgid ""
1956
1959
"Returns the Option instance with the option string *opt_str*, or ``None`` if"
1957
1960
" no options have that option string."
1958
- msgstr ""
1961
+ msgstr "返回具有选项字符串 *opt_str* 的的 Option 实例,或者如果不存在具有该选项字符串的选项则返回 ``None``。 "
1959
1962
1960
1963
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1399
1961
1964
msgid ""
1962
1965
"Return ``True`` if the OptionParser has an option with option string "
1963
1966
"*opt_str* (e.g., ``-q`` or ``--verbose``)."
1964
1967
msgstr ""
1968
+ "如果 OptionParser 包含一个具有选项字符串 *opt_str* 的选项 (例如 ``-q`` 或 ``--verbose``) 则返回 "
1969
+ "``True``。"
1965
1970
1966
1971
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1404
1967
1972
msgid ""
@@ -1970,22 +1975,25 @@ msgid ""
1970
1975
" those option strings become invalid. If *opt_str* does not occur in any "
1971
1976
"option belonging to this :class:`OptionParser`, raises :exc:`ValueError`."
1972
1977
msgstr ""
1978
+ "如果 :class:`OptionParser` 包含一个对应于 *opt_str* 的选项,则移除该选项。 "
1979
+ "如果该选项提供了任何其他选项字符串,这些选项字符串将全部不可用。 如果 *opt_str* 不存在于任何属于此 "
1980
+ ":class:`OptionParser` 的选项之中,则会引发 :exc:`ValueError`。"
1973
1981
1974
1982
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1413
1975
1983
msgid "Conflicts between options"
1976
- msgstr ""
1984
+ msgstr "选项之间的冲突 "
1977
1985
1978
1986
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1415
1979
1987
msgid ""
1980
1988
"If you're not careful, it's easy to define options with conflicting option "
1981
1989
"strings::"
1982
- msgstr ""
1990
+ msgstr "如果你不够小心,很容易会定义具有相互冲突的选项字符串的多个选项:: "
1983
1991
1984
1992
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1422
1985
1993
msgid ""
1986
1994
"(This is particularly true if you've defined your own OptionParser subclass "
1987
1995
"with some standard options.)"
1988
- msgstr ""
1996
+ msgstr "(当你自定义具有某些标准选项的 OptionParser 时特别容易发生这种情况。) "
1989
1997
1990
1998
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1425
1991
1999
msgid ""
@@ -1994,14 +2002,16 @@ msgid ""
1994
2002
" mechanism. You can set the conflict-handling mechanism either in the "
1995
2003
"constructor::"
1996
2004
msgstr ""
2005
+ "每当你添加一个选项时,:mod:`optparse` 会检查它是否与现有选项冲突。 如果发现存在冲突,它将发起调用当前的冲突处理机制。 "
2006
+ "你可以选择在构造器中设置冲突处理机制::"
1997
2007
1998
2008
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1431
1999
2009
msgid "or with a separate call::"
2000
- msgstr ""
2010
+ msgstr "或是在单独调用中设置:: "
2001
2011
2002
2012
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1435
2003
2013
msgid "The available conflict handlers are:"
2004
- msgstr ""
2014
+ msgstr "可用的冲突处理句柄有: "
2005
2015
2006
2016
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1439
2007
2017
msgid "``\" error\" `` (default)"
@@ -2011,21 +2021,21 @@ msgstr "``\"error\"`` (默认)"
2011
2021
msgid ""
2012
2022
"assume option conflicts are a programming error and raise "
2013
2023
":exc:`OptionConflictError`"
2014
- msgstr ""
2024
+ msgstr "将选项冲突视为编程错误并引发 :exc:`OptionConflictError` "
2015
2025
2016
2026
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1443
2017
2027
msgid "``\" resolve\" ``"
2018
2028
msgstr "``\" resolve\" ``"
2019
2029
2020
2030
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1442
2021
2031
msgid "resolve option conflicts intelligently (see below)"
2022
- msgstr ""
2032
+ msgstr "智能地解决选项冲突(见下文) "
2023
2033
2024
2034
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1445
2025
2035
msgid ""
2026
2036
"As an example, let's define an :class:`OptionParser` that resolves conflicts"
2027
2037
" intelligently and add conflicting options to it::"
2028
- msgstr ""
2038
+ msgstr "举例来说,让我们定义一个智能地解决冲突的 :class:`OptionParser` 并向其添加相互冲突的选项:: "
2029
2039
2030
2040
#: /home/runner/work/docspush-transifex/docspush-transifex/cpython/Doc/library/optparse.rst:1452
2031
2041
msgid ""