Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fa09bc6

Browse files
[po] auto sync
1 parent 0cfbbb8 commit fa09bc6

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

library/argparse.po

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,12 +1020,15 @@ msgid ""
10201020
"``errors=`` arguments of the :func:`open` function. For example, "
10211021
"``FileType('w')`` can be used to create a writable file::"
10221022
msgstr ""
1023+
"为方便使用不同类型的文件,argparse 模块提供了 FileType 工厂类,该类接受 ``mode=``, ``bufsize=``, "
1024+
"``encoding=`` 和 ``errors=`` 等 :func:`open` 函数参数。 例如,``FileType('w')`` "
1025+
"可被用来创建一个可写文件::"
10231026

10241027
#: ../../library/argparse.rst:1046
10251028
msgid ""
10261029
"``type=`` can take any callable that takes a single string argument and "
10271030
"returns the converted value::"
1028-
msgstr ""
1031+
msgstr "``type=`` 可接受任意可调用对象,该对象应传入单个字符串参数并返回转换后的值::"
10291032

10301033
#: ../../library/argparse.rst:1065
10311034
msgid ""
@@ -1049,19 +1052,25 @@ msgid ""
10491052
"line is parsed, argument values will be checked, and an error message will "
10501053
"be displayed if the argument was not one of the acceptable values::"
10511054
msgstr ""
1055+
"某些命令行参数应当从一组受限值中选择。 这可通过将一个容器对象作为 *choices* 关键字参数传给 "
1056+
":meth:`~ArgumentParser.add_argument` 来处理。 "
1057+
"当执行命令行解析时,参数值将被检查,如果参数不是可接受的值之一就将显示错误消息::"
10521058

10531059
#: ../../library/argparse.rst:1097
10541060
msgid ""
10551061
"Note that inclusion in the *choices* container is checked after any type_ "
10561062
"conversions have been performed, so the type of the objects in the *choices*"
10571063
" container should match the type_ specified::"
10581064
msgstr ""
1065+
"请注意 *choices* 容器包含的内容会在执行任意 type_ 转换之后被检查,因此 *choices* 容器中对象的类型应当与指定的 type_ "
1066+
"相匹配::"
10591067

10601068
#: ../../library/argparse.rst:1109
10611069
msgid ""
10621070
"Any container can be passed as the *choices* value, so :class:`list` "
10631071
"objects, :class:`set` objects, and custom containers are all supported."
10641072
msgstr ""
1073+
"任何容器都可作为 *choices* 值传入,因此 :class:`list` 对象,:class:`set` 对象以及自定义容器都是受支持的。"
10651074

10661075
#: ../../library/argparse.rst:1114
10671076
msgid "required"
@@ -1074,19 +1083,24 @@ msgid ""
10741083
"command line. To make an option *required*, ``True`` can be specified for "
10751084
"the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::"
10761085
msgstr ""
1086+
"通常,:mod:`argparse` 模块会认为 ``-f`` 和 ``--bar`` 等旗标是指明 *可选的* 参数,它们总是可以在命令行中被忽略。 "
1087+
"要让一个选项成为 *必需的*,则可以将 ``True`` 作为 ``required=`` 关键字参数传给 "
1088+
":meth:`~ArgumentParser.add_argument`::"
10771089

10781090
#: ../../library/argparse.rst:1129
10791091
msgid ""
10801092
"As the example shows, if an option is marked as ``required``, "
10811093
":meth:`~ArgumentParser.parse_args` will report an error if that option is "
10821094
"not present at the command line."
10831095
msgstr ""
1096+
"如这个例子所示,如果一个选项被标记为 "
1097+
"``required``,则当该选项未在命令行中出现时,:meth:`~ArgumentParser.parse_args` 将会报告一个错误。"
10841098

10851099
#: ../../library/argparse.rst:1135
10861100
msgid ""
10871101
"Required options are generally considered bad form because users expect "
10881102
"*options* to be *optional*, and thus they should be avoided when possible."
1089-
msgstr ""
1103+
msgstr "必需的选项通常被认为是不适宜的,因为用户会预期 *options* 都是 *可选的*,因此在可能的情况下应当避免使用它们。"
10901104

10911105
#: ../../library/argparse.rst:1140
10921106
msgid "help"

0 commit comments

Comments
 (0)