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

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

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 10 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/multiprocessing.rst ('k') | Doc/library/os.path.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 1
2 :mod:`nntplib` --- NNTP protocol client 2 :mod:`nntplib` --- NNTP protocol client
3 ======================================= 3 =======================================
4 4
5 .. module:: nntplib 5 .. module:: nntplib
6 :synopsis: NNTP protocol client (requires sockets). 6 :synopsis: NNTP protocol client (requires sockets).
7 7
8 8
9 .. index:: 9 .. index::
10 pair: NNTP; protocol 10 pair: NNTP; protocol
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 flag *readermode* is true, then a ``mode reader`` command is sent before 68 flag *readermode* is true, then a ``mode reader`` command is sent before
69 authentication is performed. Reader mode is sometimes necessary if you are 69 authentication is performed. Reader mode is sometimes necessary if you are
70 connecting to an NNTP server on the local machine and intend to call 70 connecting to an NNTP server on the local machine and intend to call
71 reader-specific commands, such as ``group``. If you get unexpected 71 reader-specific commands, such as ``group``. If you get unexpected
72 :exc:`NNTPPermanentError`\ s, you might need to set *readermode*. 72 :exc:`NNTPPermanentError`\ s, you might need to set *readermode*.
73 :class:`NNTP` class supports the :keyword:`with` statement to 73 :class:`NNTP` class supports the :keyword:`with` statement to
74 unconditionally consume :exc:`socket.error` exceptions and to close the NNTP 74 unconditionally consume :exc:`socket.error` exceptions and to close the NNTP
75 connection when done. Here is a sample on how using it: 75 connection when done. Here is a sample on how using it:
76 76
77 >>> from nntplib import NNTP 77 >>> from nntplib import NNTP
78 >>> with NNTP('news.gmane.org') as n: 78 >>> with nntplib.NNTP('news.gmane.org') as n:
79 ... n.group('gmane.comp.python.committers') 79 ... n.group('gmane.comp.python.committers')
80 ... 80 ...
81 ('211 1755 1 1755 gmane.comp.python.committers', 1755, 1, 1755, 'gmane.comp. python.committers') 81 ('211 1454 1 1454 gmane.comp.python.committers', '1454', '1', '1454', 'gmane .comp.python.committers')
82 >>> 82 >>>
83 83
84 84
85 .. versionchanged:: 3.2 85 .. versionchanged:: 3.2
86 *usenetrc* is now False by default. 86 *usenetrc* is now False by default.
87 87
88 .. versionchanged:: 3.3 88 .. versionchanged:: 3.3
89 Support for the :keyword:`with` statement was added. 89 Support for the :keyword:`with` statement was added.
90 90
91 .. class:: NNTP_SSL(host, port=563, user=None, password=None, ssl_context=None, readermode=None, usenetrc=False, [timeout]) 91 .. class:: NNTP_SSL(host, port=563, user=None, password=None, ssl_context=None, readermode=None, usenetrc=False, [timeout])
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 400
401 .. method:: NNTP.last() 401 .. method:: NNTP.last()
402 402
403 Send a ``LAST`` command. Return as for :meth:`stat`. 403 Send a ``LAST`` command. Return as for :meth:`stat`.
404 404
405 405
406 .. method:: NNTP.article(message_spec=None, *, file=None) 406 .. method:: NNTP.article(message_spec=None, *, file=None)
407 407
408 Send an ``ARTICLE`` command, where *message_spec* has the same meaning as 408 Send an ``ARTICLE`` command, where *message_spec* has the same meaning as
409 for :meth:`stat`. Return a tuple ``(response, info)`` where *info* 409 for :meth:`stat`. Return a tuple ``(response, info)`` where *info*
410 is a :class:`~collections.namedtuple` with three attributes *number*, 410 is a :class:`~collections.namedtuple` with three members *number*,
411 *message_id* and *lines* (in that order). *number* is the article number 411 *message_id* and *lines* (in that order). *number* is the article number
412 in the group (or 0 if the information is not available), *message_id* the 412 in the group (or 0 if the information is not available), *message_id* the
413 message id as a string, and *lines* a list of lines (without terminating 413 message id as a string, and *lines* a list of lines (without terminating
414 newlines) comprising the raw message including headers and body. 414 newlines) comprising the raw message including headers and body.
415 415
416 >>> resp, info = s.article('<20030112190404.GE29873@epoch.metaslash.com>') 416 >>> resp, info = s.article('<20030112190404.GE29873@epoch.metaslash.com>')
417 >>> info.number 417 >>> info.number
418 0 418 0
419 >>> info.message_id 419 >>> info.message_id
420 '<20030112190404.GE29873@epoch.metaslash.com>' 420 '<20030112190404.GE29873@epoch.metaslash.com>'
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 *header_str* must be a :class:`str` object. The unescaped value is 547 *header_str* must be a :class:`str` object. The unescaped value is
548 returned. Using this function is recommended to display some headers 548 returned. Using this function is recommended to display some headers
549 in a human readable form:: 549 in a human readable form::
550 550
551 >>> decode_header("Some subject") 551 >>> decode_header("Some subject")
552 'Some subject' 552 'Some subject'
553 >>> decode_header("=?ISO-8859-15?Q?D=E9buter_en_Python?=") 553 >>> decode_header("=?ISO-8859-15?Q?D=E9buter_en_Python?=")
554 'Débuter en Python' 554 'Débuter en Python'
555 >>> decode_header("Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=") 555 >>> decode_header("Re: =?UTF-8?B?cHJvYmzDqG1lIGRlIG1hdHJpY2U=?=")
556 'Re: problème de matrice' 556 'Re: problème de matrice'
OLDNEW
« no previous file with comments | « Doc/library/multiprocessing.rst ('k') | Doc/library/os.path.rst » ('j') | no next file with comments »

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