From: Christopher Lenz Date: Wed, 20 Jun 2007 10:02:04 +0000 (+0000) Subject: Genshi extraction method has moved to Genshi project. Closes #13. X-Git-Tag: 1.0~492 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59606ccce52c53da5f48228523eb672e20a6938f;p=thirdparty%2Fbabel.git Genshi extraction method has moved to Genshi project. Closes #13. --- diff --git a/babel/messages/extract.py b/babel/messages/extract.py index 05c29f89..10427705 100644 --- a/babel/messages/extract.py +++ b/babel/messages/extract.py @@ -233,44 +233,6 @@ def extract_nothing(fileobj, keywords, comment_tags, options): """ 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. diff --git a/doc/style/edgewall.css b/doc/style/edgewall.css index 4d6527bf..a04f6842 100644 --- a/doc/style/edgewall.css +++ b/doc/style/edgewall.css @@ -74,3 +74,4 @@ div.warning p.admonition-title { } p.admonition-title { margin-bottom: 0; text-transform: uppercase; } tt.docutils { background-color: transparent; } +span.pre { white-space: normal; } diff --git a/setup.py b/setup.py index 8efd523f..f9c098b4 100755 --- a/setup.py +++ b/setup.py @@ -109,7 +109,7 @@ class test_doc(Command): setup( name = 'Babel', - version = '0.1', + version = '0.8', description = 'Internationalization utilities', long_description = \ """A collection of tools for internationalizing Python applications.""", @@ -145,9 +145,8 @@ setup( 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}