]> git.ipfire.org Git - thirdparty/babel.git/commitdiff
Genshi extraction method has moved to Genshi project. Closes #13.
authorChristopher Lenz <cmlenz@gmail.com>
Wed, 20 Jun 2007 10:02:04 +0000 (10:02 +0000)
committerChristopher Lenz <cmlenz@gmail.com>
Wed, 20 Jun 2007 10:02:04 +0000 (10:02 +0000)
babel/messages/extract.py
doc/style/edgewall.css
setup.py

index 05c29f890c6a167b00387a90414f583661490e4f..104277053329e36c45aa51025954de532ba8a728 100644 (file)
@@ -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.
     
index 4d6527bf3c1b9f8d25a6791b827183720c3b90dc..a04f6842ac962cbda11ccb9bca298f4340c7e1ef 100644 (file)
@@ -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; }
index 8efd523f7de90e633f5c4c526ecf575dd8a3ab63..f9c098b463e452676e4f658b83cdc0e607bcf216 100755 (executable)
--- 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}