webkit
2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
|
Public Member Functions | |
def | __init__ (self, planet, url) |
def | has_item (self, id_) |
def | get_item (self, id_) |
def | items (self, hidden=0, sorted=0) |
def | __iter__ (self) |
def | cache_read_entries (self) |
def | cache_basename (self) |
def | cache_write (self, sync=1) |
def | feed_information (self) |
def | update (self) |
def | update_info (self, feed) |
def | update_entries (self, entries) |
def | get_name (self, key) |
Public Member Functions inherited from cache.CachedInfo | |
def | __init__ (self, cache, id_, root=0) |
def | cache_key (self, key) |
def | cache_read (self) |
def | cache_write (self, sync=1) |
def | cache_clear (self, sync=1) |
def | has_key (self, key) |
def | key_type (self, key) |
def | set (self, key, value, cached=1) |
def | get (self, key) |
def | set_as_string (self, key, value, cached=1) |
def | get_as_string (self, key) |
def | set_as_date (self, key, value, cached=1) |
def | get_as_date (self, key) |
def | set_as_null (self, key, value, cached=1) |
def | get_as_null (self, key) |
def | del_key (self, key) |
def | keys (self) |
def | __iter__ (self) |
def | __setattr__ (self, key, value) |
def | __getattr__ (self, key) |
Public Attributes | |
url | |
configured_url | |
url_etag | |
url_status | |
url_modified | |
name | |
updated | |
last_updated | |
filter | |
exclude | |
next_order | |
Static Public Attributes | |
IGNORE_KEYS | |
Static Public Attributes inherited from cache.CachedInfo | |
STRING | |
DATE | |
NULL | |
A list of news items. This class represents a list of news items taken from the feed of a website or other source. Properties: url URL of the feed. url_etag E-Tag of the feed URL. url_modified Last modified time of the feed URL. url_status Last HTTP status of the feed URL. hidden Channel should be hidden (True if exists). name Name of the feed owner, or feed title. next_order Next order number to be assigned to NewsItem updated Correct UTC-Normalised update time of the feed. last_updated Correct UTC-Normalised time the feed was last updated. id An identifier the feed claims is unique (*). title One-line title (*). link Link to the original format feed (*). tagline Short description of the feed (*). info Longer description of the feed (*). modified Date the feed claims to have been modified (*). author Name of the author (*). publisher Name of the publisher (*). generator Name of the feed generator (*). category Category name (*). copyright Copyright information for humans to read (*). license Link to the licence for the content (*). docs Link to the specification of the feed format (*). language Primary language (*). errorreportsto E-Mail address to send error reports to (*). image_url URL of an associated image (*). image_link Link to go with the associated image (*). image_title Alternative text of the associated image (*). image_width Width of the associated image (*). image_height Height of the associated image (*). filter A regular expression that articles must match. exclude A regular expression that articles must not match. Properties marked (*) will only be present if the original feed contained them. Note that the optional 'modified' date field is simply a claim made by the item and parsed from the information given, 'updated' (and 'last_updated') are far more reliable sources of information. Some feeds may define additional properties to those above.
def planet.Channel.__init__ | ( | self, | |
planet, | |||
url | |||
) |
def planet.Channel.__iter__ | ( | self | ) |
Iterate the sorted item list.
def planet.Channel.cache_basename | ( | self | ) |
def planet.Channel.cache_read_entries | ( | self | ) |
Read entry information from the cache.
def planet.Channel.cache_write | ( | self, | |
sync = 1 |
|||
) |
Write channel and item information to the cache.
def planet.Channel.feed_information | ( | self | ) |
Returns a description string for the feed embedded in this channel. This will usually simply be the feed url embedded in <>, but in the case where the current self.url has changed from the original self.configured_url the string will contain both pieces of information. This is so that the URL in question is easier to find in logging output: getting an error about a URL that doesn't appear in your config file is annoying.
def planet.Channel.get_item | ( | self, | |
id_ | |||
) |
Return the item from the channel.
def planet.Channel.get_name | ( | self, | |
key | |||
) |
Return the key containing the name.
def planet.Channel.has_item | ( | self, | |
id_ | |||
) |
Check whether the item exists in the channel.
def planet.Channel.items | ( | self, | |
hidden = 0 , |
|||
sorted = 0 |
|||
) |
Return the item list.
def planet.Channel.update | ( | self | ) |
Download the feed to refresh the information. This does the actual work of pulling down the feed and if it changes updates the cached information about the feed and entries within it.
def planet.Channel.update_entries | ( | self, | |
entries | |||
) |
Update entries from the feed. This reads the entries supplied by feedparser and updates the cached information about them. It's at this point we update the 'updated' timestamp and keep the old one in 'last_updated', these provide boundaries for acceptable entry times. If this is the first time a feed has been updated then most of the items will be marked as hidden, according to Planet.new_feed_items. If the feed does not contain items which, according to the sort order, should be there; those items are assumed to have been expired from the feed or replaced and are removed from the cache.
def planet.Channel.update_info | ( | self, | |
feed | |||
) |
Update information from the feed. This reads the feed information supplied by feedparser and updates the cached information about the feed. These are the various potentially interesting properties that you might care about.
planet.Channel.configured_url |
planet.Channel.exclude |
planet.Channel.filter |
|
static |
planet.Channel.last_updated |
planet.Channel.name |
planet.Channel.next_order |
planet.Channel.updated |
planet.Channel.url |
planet.Channel.url_etag |
planet.Channel.url_modified |
planet.Channel.url_status |