Merge branch 'master' of https://github.com/arne-cl/python-feedgen
This commit is contained in:
commit
e2a8c43e64
1 changed files with 8 additions and 2 deletions
|
@ -996,12 +996,15 @@ class FeedGenerator(object):
|
||||||
self.__rss_webMaster = webMaster
|
self.__rss_webMaster = webMaster
|
||||||
return self.__rss_webMaster
|
return self.__rss_webMaster
|
||||||
|
|
||||||
def add_entry(self, feedEntry=None):
|
def add_entry(self, feedEntry=None, order='prepend'):
|
||||||
'''This method will add a new entry to the feed. If the feedEntry
|
'''This method will add a new entry to the feed. If the feedEntry
|
||||||
argument is omittet a new Entry object is created automatically. This
|
argument is omittet a new Entry object is created automatically. This
|
||||||
is the preferred way to add new entries to a feed.
|
is the preferred way to add new entries to a feed.
|
||||||
|
|
||||||
:param feedEntry: FeedEntry object to add.
|
:param feedEntry: FeedEntry object to add.
|
||||||
|
:param order: If `prepend` is chosen, the entry will be inserted
|
||||||
|
at the beginning of the feed. If `append` is chosen,
|
||||||
|
the entry will be appended to the feed. (default: `prepend`).
|
||||||
:returns: FeedEntry object created or passed to this function.
|
:returns: FeedEntry object created or passed to this function.
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
@ -1031,7 +1034,10 @@ class FeedGenerator(object):
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
self.__feed_entries.insert(0, feedEntry)
|
if order == 'prepend':
|
||||||
|
self.__feed_entries.insert(0, feedEntry)
|
||||||
|
else:
|
||||||
|
self.__feed_entries.append(feedEntry)
|
||||||
return feedEntry
|
return feedEntry
|
||||||
|
|
||||||
def add_item(self, item=None):
|
def add_item(self, item=None):
|
||||||
|
|
Loading…
Reference in a new issue