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.ElementRepresent
bodyelement of OPML document.
-
class
libearth.subscribe.Category(_parent=None, **attributes)¶ Bases:
libearth.subscribe.Outline,libearth.subscribe.SubscriptionSetCategory which groups
Subscriptionobjects or otherCategoryobjects. It implementscollections.MutableSetprotocol.
-
class
libearth.subscribe.CommaSeparatedList¶ Bases:
libearth.schema.CodecEncode 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.ElementRepresent
headelement of OPML document.
-
class
libearth.subscribe.Outline(_parent=None, **attributes)¶ Bases:
libearth.schema.ElementRepresent
outlineelement of OPML document.-
created_at¶ (
datetime.datetime) The created time.
-
deleted_at¶ (
datetime.datetime) The archived time, if deleted ever. It could beNoneas 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 usedeletedproperty instead.New in version 0.3.0.
-
-
class
libearth.subscribe.Subscription(_parent=None, **attributes)¶ Bases:
libearth.subscribe.OutlineSubscription which holds referring
feed_uri.
-
class
libearth.subscribe.SubscriptionList(_parent=None, **kwargs)¶ Bases:
libearth.session.MergeableDocumentElement,libearth.subscribe.SubscriptionSetThe set (exactly, tree) of subscriptions. It consists of
Subscriptions andCategoryobjects for grouping. It implementscollections.MutableSetprotocol.-
version¶ (
distutils.version.StrictVersion) The OPML version number.
-
-
class
libearth.subscribe.SubscriptionSet¶ Bases:
_abcoll.MutableSetMixin for
SubscriptionListandCategory, both can groupSubscriptionobject and otherCategoryobjects, to implementcollections.MutableSetprotocol.-
children¶ - (
collections.MutableSequence) ChildOutline - objects.
Note
Every subclass of
SubscriptionSethas to overridechildrenproperty to implement details.- (
-
contains(outline, recursively=False)¶ Determine whether the set contains the given
outline. IfrecursivelyisFalse(which is by default) it works in the same way toinoperator.Parameters: Returns: Trueif the set (or tree) contains the givenoutline, orFalseReturn type: New in version 0.2.0.
-
subscribe(feed, icon_uri=None)¶ Add a subscription from
Feedinstance. Prefer this method overadd()method.Parameters: Returns: the created subscription object
Return type: New in version 0.3.0: Optional
icon_urlparameter was added.
-
subscriptions¶ (
collections.Set) The subset which consists of onlySubscriptioninstances.
-