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

Public Member Functions

def __init__ (self, channel, id_)
 
def update (self, entry)
 
def get_date (self, key)
 
def get_content (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

 id
 
 id_hash
 
 date
 
 order
 
 content
 

Static Public Attributes

 IGNORE_KEYS
 
- Static Public Attributes inherited from cache.CachedInfo
 STRING
 
 DATE
 
 NULL
 

Detailed Description

An item of news.

This class represents a single item of news on a channel.  They're
created by members of the Channel class and accessible through it.

Properties:
    id              Channel-unique identifier for this item.
    id_hash         Relatively short, printable cryptographic hash of id
    date            Corrected UTC-Normalised update time, for sorting.
    order           Order in which items on the same date can be sorted.
    hidden          Item should be hidden (True if exists).

    title           One-line title (*).
    link            Link to the original format text (*).
    summary         Short first-page summary (*).
    content         Full HTML content.

    modified        Date the item claims to have been modified (*).
    issued          Date the item claims to have been issued (*).
    created         Date the item claims to have been created (*).
    expired         Date the item claims to expire (*).

    author          Name of the author (*).
    publisher       Name of the publisher (*).
    category        Category name (*).
    comments        Link to a page to enter comments (*).
    license         Link to the licence for the content (*).
    source_name     Name of the original source of this item (*).
    source_link     Link to the original source of this item (*).

Properties marked (*) will only be present if the original feed
contained them.  Note that the various optional date fields are
simply claims made by the item and parsed from the information
given, 'date' is a far more reliable source of information.

Some feeds may define additional properties to those above.

Constructor & Destructor Documentation

◆ __init__()

def planet.NewsItem.__init__ (   self,
  channel,
  id_ 
)

Member Function Documentation

◆ get_content()

def planet.NewsItem.get_content (   self,
  key 
)
Return the key containing the content.

◆ get_date()

def planet.NewsItem.get_date (   self,
  key 
)
Get (or update) the date key.

We check whether the date the entry claims to have been changed is
since we last updated this feed and when we pulled the feed off the
site.

If it is then it's probably not bogus, and we'll sort accordingly.

If it isn't then we bound it appropriately, this ensures that
entries appear in posting sequence but don't overlap entries
added in previous updates and don't creep into the next one.

◆ update()

def planet.NewsItem.update (   self,
  entry 
)
Update the item from the feedparser entry given.

Member Data Documentation

◆ content

planet.NewsItem.content

◆ date

planet.NewsItem.date

◆ id

planet.NewsItem.id

◆ id_hash

planet.NewsItem.id_hash

◆ IGNORE_KEYS

planet.NewsItem.IGNORE_KEYS
static

◆ order

planet.NewsItem.order

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