webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Public Member Functions | Public Attributes | List of all members
planet.Planet Class Reference

Public Member Functions

def __init__ (self, config)
 
def tmpl_config_get (self, template, option, default=None, raw=0, vars=None)
 
def gather_channel_info (self, template_file="Planet")
 
def gather_items_info (self, channels, template_file="Planet", channel_list=None)
 
def run (self, planet_name, planet_link, template_files, offline=False)
 
def generate_all_files (self, template_files, planet_name, planet_link, planet_feed, owner_name, owner_email)
 
def channels (self, hidden=0, sorted=1)
 
def find_by_basename (self, basename)
 
def subscribe (self, channel)
 
def unsubscribe (self, channel)
 
def items (self, hidden=0, sorted=1, max_items=0, max_days=0, channels=None)
 

Public Attributes

 config
 
 user_agent
 
 cache_directory
 
 new_feed_items
 
 filter
 
 exclude
 

Detailed Description

A set of channels.

This class represents a set of channels for which the items will
be aggregated together into one combined feed.

Properties:
    user_agent      User-Agent header to fetch feeds with.
    cache_directory Directory to store cached channels in.
    new_feed_items  Number of items to display from a new feed.
    filter          A regular expression that articles must match.
    exclude         A regular expression that articles must not match.

Constructor & Destructor Documentation

◆ __init__()

def planet.Planet.__init__ (   self,
  config 
)

Member Function Documentation

◆ channels()

def planet.Planet.channels (   self,
  hidden = 0,
  sorted = 1 
)
Return the list of channels.

◆ find_by_basename()

def planet.Planet.find_by_basename (   self,
  basename 
)

◆ gather_channel_info()

def planet.Planet.gather_channel_info (   self,
  template_file = "Planet" 
)

◆ gather_items_info()

def planet.Planet.gather_items_info (   self,
  channels,
  template_file = "Planet",
  channel_list = None 
)

◆ generate_all_files()

def planet.Planet.generate_all_files (   self,
  template_files,
  planet_name,
  planet_link,
  planet_feed,
  owner_name,
  owner_email 
)

◆ items()

def planet.Planet.items (   self,
  hidden = 0,
  sorted = 1,
  max_items = 0,
  max_days = 0,
  channels = None 
)
Return an optionally filtered list of items in the channel.

The filters are applied in the following order:

If hidden is true then items in hidden channels and hidden items
will be returned.

If sorted is true then the item list will be sorted with the newest
first.

If max_items is non-zero then this number of items, at most, will
be returned.

If max_days is non-zero then any items older than the newest by
this number of days won't be returned.  Requires sorted=1 to work.


The sharp-eyed will note that this looks a little strange code-wise,
it turns out that Python gets *really* slow if we try to sort the
actual items themselves.  Also we use mktime here, but it's ok
because we discard the numbers and just need them to be relatively
consistent between each other.

◆ run()

def planet.Planet.run (   self,
  planet_name,
  planet_link,
  template_files,
  offline = False 
)

◆ subscribe()

def planet.Planet.subscribe (   self,
  channel 
)
Subscribe the planet to the channel.

◆ tmpl_config_get()

def planet.Planet.tmpl_config_get (   self,
  template,
  option,
  default = None,
  raw = 0,
  vars = None 
)
Get a template value from the configuration, with a default.

◆ unsubscribe()

def planet.Planet.unsubscribe (   self,
  channel 
)
Unsubscribe the planet from the channel.

Member Data Documentation

◆ cache_directory

planet.Planet.cache_directory

◆ config

planet.Planet.config

◆ exclude

planet.Planet.exclude

◆ filter

planet.Planet.filter

◆ new_feed_items

planet.Planet.new_feed_items

◆ user_agent

planet.Planet.user_agent

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