woob.capabilities.content

class Content(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Content object.

Variables:
  • url – (str) url

  • title – (str) Title of content

  • author – (str) Original author of content

  • content – (str) Body

  • revision – (str) ID of revision

class Revision(id='', url=NotLoaded, backend=None)[source]

Bases: BaseObject

Revision of a change on a content.

Variables:
  • url – (str) url

  • author – (str) Author of revision

  • comment – (str) Comment log about revision

  • timestamp – (date, datetime) Date of revision

  • minor – (bool) Is this change minor?

class CapContent[source]

Bases: Capability

get_content(id, revision=None)[source]

Get a content from an ID.

Parameters:
  • id (str) – ID of content

  • revision (Revision) – if given, get the content at this revision (default: None)

Return type:

Content

iter_revisions(id)[source]

Iter revisions of a content.

Parameters:

id (str) – id of content

Return type:

iter[Revision]

push_content(content, message=None, minor=False)[source]

Push a new revision of a content.

Parameters:
  • content (Content) – object to push

  • message (str) – log message to associate to new revision (default: None)

  • minor (bool) – this is a minor revision (default: False)

get_content_preview(content)[source]

Get a HTML preview of a content.

Parameters:

content (Content) – content object

Return type:

str