"""
return []
-def extract_genshi(fileobj, keywords, comment_tags, options):
- """Extract messages from Genshi templates.
-
- :param fileobj: the file-like object the messages should be extracted from
- :param keywords: a list of keywords (i.e. function names) that should be
- recognized as translation functions
- :param comment_tags: a list of translator tags to search for and include
- in the results
- :param options: a dictionary of additional options (optional)
- :return: an iterator over ``(lineno, funcname, message, comments)`` tuples
- :rtype: ``iterator``
- """
- from genshi import QName
- from genshi.filters.i18n import Translator
- from genshi.template import MarkupTemplate
-
- template_class = options.get('template_class', MarkupTemplate)
- if isinstance(template_class, basestring):
- module, clsname = template_class.split(':', 1)
- template_class = getattr(__import__(module, {}, {}, [clsname]), clsname)
- encoding = options.get('encoding', None)
-
- ignore_tags = options.get('ignore_tags', Translator.IGNORE_TAGS)
- if isinstance(ignore_tags, basestring):
- ignore_tags = ignore_tags.split()
- ignore_tags = [QName(tag) for tag in ignore_tags]
- include_attrs = options.get('include_attrs', Translator.INCLUDE_ATTRS)
- if isinstance(include_attrs, basestring):
- include_attrs = include_attrs.split()
- include_attrs = [QName(attr) for attr in include_attrs]
-
- tmpl = template_class(fileobj, filename=getattr(fileobj, 'name'),
- encoding=encoding)
- translator = Translator(None, ignore_tags, include_attrs)
- for lineno, func, message in translator.extract(tmpl.stream,
- gettext_functions=keywords):
- yield lineno, func, message, []
-
def extract_python(fileobj, keywords, comment_tags, options):
"""Extract messages from Python source code.
setup(
name = 'Babel',
- version = '0.1',
+ version = '0.8',
description = 'Internationalization utilities',
long_description = \
"""A collection of tools for internationalizing Python applications.""",
message_extractors = babel.messages.frontend:check_message_extractors
[babel.extractors]
- genshi = babel.messages.extract:extract_genshi
- python = babel.messages.extract:extract_python
ignore = babel.messages.extract:extract_nothing
+ python = babel.messages.extract:extract_python
""",
cmdclass = {'build_doc': build_doc, 'test_doc': test_doc}