# HG changeset patch # User cmlenz # Date 1188906718 0 # Node ID cae74e2637c6e89d406594084020315f29f49a0f # Parent 693a7212b348f33ee070297bb3ca05611e113138 Revert second part of [726] (error on includes when no loader specified), which broke I18n extraction via the Babel plugin. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -33,8 +33,6 @@ set to "xml" (the default), the include is processed as before, but when set to "text", the included template is parsed as a text template using the new syntax (ticket #101). - * If an include is found when parsing a template, but no template loader has - been specified, a `TemplateSyntaxError` is raised. Version 0.4.4 diff --git a/README.txt b/README.txt --- a/README.txt +++ b/README.txt @@ -1,11 +1,12 @@ About Genshi ============ -Genshi is a Python library that provides an integrated set of components -for parsing, generating, and processing HTML, XML or other textual -content for output generation on the web. The major feature is a -template language, which is heavily inspired by Kid. +Genshi is a Python library that provides an integrated set of +components for parsing, generating, and processing HTML, XML or other +textual content for output generation on the web. The major feature is +a template language, which is heavily inspired by Kid. -For more information please see the documentation in the `doc` directory, and visit the Genshi web site: +For more information please see the documentation in the `doc` +directory, and visit the Genshi web site: diff --git a/genshi/template/markup.py b/genshi/template/markup.py --- a/genshi/template/markup.py +++ b/genshi/template/markup.py @@ -142,10 +142,6 @@ dirmap[(depth, tag)] = (directives, len(stream), strip) if tag in self.XINCLUDE_NAMESPACE: - if self._include not in self.filters: - raise TemplateSyntaxError('Include found but no ' - 'template loader specified', - self.filepath, *pos[1:]) if tag.localname == 'include': include_href = new_attrs.get('href') if not include_href: diff --git a/genshi/template/tests/markup.py b/genshi/template/tests/markup.py --- a/genshi/template/tests/markup.py +++ b/genshi/template/tests/markup.py @@ -244,12 +244,6 @@ """, str(tmpl.generate())) - def test_include_without_loader(self): - xml = """ - - """ - self.assertRaises(TemplateSyntaxError, MarkupTemplate, xml) - def test_include_in_loop(self): dirname = tempfile.mkdtemp(suffix='genshi_test') try: diff --git a/genshi/template/tests/text.py b/genshi/template/tests/text.py --- a/genshi/template/tests/text.py +++ b/genshi/template/tests/text.py @@ -112,10 +112,6 @@ ----- Included data above this line -----""", tmpl.generate().render()) - def test_include_without_loader(self): - text = '#include "oops.html"' - self.assertRaises(TemplateSyntaxError, OldTextTemplate, text) - class NewTextTemplateTestCase(unittest.TestCase): """Tests for text template processing.""" @@ -236,10 +232,6 @@ Included ----- Included data above this line -----""", tmpl.generate().render()) - def test_include_without_loader(self): - text = '{% include "oops.html" %}' - self.assertRaises(TemplateSyntaxError, NewTextTemplate, text) - def suite(): suite = unittest.TestSuite() diff --git a/genshi/template/text.py b/genshi/template/text.py --- a/genshi/template/text.py +++ b/genshi/template/text.py @@ -187,10 +187,6 @@ command, value = mo.group(2, 3) if command == 'include': - if self._include not in self.filters: - raise TemplateSyntaxError('Include found but no template ' - 'loader specified', self.filepath, - lineno) pos = (self.filename, lineno, 0) stream.append((INCLUDE, (value.strip(), None, []), pos)) @@ -311,10 +307,6 @@ stream[start_offset:] = [(SUB, ([directive], substream), (self.filepath, lineno, 0))] elif command == 'include': - if self._include not in self.filters: - raise TemplateSyntaxError('Include found but no template ' - 'loader specified', self.filepath, - lineno) pos = (self.filename, lineno, 0) stream.append((INCLUDE, (value.strip(), None, []), pos)) elif command != '#':