Package twisted :: Package protocols :: Module nntp :: Class UsenetClientProtocol

[show private | hide private]
[frames | no frames]

## Class UsenetClientProtocol

    BaseProtocol --+
                   |
            Protocol --+
                       |
            LineReceiver --+
                           |
                  NNTPClient --+
                               |
                              UsenetClientProtocol

A client that connects to an NNTP server and asks for articles new since a certain time.

Method Summary
| ``__init__`(self, groups, date, storage)` Fetch all new articles from the given groups since the given date and dump them into the given storage.
| `articleExists(self, exists, article)`
| ``connectionFailed`(self)` (Deprecated) (inherited from `Protocol`)
| ``connectionLost`(self, reason)` Called when the connection is shut down. (inherited from `Protocol`)
| ``connectionMade`(self)` Called when a connection is made.
| ``dataReceived`(self, data)` Protocol.dataReceived. (inherited from `LineReceiver`)
| ``fetchArticle`(self, index)` Get the complete article with the specified index (or the currently selected article if index is '') or Message-ID from the server. (inherited from `NNTPClient`)
| ``fetchBody`(self, index)` Get the body for the specified article (or the currently selected article if index is '') from the server. (inherited from `NNTPClient`)
| ``fetchGroup`(self, group)` Get group information for the specified group from the server. (inherited from `NNTPClient`)
| ``fetchGroups`(self)` Request a list of all news groups from the server. (inherited from `NNTPClient`)
| ``fetchHead`(self, index)` Get the header for the specified article (or the currently selected article if index is '') from the server. (inherited from `NNTPClient`)
| ``fetchNewGroups`(self, date, distributions)` Get the names of all new groups created/added to the server since the specified date - in seconds since the ecpoh, GMT - optionally restricted to the given distributions. (inherited from `NNTPClient`)
| ``fetchNewNews`(self, groups, date, distributions)` Get the Message-IDs for all new news posted to any of the given groups since the specified date - in seconds since the epoch, GMT - optionally restricted to the given distributions. (inherited from `NNTPClient`)
| ``fetchOverview`(self)` Request the overview format from the server. (inherited from `NNTPClient`)
| ``fetchSubscriptions`(self)` Request a list of the groups it is recommended a new user subscribe to. (inherited from `NNTPClient`)
| ``fetchXHeader`(self, header, low, high, id)` Request a specific header from the server for an article or range of articles. (inherited from `NNTPClient`)
| ``getAllGroupsFailed`(self, error)` Override for notification when fetchGroups() action fails (inherited from `NNTPClient`)
| ``getArticleFailed`(self, error)` Override for notification when fetchArticle() action fails (inherited from `NNTPClient`)
| ``getBodyFailed`(self, body)` Override for notification when fetchBody() action fails (inherited from `NNTPClient`)
| ``getGroupFailed`(self, error)` Override for notification when fetchGroup() action fails (inherited from `NNTPClient`)
| ``getHeadFailed`(self, error)` Override for notification when fetchHead() action fails (inherited from `NNTPClient`)
| ``getNewGroupsFailed`(self, error)` Override for notification when getNewGroups() action fails (inherited from `NNTPClient`)
| `getNewNewsFailed(self, reason)`
| ``getOverviewFailed`(self, error)` Override for notification when fetchOverview() action fails (inherited from `NNTPClient`)
| ``getSubscriptionsFailed`(self, error)` Override for notification when fetchSubscriptions() action fails (inherited from `NNTPClient`)
| ``getXHeaderFailed`(self, error)` Override for notification when getXHeader() action fails (inherited from `NNTPClient`)
| ``gotAllGroups`(self, groups)` Override for notification when fetchGroups() action is completed (inherited from `NNTPClient`)
| ``gotArticle`(self, article)` Override for notification when fetchArticle() action is completed
| ``gotBody`(self, info)` Override for notification when fetchBody() action is completed (inherited from `NNTPClient`)
| ``gotGroup`(self, group)` Override for notification when fetchGroup() action is completed (inherited from `NNTPClient`)
| ``gotHead`(self, head)` Override for notification when fetchHead() action is completed (inherited from `NNTPClient`)
| ``gotNewGroups`(self, groups)` Override for notification when getNewGroups() action is successful (inherited from `NNTPClient`)
| ``gotNewNews`(self, news)` Override for notification when getNewNews() action is successful
| ``gotOverview`(self, overview)` Override for notification when fetchOverview() action is completed (inherited from `NNTPClient`)
| ``gotSubscriptions`(self, subscriptions)` Override for notification when fetchSubscriptions() action is completed (inherited from `NNTPClient`)
| ``gotXHeader`(self, headers)` Override for notification when getXHeader() action is successful (inherited from `NNTPClient`)
| ``lineLengthExceeded`(self, line)` Called when the maximum line length has been reached. (inherited from `LineReceiver`)
| ``lineReceived`(self, line)` Override this for when each line is received. (inherited from `NNTPClient`)
| ``postArticle`(self, text)` Attempt to post an article with the specified text to the server. (inherited from `NNTPClient`)
| ``postedOk`(self)` Override for notification when postArticle() action is successful (inherited from `NNTPClient`)
| ``postFailed`(self, error)` Override for notification when postArticle() action fails (inherited from `NNTPClient`)
| `quit(self)` (inherited from `NNTPClient`)
| ``rawDataReceived`(self, data)` Override this for when raw data is received. (inherited from `LineReceiver`)
| ``sendLine`(self, line)` Sends a line to the other end of the connection. (inherited from `LineReceiver`)
| ``setLineMode`(self, extra)` Sets the line-mode of this receiver. (inherited from `LineReceiver`)
| ``setRawMode`(self)` Sets the raw mode of this receiver. (inherited from `LineReceiver`)
| ``setStream`(self)` Set the mode to STREAM, suspending the normal "lock-step" mode of communications. (inherited from `NNTPClient`)
| ``setStreamFailed`(self, error)` Override for notification when setStream() action fails (inherited from `NNTPClient`)
| ``setStreamSuccess`(self)` Override for notification when setStream() action is successful (inherited from `NNTPClient`)

Method Details

### __init__(self, groups, date, storage)
(Constructor)

Fetch all new articles from the given groups since the given date and dump them into the given storage. groups is a list of group names. date is an integer or floating point representing seconds since the epoch (GMT). storage is any object that implements the NewsStorage interface.

### connectionMade(self)

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.

  Overrides:
    `twisted.protocols.nntp.NNTPClient.connectionMade` (inherited documentation)

### gotArticle(self, article)

Override for notification when fetchArticle() action is completed

  Overrides:
    `twisted.protocols.nntp.NNTPClient.gotArticle` (inherited documentation)

### gotNewNews(self, news)

Override for notification when getNewNews() action is successful

  Overrides:
    `twisted.protocols.nntp.NNTPClient.gotNewNews` (inherited documentation)

Generated by Epydoc 1.1 on Thu May 8 13:16:45 2003 | http://epydoc.sf.net