feddgenerator: fixed documentation of feed.FeedGenerator.category(...)

This commit is contained in:
Lars Kiesow 2013-04-28 15:19:13 +02:00
parent d8d34c8144
commit db671458dc

View file

@ -508,18 +508,21 @@ class FeedGenerator:
'''Get or set categories that the feed belongs to. '''Get or set categories that the feed belongs to.
This method can be called with: This method can be called with:
- the fields of an author as keyword arguments - the fields of a category as keyword arguments
- the fields of an author as a dictionary - the fields of a category as a dictionary
- a list of dictionaries containing the author fields - a list of dictionaries containing the category fields
A categories has the following fields:
- *term* identifies the category
- *scheme* identifies the categorization scheme via a URI.
- *label* provides a human-readable label for display
If a label is present it is used for the RSS feeds. Otherwise the term is
used. The scheme is used for the domain attribute in RSS.
:param link: Dict or list of dicts with data. :param link: Dict or list of dicts with data.
:param replace: Add or replace old data. :param replace: Add or replace old data.
:returns: List of category data.
Example::
>>> feedgen.link( href='http://example.com/', rel='self')
[{'href':'http://example.com/', 'rel':'self'}]
''' '''
if category is None and kwargs: if category is None and kwargs:
category = kwargs category = kwargs
@ -528,7 +531,7 @@ class FeedGenerator:
self.__atom_category = [] self.__atom_category = []
self.__atom_category += ensure_format( self.__atom_category += ensure_format(
category, category,
set(['term', 'schema', 'label']), set(['term', 'scheme', 'label']),
set(['term']) ) set(['term']) )
# Map the ATOM categories to RSS categories. Use the atom:label as # Map the ATOM categories to RSS categories. Use the atom:label as
# name or if not present the atom:term. The atom:schema is the # name or if not present the atom:term. The atom:schema is the