summaryrefslogtreecommitdiffstats
path: root/feedgen/ext/base.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2024-12-12 12:17:53 +0100
committerDaniel Baumann <daniel@debian.org>2024-12-12 12:17:53 +0100
commit11cb8088832071b55bba2aff046d1542dda46fed (patch)
treed3f24cca0040ee5587df8c9e10371d05f206f94a /feedgen/ext/base.py
parentInitial commit. (diff)
downloadpython-feedgen-upstream.tar.xz
python-feedgen-upstream.zip
Adding upstream version 1.0.0.upstream/1.0.0upstream
Signed-off-by: Daniel Baumann <daniel@debian.org>
Diffstat (limited to 'feedgen/ext/base.py')
-rw-r--r--feedgen/ext/base.py44
1 files changed, 44 insertions, 0 deletions
diff --git a/feedgen/ext/base.py b/feedgen/ext/base.py
new file mode 100644
index 0000000..b94826d
--- /dev/null
+++ b/feedgen/ext/base.py
@@ -0,0 +1,44 @@
+# -*- coding: utf-8 -*-
+'''
+ feedgen.ext.base
+ ~~~~~~~~~~~~~~~~
+
+ Basic FeedGenerator extension which does nothing but provides all necessary
+ methods.
+
+ :copyright: 2013, Lars Kiesow <lkiesow@uos.de>
+
+ :license: FreeBSD and LGPL, see license.* for more details.
+'''
+
+
+class BaseExtension(object):
+ '''Basic FeedGenerator extension.
+ '''
+ def extend_ns(self):
+ '''Returns a dict that will be used in the namespace map for the feed.
+ '''
+ return dict()
+
+ def extend_rss(self, feed):
+ '''Extend a RSS feed xml structure containing all previously set
+ fields.
+
+ :param feed: The feed xml root element.
+ :returns: The feed root element.
+ '''
+ return feed
+
+ def extend_atom(self, feed):
+ '''Extend an ATOM feed xml structure containing all previously set
+ fields.
+
+ :param feed: The feed xml root element.
+ :returns: The feed root element.
+ '''
+ return feed
+
+
+class BaseEntryExtension(BaseExtension):
+ '''Basic FeedEntry extension.
+ '''