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

Returns 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

Returns all members names and types as a dictionary.

Status

Return the status.

StatusTime

Returns the status.

StatusTimeStr

Returns the status.

Static Methods

staticmethod

truncated documentation

fill_table

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

schema_database_read

Returns all members names and types as a dictionary.

Methods

method

truncated documentation

__init__

__str__

usual

add_status

Attaches a dictionary representing the status.

get_html_status

Returns a status written in HTML.

html

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

to_html_item

Renders the blog post into HTML.

to_rss_item

Converts the blog post into XML.

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

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

property Status

Return the status.

source on GitHub

property StatusTime

Returns the status.

source on GitHub

property StatusTimeStr

Returns the status.

source on GitHub

__init__(id_rss, title, guid, isPermaLink, link, description, pubDate, keywords=None, id=-1)[source]
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]

Attaches a dictionary representing the status.

Parameters

status – dictionary

source on GitHub

property asdict

Returns all members as a dictionary.

Returns

dictionary

source on GitHub

property 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]

Fills 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]

Displays 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

property index

Defines the column to use as an index.

source on GitHub

property indexes

Defines other indexes to create.

source on GitHub

property pubDateformat

Returns the date to a given format.

source on GitHub

property schema_database

Returns all members names and types as a dictionary.

Returns

dictionary

source on GitHub

static schema_database_read()[source]

Returns all members names and types as a dictionary.

Returns

dictionary

source on GitHub

to_html_item()[source]

Renders the blog post into HTML.

Returns

string

source on GitHub

to_rss_item()[source]

Converts the blog post into XML.

Returns

string

source on GitHub