comparison genshi/template/text.py @ 629:cae74e2637c6

Revert second part of [726] (error on includes when no loader specified), which broke I18n extraction via the Babel plugin.
author cmlenz
date Tue, 04 Sep 2007 11:51:58 +0000
parents 6a37018199fd
children 1cf5fdfe7214 fa8a55fe2d57 3a4f2fd6f5e2
comparison
equal deleted inserted replaced
628:693a7212b348 629:cae74e2637c6
185 185
186 lineno += len(source[start:end].splitlines()) 186 lineno += len(source[start:end].splitlines())
187 command, value = mo.group(2, 3) 187 command, value = mo.group(2, 3)
188 188
189 if command == 'include': 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 pos = (self.filename, lineno, 0) 190 pos = (self.filename, lineno, 0)
195 stream.append((INCLUDE, (value.strip(), None, []), pos)) 191 stream.append((INCLUDE, (value.strip(), None, []), pos))
196 192
197 elif command == 'python': 193 elif command == 'python':
198 if not self.allow_exec: 194 if not self.allow_exec:
309 directive, start_offset = dirmap.pop(depth) 305 directive, start_offset = dirmap.pop(depth)
310 substream = stream[start_offset:] 306 substream = stream[start_offset:]
311 stream[start_offset:] = [(SUB, ([directive], substream), 307 stream[start_offset:] = [(SUB, ([directive], substream),
312 (self.filepath, lineno, 0))] 308 (self.filepath, lineno, 0))]
313 elif command == 'include': 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 pos = (self.filename, lineno, 0) 310 pos = (self.filename, lineno, 0)
319 stream.append((INCLUDE, (value.strip(), None, []), pos)) 311 stream.append((INCLUDE, (value.strip(), None, []), pos))
320 elif command != '#': 312 elif command != '#':
321 cls = self._dir_by_name.get(command) 313 cls = self._dir_by_name.get(command)
322 if cls is None: 314 if cls is None:
Copyright (C) 2012-2017 Edgewall Software