Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(4)

Side by Side Diff: Doc/library/telnetlib.rst

Issue 18758: Fix internal references in the documentation
Patch Set: Created 6 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/stat.rst ('k') | Doc/library/_thread.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`telnetlib` --- Telnet client 1 :mod:`telnetlib` --- Telnet client
2 ================================== 2 ==================================
3 3
4 .. module:: telnetlib 4 .. module:: telnetlib
5 :synopsis: Telnet client class. 5 :synopsis: Telnet client class.
6 .. sectionauthor:: Skip Montanaro <skip@pobox.com> 6 .. sectionauthor:: Skip Montanaro <skip@pobox.com>
7 7
8 8
9 .. index:: single: protocol; Telnet 9 .. index:: single: protocol; Telnet
10 10
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 .. method:: Telnet.mt_interact() 178 .. method:: Telnet.mt_interact()
179 179
180 Multithreaded version of :meth:`interact`. 180 Multithreaded version of :meth:`interact`.
181 181
182 182
183 .. method:: Telnet.expect(list, timeout=None) 183 .. method:: Telnet.expect(list, timeout=None)
184 184
185 Read until one from a list of a regular expressions matches. 185 Read until one from a list of a regular expressions matches.
186 186
187 The first argument is a list of regular expressions, either compiled 187 The first argument is a list of regular expressions, either compiled
188 (:class:`re.RegexObject` instances) or uncompiled (byte strings). The 188 (:ref:`regex objects <re-objects>`) or uncompiled (byte strings). The
189 optional second argument is a timeout, in seconds; the default is to block 189 optional second argument is a timeout, in seconds; the default is to block
190 indefinitely. 190 indefinitely.
191 191
192 Return a tuple of three items: the index in the list of the first regular 192 Return a tuple of three items: the index in the list of the first regular
193 expression that matches; the match object returned; and the bytes read up 193 expression that matches; the match object returned; and the bytes read up
194 till and including the match. 194 till and including the match.
195 195
196 If end of file is found and no bytes were read, raise :exc:`EOFError`. 196 If end of file is found and no bytes were read, raise :exc:`EOFError`.
197 Otherwise, when nothing matches, return ``(-1, None, data)`` where *data* is 197 Otherwise, when nothing matches, return ``(-1, None, data)`` where *data* is
198 the bytes received so far (may be empty bytes if a timeout happened). 198 the bytes received so far (may be empty bytes if a timeout happened).
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 tn.write(user.encode('ascii') + b"\n") 232 tn.write(user.encode('ascii') + b"\n")
233 if password: 233 if password:
234 tn.read_until(b"Password: ") 234 tn.read_until(b"Password: ")
235 tn.write(password.encode('ascii') + b"\n") 235 tn.write(password.encode('ascii') + b"\n")
236 236
237 tn.write(b"ls\n") 237 tn.write(b"ls\n")
238 tn.write(b"exit\n") 238 tn.write(b"exit\n")
239 239
240 print(tn.read_all().decode('ascii')) 240 print(tn.read_all().decode('ascii'))
241 241
OLDNEW
« no previous file with comments | « Doc/library/stat.rst ('k') | Doc/library/_thread.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+