Changeset 745
- Timestamp:
- Sep 4, 2007, 1:51:58 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
README.txt (modified) (1 diff)
-
genshi/template/markup.py (modified) (1 diff)
-
genshi/template/tests/markup.py (modified) (1 diff)
-
genshi/template/tests/text.py (modified) (2 diffs)
-
genshi/template/text.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ChangeLog
r726 r745 34 34 to "text", the included template is parsed as a text template using the new 35 35 syntax (ticket #101). 36 * If an include is found when parsing a template, but no template loader has37 been specified, a `TemplateSyntaxError` is raised.38 36 39 37 -
trunk/README.txt
r715 r745 2 2 ============ 3 3 4 Genshi is a Python library that provides an integrated set of components5 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.4 Genshi is a Python library that provides an integrated set of 5 components for parsing, generating, and processing HTML, XML or other 6 textual content for output generation on the web. The major feature is 7 a template language, which is heavily inspired by Kid. 8 8 9 For more information please see the documentation in the `doc` directory, and visit the Genshi web site: 9 For more information please see the documentation in the `doc` 10 directory, and visit the Genshi web site: 10 11 11 12 <http://genshi.edgewall.org/> -
trunk/genshi/template/markup.py
r726 r745 143 143 144 144 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:])149 145 if tag.localname == 'include': 150 146 include_href = new_attrs.get('href') -
trunk/genshi/template/tests/markup.py
r726 r745 245 245 </Test>""", str(tmpl.generate())) 246 246 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 253 247 def test_include_in_loop(self): 254 248 dirname = tempfile.mkdtemp(suffix='genshi_test') -
trunk/genshi/template/tests/text.py
r726 r745 113 113 tmpl.generate().render()) 114 114 115 def test_include_without_loader(self):116 text = '#include "oops.html"'117 self.assertRaises(TemplateSyntaxError, OldTextTemplate, text)118 119 115 120 116 class NewTextTemplateTestCase(unittest.TestCase): … … 237 233 ----- Included data above this line -----""", tmpl.generate().render()) 238 234 239 def test_include_without_loader(self):240 text = '{% include "oops.html" %}'241 self.assertRaises(TemplateSyntaxError, NewTextTemplate, text)242 243 235 244 236 def suite(): -
trunk/genshi/template/text.py
r726 r745 188 188 189 189 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)194 190 pos = (self.filename, lineno, 0) 195 191 stream.append((INCLUDE, (value.strip(), None, []), pos)) … … 312 308 (self.filepath, lineno, 0))] 313 309 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)318 310 pos = (self.filename, lineno, 0) 319 311 stream.append((INCLUDE, (value.strip(), None, []), pos))
Note: See TracChangeset
for help on using the changeset viewer.
