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

Skip to content

Commit 55aa7b7

Browse files
[po] auto sync
1 parent 32a892b commit 55aa7b7

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

howto/curses.po

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@ msgid ""
727727
"called earlier. You can optionally specify a coordinate to which the cursor"
728728
" should be moved before pausing."
729729
msgstr ""
730+
":meth:`~curses.window.getch` 会刷新屏幕然后等待用户按键,如果之前调用过 :func:`~curses.echo` "
731+
"还会显示所按的键。 你还可以选择指定一个坐标以便在暂停之前让光标移动到那里。"
730732

731733
#: ../../howto/curses.rst:445
732734
msgid ""
@@ -735,6 +737,8 @@ msgid ""
735737
" special keys such as function keys return longer strings containing a key "
736738
"name such as ``KEY_UP`` or ``^G``."
737739
msgstr ""
740+
":meth:`~curses.window.getkey` 将做同样的事但是会把整数转换为字符串。 每个字符将返回为长度为 1 "
741+
"个字符的字符串,特殊键例如函数键将返回包含键名的较长字符串例如 ``KEY_UP`` 或 ``^G``。"
738742

739743
#: ../../howto/curses.rst:450
740744
msgid ""

library/contextlib.po

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ msgstr "这能清楚地表明, ``cm`` 作用于整个函数,而不仅仅是
332332
msgid ""
333333
"Existing context managers that already have a base class can be extended by "
334334
"using ``ContextDecorator`` as a mixin class::"
335-
msgstr ""
335+
msgstr "现有的上下文管理器即使已经有基类,也可以使用 ``ContextDecorator`` 作为混合类进行扩展:"
336336

337337
#: ../../library/contextlib.rst:346
338338
msgid ""
@@ -341,19 +341,21 @@ msgid ""
341341
"statements. If this is not the case, then the original construct with the "
342342
"explicit :keyword:`!with` statement inside the function should be used."
343343
msgstr ""
344+
"由于被装饰的函数必须能够被多次调用,因此对应的上下文管理器必须支持在多个 :keyword:`with` "
345+
"语句中使用。如果不是这样,则应当使用原来的具有显式 :keyword:`!with` 语句的形式使用该上下文管理器。"
344346

345347
#: ../../library/contextlib.rst:356
346348
msgid ""
347349
"A context manager that is designed to make it easy to programmatically "
348350
"combine other context managers and cleanup functions, especially those that "
349351
"are optional or otherwise driven by input data."
350-
msgstr ""
352+
msgstr "该上下文管理器的设计目标是使得在编码中组合其他上下文管理器和清理函数更加容易,尤其是那些可选的或由输入数据驱动的上下文管理器。"
351353

352354
#: ../../library/contextlib.rst:360
353355
msgid ""
354356
"For example, a set of files may easily be handled in a single with statement"
355357
" as follows::"
356-
msgstr ""
358+
msgstr "例如,通过一个如下的 with 语句可以很容易处理一组文件:"
357359

358360
#: ../../library/contextlib.rst:369
359361
msgid ""
@@ -362,13 +364,15 @@ msgid ""
362364
"at the end of a :keyword:`with` statement). Note that callbacks are *not* "
363365
"invoked implicitly when the context stack instance is garbage collected."
364366
msgstr ""
367+
"每个实例维护一个注册了一组回调的栈,这些回调在实例关闭时以相反的顺序被调用(显式或隐式地在 :keyword:`with` "
368+
"语句的末尾)。请注意,当一个栈实例被垃圾回收时,这些回调将 *不会* 被隐式调用。"
365369

366370
#: ../../library/contextlib.rst:374
367371
msgid ""
368372
"This stack model is used so that context managers that acquire their "
369373
"resources in their ``__init__`` method (such as file objects) can be handled"
370374
" correctly."
371-
msgstr ""
375+
msgstr "通过使用这个基于栈的模型,那些通过 ``__init__`` 方法获取资源的上下文管理器(如文件对象)能够被正确处理。"
372376

373377
#: ../../library/contextlib.rst:378
374378
msgid ""
@@ -379,6 +383,8 @@ msgid ""
379383
"exception, then outer callbacks will be passed arguments based on that "
380384
"updated state."
381385
msgstr ""
386+
"由于注册的回调函数是按照与注册相反的顺序调用的,因此最终的行为就像多个嵌套的 :keyword:`with` "
387+
"语句用在这些注册的回调函数上。这个行为甚至扩展到了异常处理:如果内部的回调函数抑制或替换了异常,则外部回调收到的参数是基于该更新后的状态得到的。"
382388

383389
#: ../../library/contextlib.rst:385
384390
msgid ""
@@ -387,6 +393,8 @@ msgid ""
387393
"foundation for higher level context managers that manipulate the exit stack "
388394
"in application specific ways."
389395
msgstr ""
396+
"这是一个相对底层的 "
397+
"API,它负责正确处理栈里回调退出时依次展开的细节。它为相对高层的上下文管理器提供了一个合适的基础,使得它能根据应用程序的需求使用特定方式操作栈。"
390398

391399
#: ../../library/contextlib.rst:394
392400
msgid ""

0 commit comments

Comments
 (0)