-
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathpty.po
More file actions
211 lines (188 loc) · 7.53 KB
/
Copy pathpty.po
File metadata and controls
211 lines (188 loc) · 7.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
# SOME DESCRIPTIVE TITLE.
# Copyright (C) 2001 Python Software Foundation
# This file is distributed under the same license as the Python package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
# Translators:
# python-doc bot, 2025
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Python 3.15\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-09-11 17:24+0000\n"
"PO-Revision-Date: 2025-09-16 00:01+0000\n"
"Last-Translator: python-doc bot, 2025\n"
"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/"
"ja/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: ../../library/pty.rst:2
msgid ":mod:`!pty` --- Pseudo-terminal utilities"
msgstr ":mod:`!pty` --- 擬似端末ユーティリティ"
#: ../../library/pty.rst:7
msgid "**Source code:** :source:`Lib/pty.py`"
msgstr "**ソースコード:** :source:`Lib/pty.py`"
#: ../../library/pty.rst:11
msgid ""
"The :mod:`!pty` module defines operations for handling the pseudo-terminal "
"concept: starting another process and being able to write to and read from "
"its controlling terminal programmatically."
msgstr ""
#: ../../library/pty.rst:15
msgid "Availability"
msgstr ""
#: ../../library/pty.rst:17
msgid ""
"Pseudo-terminal handling is highly platform dependent. This code is mainly "
"tested on Linux, FreeBSD, and macOS (it is supposed to work on other POSIX "
"platforms but it's not been thoroughly tested)."
msgstr ""
#: ../../library/pty.rst:21
msgid "The :mod:`!pty` module defines the following functions:"
msgstr ""
#: ../../library/pty.rst:26
msgid ""
"Fork. Connect the child's controlling terminal to a pseudo-terminal. Return "
"value is ``(pid, fd)``. Note that the child gets *pid* 0, and the *fd* is "
"*invalid*. The parent's return value is the *pid* of the child, and *fd* is "
"a file descriptor connected to the child's controlling terminal (and also to "
"the child's standard input and output)."
msgstr ""
"forkします。子プロセスの制御端末を擬似端末に接続します。返り値は ``(pid, "
"fd)`` です。子プロセスは *pid* として0、*fd* として *invalid* をそれぞれ受け"
"とります。親プロセスは *pid* として子プロセスのPID、*fd* として子プロセスの制"
"御端末 (子プロセスの標準入出力に接続されている)のファイル記述子を受けとりま"
"す。"
#: ../../library/pty.rst:32
msgid ""
"The returned file descriptor *fd* is :ref:`non-inheritable <fd_inheritance>`."
msgstr ""
#: ../../library/pty.rst:34
msgid ""
"On macOS the use of this function is unsafe when mixed with using higher-"
"level system APIs, and that includes using :mod:`urllib.request`."
msgstr ""
#: ../../library/pty.rst:37
msgid "The returned file descriptor is now made non-inheritable."
msgstr ""
#: ../../library/pty.rst:43
msgid ""
"Open a new pseudo-terminal pair, using :func:`os.openpty` if possible, or "
"emulation code for generic Unix systems. Return a pair of file descriptors "
"``(master, slave)``, for the master and the slave end, respectively."
msgstr ""
"新しい擬似端末のペアを開きます。利用できるなら :func:`os.openpty` を使い、利"
"用できなければ一般的なUnixシステム用のエミュレーションコードを使います。マス"
"ター、スレーブそれぞれのためのファイル記述子、 ``(master, slave)`` のタプルを"
"返します。"
#: ../../library/pty.rst:50
msgid ""
"Spawn a process, and connect its controlling terminal with the current "
"process's standard io. This is often used to baffle programs which insist on "
"reading from the controlling terminal. It is expected that the process "
"spawned behind the pty will eventually terminate, and when it does *spawn* "
"will return."
msgstr ""
#: ../../library/pty.rst:56
msgid ""
"A loop copies STDIN of the current process to the child and data received "
"from the child to STDOUT of the current process. It is not signaled to the "
"child if STDIN of the current process closes down."
msgstr ""
#: ../../library/pty.rst:60
msgid ""
"The functions *master_read* and *stdin_read* are passed a file descriptor "
"which they should read from, and they should always return a byte string. In "
"order to force spawn to return before the child process exits an empty byte "
"array should be returned to signal end of file."
msgstr ""
#: ../../library/pty.rst:65
msgid ""
"The default implementation for both functions will read and return up to "
"1024 bytes each time the function is called. The *master_read* callback is "
"passed the pseudoterminal’s master file descriptor to read output from the "
"child process, and *stdin_read* is passed file descriptor 0, to read from "
"the parent process's standard input."
msgstr ""
#: ../../library/pty.rst:71
msgid ""
"Returning an empty byte string from either callback is interpreted as an end-"
"of-file (EOF) condition, and that callback will not be called after that. If "
"*stdin_read* signals EOF the controlling terminal can no longer communicate "
"with the parent process OR the child process. Unless the child process will "
"quit without any input, *spawn* will then loop forever. If *master_read* "
"signals EOF the same behavior results (on linux at least)."
msgstr ""
#: ../../library/pty.rst:78
msgid ""
"Return the exit status value from :func:`os.waitpid` on the child process."
msgstr ""
#: ../../library/pty.rst:80
msgid ""
":func:`os.waitstatus_to_exitcode` can be used to convert the exit status "
"into an exit code."
msgstr ""
#: ../../library/pty.rst:83
msgid ""
"Raises an :ref:`auditing event <auditing>` ``pty.spawn`` with argument "
"``argv``."
msgstr ""
"引数 ``argv`` を指定して :ref:`監査イベント <auditing>` ``pty.spawn`` を送出"
"します。 "
#: ../../library/pty.rst:85
msgid ""
":func:`spawn` now returns the status value from :func:`os.waitpid` on the "
"child process."
msgstr ""
":func:`spawn` が :func:`os.waitpid` が返す子プロセスのステータス値を返すよう"
"になりました。"
#: ../../library/pty.rst:90
msgid "Example"
msgstr "使用例"
#: ../../library/pty.rst:92
msgid ""
"The following program acts like the Unix command :manpage:`script(1)`, using "
"a pseudo-terminal to record all input and output of a terminal session in a "
"\"typescript\". ::"
msgstr ""
"下記のプログラムは Unix コマンド :manpage:`script(1)` のように動作します。疑"
"似端末を使用して、端末セッションのすべての入出力を \"typescript\" に記録しま"
"す。 ::"
#: ../../library/pty.rst:96
msgid ""
"import argparse\n"
"import os\n"
"import pty\n"
"import sys\n"
"import time\n"
"\n"
"parser = argparse.ArgumentParser()\n"
"parser.add_argument('-a', dest='append', action='store_true')\n"
"parser.add_argument('-p', dest='use_python', action='store_true')\n"
"parser.add_argument('filename', nargs='?', default='typescript')\n"
"options = parser.parse_args()\n"
"\n"
"shell = sys.executable if options.use_python else os.environ.get('SHELL', "
"'sh')\n"
"filename = options.filename\n"
"mode = 'ab' if options.append else 'wb'\n"
"\n"
"with open(filename, mode) as script:\n"
" def read(fd):\n"
" data = os.read(fd, 1024)\n"
" script.write(data)\n"
" return data\n"
"\n"
" print('Script started, file is', filename)\n"
" script.write(('Script started on %s\\n' % time.asctime()).encode())\n"
"\n"
" pty.spawn(shell, read)\n"
"\n"
" script.write(('Script done on %s\\n' % time.asctime()).encode())\n"
" print('Script done, file is', filename)"
msgstr ""