webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
planet.Channel Class Reference
Inheritance diagram for planet.Channel:
cache.CachedInfo

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ __init__()

def planet.Channel.__init__ (   self,
  planet,
  url 
)

Member Function Documentation

◆ __iter__()

def planet.Channel.__iter__ (   self)
Iterate the sorted item list.

◆ cache_basename()

def planet.Channel.cache_basename (   self)

◆ cache_read_entries()

def planet.Channel.cache_read_entries (   self)
Read entry information from the cache.

◆ cache_write()

def planet.Channel.cache_write (   self,
  sync = 1 
)
Write channel and item information to the cache.

◆ feed_information()

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.

◆ get_item()

def planet.Channel.get_item (   self,
  id_ 
)
Return the item from the channel.

◆ get_name()

def planet.Channel.get_name (   self,
  key 
)
Return the key containing the name.

◆ has_item()

def planet.Channel.has_item (   self,
  id_ 
)
Check whether the item exists in the channel.

◆ items()

def planet.Channel.items (   self,
  hidden = 0,
  sorted = 0 
)
Return the item list.

◆ update()

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.

◆ update_entries()

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.

◆ update_info()

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.

Member Data Documentation

◆ configured_url

planet.Channel.configured_url

◆ exclude

planet.Channel.exclude

◆ filter

planet.Channel.filter

◆ IGNORE_KEYS

planet.Channel.IGNORE_KEYS
static

◆ last_updated

planet.Channel.last_updated

◆ name

planet.Channel.name

◆ next_order

planet.Channel.next_order

◆ updated

planet.Channel.updated

◆ url

planet.Channel.url

◆ url_etag

planet.Channel.url_etag

◆ url_modified

planet.Channel.url_modified

◆ url_status

planet.Channel.url_status

The documentation for this class was generated from the following file: