diff genshi/template/text.py @ 703:af57b12e3dd2 experimental-match-fastpaths

merge in trunk up through r818 - fundamentally changed the way MatchSet works, but actually is more consistent now
author aflett
date Mon, 31 Mar 2008 22:47:50 +0000
parents 3ed5d7e47f38
children d143dd73789b
line wrap: on
line diff
--- a/genshi/template/text.py
+++ b/genshi/template/text.py
@@ -28,11 +28,12 @@
 
 import re
 
+from genshi.core import TEXT
 from genshi.template.base import BadDirectiveError, Template, \
                                  TemplateSyntaxError, EXEC, INCLUDE, SUB
 from genshi.template.eval import Suite
 from genshi.template.directives import *
-from genshi.template.directives import Directive, _apply_directives
+from genshi.template.directives import Directive
 from genshi.template.interpolation import interpolate
 
 __all__ = ['NewTextTemplate', 'OldTextTemplate', 'TextTemplate']
@@ -188,7 +189,11 @@
 
             if command == 'include':
                 pos = (self.filename, lineno, 0)
-                stream.append((INCLUDE, (value.strip(), None, []), pos))
+                value = list(interpolate(value, self.basedir, self.filename,
+                                         lineno, 0, lookup=self.lookup))
+                if len(value) == 1 and value[0][0] is TEXT:
+                    value = value[0][1]
+                stream.append((INCLUDE, (value, None, []), pos))
 
             elif command == 'python':
                 if not self.allow_exec:
Copyright (C) 2012-2017 Edgewall Software