7
7
msgstr ""
8
8
"Project-Id-Version : Python 2.7\n "
9
9
"Report-Msgid-Bugs-To : \n "
10
- "POT-Creation-Date : 2018-01-21 01:52 +0900\n "
11
- "PO-Revision-Date : 2018-01-20 20:59 +0000\n "
10
+ "POT-Creation-Date : 2018-07-24 13:56 +0900\n "
11
+ "PO-Revision-Date : 2018-07-24 05:02 +0000\n "
12
12
"Last-Translator : tomo🐧\n "
13
13
"Language-Team : Japanese (http://www.transifex.com/python-doc/python-27/language/ja/)\n "
14
14
"MIME-Version : 1.0\n "
@@ -46,18 +46,26 @@ msgstr "この関数は :keyword:`with` 文コンテキストマネージャの
46
46
47
47
#: ../../library/contextlib.rst:27
48
48
msgid ""
49
- "A simple example (this is not recommended as a real way of generating "
50
- "HTML!)::"
51
- msgstr "簡単な例(実際に HTML を生成する方法としてはお勧めできません!)::"
49
+ "While many objects natively support use in with statements, sometimes a "
50
+ "resource needs to be managed that isn't a context manager in its own right, "
51
+ "and doesn't implement a ``close()`` method for use with "
52
+ "``contextlib.closing``"
53
+ msgstr ""
54
+
55
+ #: ../../library/contextlib.rst:31
56
+ msgid ""
57
+ "An abstract example would be the following to ensure correct resource "
58
+ "management::"
59
+ msgstr ""
52
60
53
- #: ../../library/contextlib.rst:44
61
+ #: ../../library/contextlib.rst:50
54
62
msgid ""
55
63
"The function being decorated must return a :term:`generator`-iterator when "
56
64
"called. This iterator must yield exactly one value, which will be bound to "
57
65
"the targets in the :keyword:`with` statement's :keyword:`as` clause, if any."
58
66
msgstr "デコレート対象の関数は呼び出されたときに :term:`ジェネレータ <generator>`-イテレータを返す必要があります。このイテレータは必ず値を1つ yield しなければなりません。 :keyword:`with` 文の :keyword:`as` 節が存在するなら、その値は as 節のターゲットへ束縛されることになります。"
59
67
60
- #: ../../library/contextlib.rst:48
68
+ #: ../../library/contextlib.rst:54
61
69
msgid ""
62
70
"At the point where the generator yields, the block nested in the "
63
71
":keyword:`with` statement is executed. The generator is then resumed after "
@@ -73,25 +81,25 @@ msgid ""
73
81
"the :keyword:`with` statement."
74
82
msgstr "ジェネレータが yield を実行した箇所で :keyword:`with` 文のネストされたブロックが実行されます。ブロックから抜けた後でジェネレータは再開されます。ブロック内で処理されない例外が発生した場合は、ジェネレータ内部の yield を実行した箇所で例外が再送出されます。なので、(もしあれば) エラーを捕捉したり、クリーンアップ処理を確実に実行したりするために、:keyword:`try`...\\ :keyword:`except`...\\ :keyword:`finally` 構文を使用できます。例外を捕捉する目的が、(完全に例外を抑制してしまうのではなく) 単に例外のログをとるため、もしくはあるアクションを実行するためなら、ジェネレータはその例外を再送出しなければなりません。例外を再送出しない場合、ジェネレータのコンテキストマネージャは :keyword:`with` 文に対して例外が処理されたことを示し、:keyword:`with` 文の直後の文から実行を再開します。"
75
83
76
- #: ../../library/contextlib.rst:63
84
+ #: ../../library/contextlib.rst:69
77
85
msgid ""
78
86
"Combine multiple context managers into a single nested context manager."
79
87
msgstr "複数のコンテキストマネージャを一つのネストされたコンテキストマネージャへ結合します。"
80
88
81
- #: ../../library/contextlib.rst:65
89
+ #: ../../library/contextlib.rst:71
82
90
msgid ""
83
91
"This function has been deprecated in favour of the multiple manager form of "
84
92
"the :keyword:`with` statement."
85
93
msgstr "この関数は、 :keyword:`with` 文にマルチマネージャー形式ができたために非推奨になりました。"
86
94
87
- #: ../../library/contextlib.rst:68
95
+ #: ../../library/contextlib.rst:74
88
96
msgid ""
89
97
"The one advantage of this function over the multiple manager form of the "
90
98
":keyword:`with` statement is that argument unpacking allows it to be used "
91
99
"with a variable number of context managers as follows::"
92
100
msgstr "この関数の :keyword:`with` 文のマルチマネージャー形式に対する唯一の利点は、引数のアンパックによって、次の例のように可変数個のコンテキストマネージャーを扱えることです。 ::"
93
101
94
- #: ../../library/contextlib.rst:77
102
+ #: ../../library/contextlib.rst:83
95
103
msgid ""
96
104
"Note that if the :meth:`__exit__` method of one of the nested context "
97
105
"managers indicates an exception should be suppressed, no exception "
@@ -104,7 +112,7 @@ msgid ""
104
112
"exception."
105
113
msgstr "ネストされたコンテキストマネージャのうちのいずれかの :meth:`__exit__` メソッドが例外を抑制すべきと判断した場合、外側にある残りのすべてのコンテキストマネージャに例外情報が渡されないということに注意してください。同様に、ネストされたコンテキストマネージャのうちのいずれかの :meth:`__exit__` メソッドが例外を送出したならば、それ以前の例外状態は失われ、新しい例外が外側にある残りのすべてのコンテキストマネージャの :meth:`__exit__` メソッドに渡されます。一般的に :meth:`__exit__` メソッドが例外を送出することは避けるべきであり、特に渡された例外を再送出すべきではありません。"
106
114
107
- #: ../../library/contextlib.rst:86
115
+ #: ../../library/contextlib.rst:92
108
116
msgid ""
109
117
"This function has two major quirks that have led to it being deprecated. "
110
118
"Firstly, as the context managers are all constructed before the function is "
@@ -115,7 +123,7 @@ msgid ""
115
123
"if an exception is thrown when opening the second file."
116
124
msgstr "この関数が非推奨になった理由に、2つの大きな問題があります。 1つ目は、全てのコンテキストマネージャーが関数が呼び出される前に構築されることです。内側のコンテキストマネージャーの :meth:`__new__` と :meth:`__init__` メソッドは外側のコンテキストマネージャーの内側に入っていません。つまり、例えば :func:`nested` を2つのファイルを開くために利用した場合、 2つめのファイルを開くのに失敗すると1つめのファイルが正しく close されないというプログラムエラーになります。"
117
125
118
- #: ../../library/contextlib.rst:94
126
+ #: ../../library/contextlib.rst:100
119
127
msgid ""
120
128
"Secondly, if the :meth:`__enter__` method of one of the inner context "
121
129
"managers raises an exception that is caught and suppressed by the "
@@ -124,41 +132,41 @@ msgid ""
124
132
":keyword:`with` statement."
125
133
msgstr "2つ目の問題は、内側のコンテキストマネージャーの1つの :meth:`__enter__` メソッドが例外を発生させたときに、外側のコンテキストマネージャーの :meth:`__exit__` メソッドがその例外を捕まえて抑制させてしまうことで、この場合に :keyword:`with` の body 部分の実行がスキップされるのではなく :exc:`RuntimeError` が発生する恐れがあります。"
126
134
127
- #: ../../library/contextlib.rst:100
135
+ #: ../../library/contextlib.rst:106
128
136
msgid ""
129
137
"Developers that need to support nesting of a variable number of context "
130
138
"managers can either use the :mod:`warnings` module to suppress the "
131
139
"DeprecationWarning raised by this function or else use this function as a "
132
140
"model for an application specific implementation."
133
141
msgstr "可変数個のコンテキストマネージャーのネストをサポートしなければならない場合、 :mod:`warnings` モジュールを利用してこの関数が発生させる DeprecationWarning を抑制するか、この関数を参考にしてアプリケーション独自の実装をすることができます。"
134
142
135
- #: ../../library/contextlib.rst:105
143
+ #: ../../library/contextlib.rst:111
136
144
msgid ""
137
145
"The with-statement now supports this functionality directly (without the "
138
146
"confusing error prone quirks)."
139
147
msgstr "with 文がこの関数の機能を(この関数と違って奇妙なエラーを発生させることなしに) 直接サポートしました。"
140
148
141
- #: ../../library/contextlib.rst:111
149
+ #: ../../library/contextlib.rst:117
142
150
msgid ""
143
151
"Return a context manager that closes *thing* upon completion of the block. "
144
152
"This is basically equivalent to::"
145
153
msgstr "ブロックの完了時に *thing* を close するコンテキストマネージャを返します。これは基本的に以下と等価です::"
146
154
147
- #: ../../library/contextlib.rst:123
155
+ #: ../../library/contextlib.rst:129
148
156
msgid "And lets you write code like this::"
149
157
msgstr "そして、明示的に ``page`` を close する必要なしに、次のように書くことができます::"
150
158
151
- #: ../../library/contextlib.rst:132
159
+ #: ../../library/contextlib.rst:138
152
160
msgid ""
153
161
"without needing to explicitly close ``page``. Even if an error occurs, "
154
162
"``page.close()`` will be called when the :keyword:`with` block is exited."
155
163
msgstr "``page`` を明示的に close する必要は無く、エラーが発生した場合でも、 :keyword:`with` ブロックを出るときに ``page.close()`` が呼ばれます。"
156
164
157
- #: ../../library/contextlib.rst:139
165
+ #: ../../library/contextlib.rst:145
158
166
msgid ":pep:`343` - The \" with\" statement"
159
167
msgstr ":pep:`343` - \" with\" ステートメント"
160
168
161
- #: ../../library/contextlib.rst:139
169
+ #: ../../library/contextlib.rst:145
162
170
msgid ""
163
171
"The specification, background, and examples for the Python :keyword:`with` "
164
172
"statement."
0 commit comments