Edgewall Software

Changeset 745


Ignore:
Timestamp:
Sep 4, 2007, 1:51:58 PM (16 years ago)
Author:
cmlenz
Message:

Revert second part of [726] (error on includes when no loader specified), which broke I18n extraction via the Babel plugin.

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r726 r745  
    3434   to "text", the included template is parsed as a text template using the new
    3535   syntax (ticket #101).
    36  * If an include is found when parsing a template, but no template loader has
    37    been specified, a `TemplateSyntaxError` is raised.
    3836
    3937
  • trunk/README.txt

    r715 r745  
    22============
    33
    4 Genshi is a Python library that provides an integrated set of components
    5 for parsing, generating, and processing HTML, XML or other textual
    6 content for output generation on the web. The major feature is a
    7 template language, which is heavily inspired by Kid.
     4Genshi is a Python library that provides an integrated set of
     5components for parsing, generating, and processing HTML, XML or other
     6textual content for output generation on the web. The major feature is
     7a template language, which is heavily inspired by Kid.
    88
    9 For more information please see the documentation in the `doc` directory, and visit the Genshi web site:
     9For more information please see the documentation in the `doc`
     10directory, and visit the Genshi web site:
    1011
    1112  <http://genshi.edgewall.org/>
  • trunk/genshi/template/markup.py

    r726 r745  
    143143
    144144                if tag in self.XINCLUDE_NAMESPACE:
    145                     if self._include not in self.filters:
    146                         raise TemplateSyntaxError('Include found but no '
    147                                                   'template loader specified',
    148                                                   self.filepath, *pos[1:])
    149145                    if tag.localname == 'include':
    150146                        include_href = new_attrs.get('href')
  • trunk/genshi/template/tests/markup.py

    r726 r745  
    245245        </Test>""", str(tmpl.generate()))
    246246
    247     def test_include_without_loader(self):
    248         xml = """<html xmlns:xi="http://www.w3.org/2001/XInclude">
    249           <xi:include href="oops.html" />
    250         </html>"""
    251         self.assertRaises(TemplateSyntaxError, MarkupTemplate, xml)
    252 
    253247    def test_include_in_loop(self):
    254248        dirname = tempfile.mkdtemp(suffix='genshi_test')
  • trunk/genshi/template/tests/text.py

    r726 r745  
    113113                         tmpl.generate().render())
    114114
    115     def test_include_without_loader(self):
    116         text = '#include "oops.html"'
    117         self.assertRaises(TemplateSyntaxError, OldTextTemplate, text)
    118 
    119115
    120116class NewTextTemplateTestCase(unittest.TestCase):
     
    237233----- Included data above this line -----""", tmpl.generate().render())
    238234
    239     def test_include_without_loader(self):
    240         text = '{% include "oops.html" %}'
    241         self.assertRaises(TemplateSyntaxError, NewTextTemplate, text)
    242 
    243235
    244236def suite():
  • trunk/genshi/template/text.py

    r726 r745  
    188188
    189189            if command == 'include':
    190                 if self._include not in self.filters:
    191                     raise TemplateSyntaxError('Include found but no template '
    192                                               'loader specified', self.filepath,
    193                                               lineno)
    194190                pos = (self.filename, lineno, 0)
    195191                stream.append((INCLUDE, (value.strip(), None, []), pos))
     
    312308                                              (self.filepath, lineno, 0))]
    313309            elif command == 'include':
    314                 if self._include not in self.filters:
    315                     raise TemplateSyntaxError('Include found but no template '
    316                                               'loader specified', self.filepath,
    317                                               lineno)
    318310                pos = (self.filename, lineno, 0)
    319311                stream.append((INCLUDE, (value.strip(), None, []), pos))
Note: See TracChangeset for help on using the changeset viewer.