diff --git a/feedgen/__main__.py b/feedgen/__main__.py index 833a897..158c66f 100644 --- a/feedgen/__main__.py +++ b/feedgen/__main__.py @@ -31,7 +31,9 @@ if __name__ == '__main__': print_enc (' rss -- Generate RSS test output and print it to stdout.') print_enc (' .atom -- Generate ATOM test feed and write it to file.atom.') print_enc (' .rss -- Generate RSS test teed and write it to file.rss.') - print_enc (' podcast -- Generator Podcast test output and print it to stdout.') + print_enc (' podcast -- Generate Podcast test output and print it to stdout.') + print_enc (' dc.atom -- Generate DC extension test output (atom format) and print it to stdout.') + print_enc (' dc.rss -- Generate DC extension test output (rss format) and print it to stdout.') print_enc ('') exit() diff --git a/feedgen/ext/dc.py b/feedgen/ext/dc.py index 9476d70..69835d2 100644 --- a/feedgen/ext/dc.py +++ b/feedgen/ext/dc.py @@ -53,20 +53,13 @@ class DcBaseExtension(BaseExtension): DCELEMENTS_NS = 'http://purl.org/dc/elements/1.1/' for elem in ['contributor', 'coverage', 'creator', 'date', 'description', - 'language', 'publisher', 'relation', 'rights', 'source', 'subject', - 'title', 'type']: + 'language', 'publisher', 'relation', 'rights', 'source', 'subject', + 'title', 'type', 'format', 'identifier']: if hasattr(self, '_dcelem_%s' % elem): for val in getattr(self, '_dcelem_%s' % elem) or []: node = etree.SubElement(xml_elem, '{%s}%s' % (DCELEMENTS_NS, elem)) node.text = val - if self._dcelem_format: - node = etree.SubElement(xml_elem, '{%s}format' % DCELEMENTS_NS) - node.text = format - - if self._dcelem_identifier: - node = etree.SubElement(xml_elem, '{%s}identifier' % DCELEMENTS_NS) - node.text = identifier def extend_atom(self, atom_feed): '''Extend an Atom feed with the set DC fields. @@ -225,14 +218,11 @@ class DcBaseExtension(BaseExtension): '''Get or set the dc:identifier which should be an unambiguous reference to the resource within a given context. - If not set, the value of atom:id will be used. But setting this value - will on the other hand not set atom:id. - For more inidentifierion see: http://dublincore.org/documents/dcmi-terms/#elements-identifier :param identifier: Identifier of the resource or list of identifiers. - :param replace: Replace alredy set format (deault: True). + :param replace: Replace alredy set identifier (deault: True). :returns: Identifiers of the resource. ''' if not identifier is None: