6.6. The Atom Syndication Format (RFC4287)¶
This module defines functions and classes for working with the Atom Syndication Format as defined by RFC4287: http://www.ietf.org/rfc/rfc4287.txt
6.6.1. Reference¶
6.6.1.1. Elements¶
-
class
pyslet.rfc4287.Feed(parent)¶ Bases:
pyslet.rfc4287.SourceRepresents an Atom feed.
This is the document (i.e., top-level) element of an Atom Feed Document, acting as a container for metadata and data associated with the feed
-
Entry= None¶ atomEntry
-
-
class
pyslet.rfc4287.Source(parent)¶ Bases:
pyslet.rfc4287.EntityMetadata from the original source feed of an entry.
This class is also used a base class for
Feed.-
Generator= None¶ atomGenerator
-
Icon= None¶ atomIcon
-
Logo= None¶ atomLogo
-
Subtitle= None¶ atomSubtitle
-
-
class
pyslet.rfc4287.Entry(parent)¶ Bases:
pyslet.rfc4287.EntityRepresents an individual entry
Acts as a container for metadata and data associated with the entry.
-
class
pyslet.rfc4287.Entity(parent)¶ Bases:
pyslet.rfc4287.AtomElementBase class for feed, entry and source elements.
-
AtomId= None¶ the atomId of the object
Note that we qualify the class name used to represent the id to avoid confusion with the existing ‘id’ attribute in
Element.
-
Author= None¶ atomAuthor
-
Category= None¶ atomCategory
-
Contributor= None¶ atomContributor
-
Link= None¶ atomLink
-
Rights= None¶ atomRights
-
Title= None¶ atomTitle
-
Updated= None¶ atomUpdated
-
-
class
pyslet.rfc4287.Author(parent)¶ Bases:
pyslet.rfc4287.PersonA Person construct that indicates the author of the entry or feed.
-
class
pyslet.rfc4287.Category(parent)¶ Bases:
pyslet.rfc4287.AtomElementInformation about a category associated with an entry or feed.
-
term= None¶ a string that identifies the category to which the entry or feed belongs
-
scheme= None¶ an IRI that identifies a categorization scheme.
This is not converted to a
pyslet.rfc2396.URIinstance as it is not normally resolved to a resource. Instead it defines a type of namespace.
-
label= None¶ a human-readable label for display in end-user applications
-
-
class
pyslet.rfc4287.Content(parent)¶ Bases:
pyslet.rfc4287.TextContains or links to the content of the entry.
Although derived from
Textthis class overloads the meaning of theText.typeattribute allowing it to be a media type.-
src= None¶ link to remote content
-
get_value()¶ Gets a single string representing the value of the element.
Overloads the basic
get_value(), iftypeis a media type rather than one of the text types then a ValueError is raised.
-
-
class
pyslet.rfc4287.Contributor(parent)¶ Bases:
pyslet.rfc4287.PersonA Person construct representing a contributor
Indicates a person or other entity who contributed to the entry or feed.
-
class
pyslet.rfc4287.Generator(parent)¶ Bases:
pyslet.rfc4287.AtomElementIdentifies the agent used to generate a feed
The agent is used for debugging and other purposes.
-
uri= None¶ the uri of the tool used to generate the feed
-
version= None¶ the version of the tool used to generate the feed
-
set_pyslet_info()¶ Sets this generator to a default value
A representation of this Pyslet module.
-
-
class
pyslet.rfc4287.Icon(parent)¶ Bases:
pyslet.rfc4287.AtomElementAn image that provides iconic visual identification for a feed.
-
get_value()¶ Returning a
pyslet.rfc2396.URIinstance.
-
set_value(value)¶ Enables the value to be set from a URI instance.
If value is a string it is used to set the element’s content,
content_changed()is then called to update the value ofuri. If value is a URI instance thenuriis set directory and it is then converted to a string and used to set the element’s content.
-
-
class
pyslet.rfc4287.AtomId(parent, name=None)¶ Bases:
pyslet.rfc4287.AtomElementA permanent, universally unique identifier for an entry or feed.
-
class
pyslet.rfc4287.Link(parent)¶ Bases:
pyslet.rfc4287.AtomElementA reference from an entry or feed to a Web resource.
-
rel= None¶ a string indicating the link relation type
-
type= None¶ an advisory media type
-
title= None¶ human-readable information about the link
-
length= None¶ an advisory length of the linked content in octets
-
-
class
pyslet.rfc4287.Logo(parent)¶ Bases:
pyslet.rfc4287.IconAn image that provides visual identification for a feed.
-
class
pyslet.rfc4287.Published(parent)¶ Bases:
pyslet.rfc4287.DateA Date construct indicating an instant in time associated with an event early in the life cycle of the entry.
-
class
pyslet.rfc4287.Rights(parent)¶ Bases:
pyslet.rfc4287.TextA Text construct that conveys information about rights held in and over an entry or feed.
-
class
pyslet.rfc4287.Subtitle(parent)¶ Bases:
pyslet.rfc4287.TextA
Textconstruct that conveys a human-readable description or subtitle for a feed.
-
class
pyslet.rfc4287.Summary(parent)¶ Bases:
pyslet.rfc4287.TextA
Textconstruct that conveys a short summary, abstract, or excerpt of an entry.
-
class
pyslet.rfc4287.Title(parent)¶ Bases:
pyslet.rfc4287.TextA
Textconstruct that conveys a human-readable title for an entry or feed.
-
class
pyslet.rfc4287.Updated(parent)¶ Bases:
pyslet.rfc4287.DateA Date construct indicating the most recent instant in time when an entry or feed was modified in a way the publisher considers significant.
6.6.1.2. Base Classes¶
-
class
pyslet.rfc4287.Person(parent)¶ Bases:
pyslet.rfc4287.AtomElementAn element that describes a person, corporation, or similar entity
-
class
pyslet.rfc4287.Name(parent, name=None)¶ Bases:
pyslet.rfc4287.AtomElementA human-readable name for a person.
-
class
pyslet.rfc4287.URI(parent, name=None)¶ Bases:
pyslet.rfc4287.AtomElementAn IRI associated with a person
-
class
pyslet.rfc4287.Email(parent, name=None)¶ Bases:
pyslet.rfc4287.AtomElementAn e-mail address associated with a person
-
class
pyslet.rfc4287.Text(parent)¶ Bases:
pyslet.rfc4287.AtomElementBase class for atomPlainTextConstruct and atomXHTMLTextConstruct.
-
set_value(value, type=1)¶ Sets the value of the element. type must be a value from the
TextTypeenumerationOverloads the basic
SetValue()implementation, adding an additional type attribute to enable the value to be set to either a plain TextType.text, TextType.html or TextType.xhtml value. In the case of an xhtml type, value is parsed for the required XHTML div element and this becomes the only child of the element. Given that the div itself is not considered to be part of the content the value can be given without the enclosing div, in which case it is generated automatically.
-
get_value()¶ Gets a single unicode string representing the value of the element.
Overloads the basic
get_value()implementation to add support for text of type xhtml.When getting the value of TextType.xhtml text the child div element is not returned as it is not considered to be part of the content.
-
-
class
pyslet.rfc4287.TextType¶ Bases:
pyslet.xml.xsdatatypes.Enumerationtext type enumeration:
"text" | "html" | "xhtml"
This enumeration is used for setting the
Text.typeattribute.Usage: TextType.text, TextType.html, TextType.xhtml
-
class
pyslet.rfc4287.Date(parent)¶ Bases:
pyslet.rfc4287.AtomElementAn element conforming to the definition of date-time in RFC3339.
This class is modeled using the iso8601 module.
-
get_value()¶ Overrides
get_value(), returning apyslet.iso8601.TimePointinstance.
-
set_value(value)¶ Overrides
SetValue(), enabling the value to be set from apyslet.iso8601.TimePointinstance.If value is a string the behaviour is unchanged, if value is a TimePoint instance then it is formatted using the extended format of ISO 8601 in accordance with the requirements of the Atom specification.
-
-
class
pyslet.rfc4287.AtomElement(parent, name=None)¶ Bases:
pyslet.xml.namespace.NSElementBase class for all APP elements.
All atom elements can have xml:base and xml:lang attributes, these are handled by the
Elementbase class.See
GetLang()andSetLang(),GetBase()andSetBase()