libearth.subscribe
— Subscription list¶
Maintain the subscription list using OPML format, which is de facto standard for the purpose.
-
class
libearth.subscribe.
Body
(_parent=None, **attributes)¶ Bases:
libearth.schema.Element
Represent
body
element of OPML document.
-
class
libearth.subscribe.
Category
(_parent=None, **attributes)¶ Bases:
libearth.subscribe.Outline
,libearth.subscribe.SubscriptionSet
Category which groups
Subscription
objects or otherCategory
objects. It implementscollections.MutableSet
protocol.
-
class
libearth.subscribe.
CommaSeparatedList
¶ Bases:
libearth.schema.Codec
Encode strings e.g.
['a', 'b', 'c']
into a comma-separated list e.g.'a,b,c'
, and decode it back to a Python list. Whitespaces between commas are ignored.>>> codec = CommaSeparatedList() >>> codec.encode(['technology', 'business']) 'technology,business' >>> codec.decode('technology, business') ['technology', 'business']
-
class
libearth.subscribe.
Head
(_parent=None, **attributes)¶ Bases:
libearth.schema.Element
Represent
head
element of OPML document.
-
class
libearth.subscribe.
Outline
(_parent=None, **attributes)¶ Bases:
libearth.schema.Element
Represent
outline
element of OPML document.-
created_at
¶ (
datetime.datetime
) The created time.
-
deleted_at
¶ (
datetime.datetime
) The archived time, if deleted ever. It could beNone
as well if it’s never deleted. Note that it doesn’t have enough information about whether it’s actually deleted or not. For that you have to usedeleted
property instead.New in version 0.3.0.
-
-
class
libearth.subscribe.
Subscription
(_parent=None, **attributes)¶ Bases:
libearth.subscribe.Outline
Subscription which holds referring
feed_uri
.
-
class
libearth.subscribe.
SubscriptionList
(_parent=None, **kwargs)¶ Bases:
libearth.session.MergeableDocumentElement
,libearth.subscribe.SubscriptionSet
The set (exactly, tree) of subscriptions. It consists of
Subscription
s andCategory
objects for grouping. It implementscollections.MutableSet
protocol.-
version
¶ (
distutils.version.StrictVersion
) The OPML version number.
-
-
class
libearth.subscribe.
SubscriptionSet
¶ Bases:
_abcoll.MutableSet
Mixin for
SubscriptionList
andCategory
, both can groupSubscription
object and otherCategory
objects, to implementcollections.MutableSet
protocol.-
children
¶ - (
collections.MutableSequence
) ChildOutline
- objects.
Note
Every subclass of
SubscriptionSet
has to overridechildren
property to implement details.- (
-
contains
(outline, recursively=False)¶ Determine whether the set contains the given
outline
. Ifrecursively
isFalse
(which is by default) it works in the same way toin
operator.Parameters: Returns: True
if the set (or tree) contains the givenoutline
, orFalse
Return type: New in version 0.2.0.
-
subscribe
(feed, icon_uri=None)¶ Add a subscription from
Feed
instance. Prefer this method overadd()
method.Parameters: Returns: the created subscription object
Return type: New in version 0.3.0: Optional
icon_url
parameter was added.
-
subscriptions
¶ (
collections.Set
) The subset which consists of onlySubscription
instances.
-