Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/library/nntplib.rst

    r2 r391  
    1010   pair: NNTP; protocol
    1111   single: Network News Transfer Protocol
     12
     13**Source code:** :source:`Lib/nntplib.py`
     14
     15--------------
    1216
    1317This module defines the class :class:`NNTP` which implements the client side of
     
    1923about a newsgroup and print the subjects of the last 10 articles::
    2024
    21    >>> s = NNTP('news.cwi.nl')
    22    >>> resp, count, first, last, name = s.group('comp.lang.python')
     25   >>> s = NNTP('news.gmane.org')
     26   >>> resp, count, first, last, name = s.group('gmane.comp.python.committers')
    2327   >>> print 'Group', name, 'has', count, 'articles, range', first, 'to', last
    24    Group comp.lang.python has 59 articles, range 3742 to 3803
     28   Group gmane.comp.python.committers has 1071 articles, range 1 to 1071
    2529   >>> resp, subs = s.xhdr('subject', first + '-' + last)
    2630   >>> for id, sub in subs[-10:]: print id, sub
    2731   ...
    28    3792 Re: Removing elements from a list while iterating...
    29    3793 Re: Who likes Info files?
    30    3794 Emacs and doc strings
    31    3795 a few questions about the Mac implementation
    32    3796 Re: executable python scripts
    33    3797 Re: executable python scripts
    34    3798 Re: a few questions about the Mac implementation
    35    3799 Re: PROPOSAL: A Generic Python Object Interface for Python C Modules
    36    3802 Re: executable python scripts
    37    3803 Re: \POSIX{} wait and SIGCHLD
     32   1062 Re: Mercurial Status?
     33   1063 Re: [python-committers]  (Windows) buildbots on 3.x
     34   1064 Re: Mercurial Status?
     35   1065 Re: Mercurial Status?
     36   1066 Python 2.6.6 status
     37   1067 Commit Privileges for Ask Solem
     38   1068 Re: Commit Privileges for Ask Solem
     39   1069 Re: Commit Privileges for Ask Solem
     40   1070 Re: Commit Privileges for Ask Solem
     41   1071 2.6.6 rc 2
    3842   >>> s.quit()
    39    '205 news.cwi.nl closing connection.  Goodbye.'
     43   '205 Bye!'
    4044
    4145To post an article from a file (this assumes that the article has valid
    42 headers)::
    43 
    44    >>> s = NNTP('news.cwi.nl')
    45    >>> f = open('/tmp/article')
     46headers, and that you have right to post on the particular newsgroup)::
     47
     48   >>> s = NNTP('news.gmane.org')
     49   >>> f = open('articlefile')
    4650   >>> s.post(f)
    4751   '240 Article posted successfully.'
    4852   >>> s.quit()
    49    '205 news.cwi.nl closing connection.  Goodbye.'
     53   '205 Bye!'
    5054
    5155The module itself defines the following items:
Note: See TracChangeset for help on using the changeset viewer.