module rss.rss_blogpost

Inheritance diagram of pyrsslocal.rss.rss_blogpost

Short summary

module pyrsslocal.rss.rss_blogpost

description of a blog post

source on GitHub

Classes

class

truncated documentation

BlogPost

A blog post.

Properties

property

truncated documentation

asdict

return all members as a dictionary

asrow

returns all the values as a row (following the schema given by schema_database())

index

defines the column to use as an index

indexes

defines other indexes to create

pubDateformat

returns the date to a given format

schema_database

return all members names and types as a dictionary

Status

return the status

StatusTime

return the status

StatusTimeStr

return the status

Static Methods

staticmethod

truncated documentation

fill_table

fill a table of a database, if the table does not exists, it creates it

schema_database_read

return all members names and types as a dictionary

Methods

method

truncated documentation

__init__

constructor

__str__

usual

add_status

attach a dictionary representing the status

get_html_status

returns a status written in HTML

html

display the blogs in HTML format, the template contains two kinds of informations:

Documentation

description of a blog post

source on GitHub

class pyrsslocal.rss.rss_blogpost.BlogPost(id_rss, title, guid, isPermaLink, link, description, pubDate, keywords=None, id=-1)[source]

Bases: object

A blog post.

<item>
    <title>Raw food</title>
    <link>http://www.xavierdupre.fr/blog/xd_blog.html?date=2013-06-30</link>
    <guid isPermaLink="true">http://www.xavierdupre.fr/blog/xd_blog.html?date=2013-06-30</guid>
    <description>&lt;p&gt; J'ecoutais une em....</description>
    <pubDate>2013-06-30 00:00:00</pubDate>
</item>

attribute

meaning

id_rss

id of the blog source

title

title of the stream

guid

guid

isPermaLink

isPermaLink

link

url of the blog post

description

description

pubDate

pubDate

keywords

list of keywords

status

status (dictionary with variables)

source on GitHub

constructor

Parameters
  • id_rss – id of rss or Stream class

  • title – title of the stream

  • guid – guid

  • isPermaLink – isPermaLink

  • link – url of the blog post

  • description – description

  • pubDate – pubDate

  • keywords – keywords

  • id – blog id

source on GitHub

Status

return the status

source on GitHub

StatusTime

return the status

source on GitHub

StatusTimeStr

return the status

source on GitHub

__init__(id_rss, title, guid, isPermaLink, link, description, pubDate, keywords=None, id=-1)[source]

constructor

Parameters
  • id_rss – id of rss or Stream class

  • title – title of the stream

  • guid – guid

  • isPermaLink – isPermaLink

  • link – url of the blog post

  • description – description

  • pubDate – pubDate

  • keywords – keywords

  • id – blog id

source on GitHub

__str__()[source]

usual

source on GitHub

add_status(status)[source]

attach a dictionary representing the status

Parameters

status – dictionary

source on GitHub

asdict

return all members as a dictionary

Returns

dictionary

source on GitHub

asrow

returns all the values as a row (following the schema given by schema_database())

Returns

list of values

source on GitHub

static fill_table(db, tablename, iterator_on, skip_exception=False)[source]

fill a table of a database, if the table does not exists, it creates it

Parameters
  • db – database object (Database)

  • tablename – name of a table (created if it does not exists)

  • iterator_on – iterator_on on StreamRSS object

  • skip_exception – skip exception while inserting an element

source on GitHub

get_html_status(thispage)[source]

returns a status written in HTML

Parameters

thispage – the displayed page

Returns

html string

source on GitHub

html(template=None, action='{0.link}', style=None, styleblog=None, stylestatus=None, ftime='%Y-%m-%d', extended=False, style_desc='description', addlog=True, addcontent=False, addstatus=False, thispage=None)[source]

display the blogs in HTML format, the template contains two kinds of informations: - {0.member} : this string will be replaced by the member

Parameters
  • template – html template

  • action – url to use when clicking on a blog

  • style – style of the paragraph containing the url, if None, it will be set to postitle or posttitleext

  • styleblog – style of the paragraph containing the url, if None, it will be set to posttitleexb

  • ftime – format time

  • extended – if True, display the title, if False, display everything

  • style_desc – style for the description

  • addlog – if True, link will contains a prefix to go through the server and be logged

  • addcontent – if True, the function will add some javascript code to make the content from the website appear.

  • addstatus – if True, add the status for this blog post

Returns

html string

If the template is None, it will be replaced a default value (see the code and the variable template).

source on GitHub

index

defines the column to use as an index

source on GitHub

indexes

defines other indexes to create

source on GitHub

pubDateformat

returns the date to a given format

source on GitHub

schema_database

return all members names and types as a dictionary

Returns

dictionary

source on GitHub

static schema_database_read()[source]

return all members names and types as a dictionary

Returns

dictionary

source on GitHub