weboob.capabilities.content

class weboob.capabilities.content.Content(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Content object.
Variables:
  • title – (unicode) Title of content
  • author – (unicode) Original author of content
  • content – (unicode) Body
  • revision – (unicode) ID of revision
class weboob.capabilities.content.Revision(id=u'', url=NotLoaded, backend=None)

Bases: weboob.capabilities.base.BaseObject

Revision of a change on a content.
Variables:
  • author – (unicode) Author of revision
  • comment – (unicode) Comment log about revision
  • timestamp – (date, datetime) Date of revision
  • minor – (bool) Is this change minor?
class weboob.capabilities.content.CapContent

Bases: weboob.capabilities.base.Capability

get_content(id, revision=None)

Get a content from an ID.

Parameters:
  • id (str) – ID of content
  • revision (Revision) – if given, get the content at this revision
Return type:

Content

get_content_preview(content)

Get a HTML preview of a content.

Parameters:content (Content) – content object
Return type:str
iter_revisions(id)

Iter revisions of a content.

Parameters:id (str) – id of content
Return type:iter[Revision]
push_content(content, message=None, minor=False)

Push a new revision of a content.

Parameters:
  • content (Content) – object to push
  • message (str) – log message to associate to new revision
  • minor (bool) – this is a minor revision