Mercurial > genshi > genshi-test
comparison markup/template.py @ 153:7a4086c22a64
Fix relative includes on Windows. Closes #27.
author | cmlenz |
---|---|
date | Wed, 16 Aug 2006 10:35:01 +0000 |
parents | 064ba1078f92 |
children | 1c404be518d1 |
comparison
equal
deleted
inserted
replaced
152:064ba1078f92 | 153:7a4086c22a64 |
---|---|
19 class deque(list): | 19 class deque(list): |
20 def appendleft(self, x): self.insert(0, x) | 20 def appendleft(self, x): self.insert(0, x) |
21 def popleft(self): return self.pop(0) | 21 def popleft(self): return self.pop(0) |
22 import compiler | 22 import compiler |
23 import os | 23 import os |
24 import posixpath | |
25 import re | 24 import re |
26 from StringIO import StringIO | 25 from StringIO import StringIO |
27 | 26 |
28 from markup.core import Attributes, Namespace, Stream, StreamEventKind, _ensure | 27 from markup.core import Attributes, Namespace, Stream, StreamEventKind, _ensure |
29 from markup.core import START, END, START_NS, END_NS, TEXT, COMMENT | 28 from markup.core import START, END, START_NS, END_NS, TEXT, COMMENT |
1050 directly | 1049 directly |
1051 """ | 1050 """ |
1052 from markup.filters import IncludeFilter | 1051 from markup.filters import IncludeFilter |
1053 | 1052 |
1054 if relative_to: | 1053 if relative_to: |
1055 filename = posixpath.join(posixpath.dirname(relative_to), filename) | 1054 filename = os.path.join(os.path.dirname(relative_to), filename) |
1056 filename = os.path.normpath(filename) | 1055 filename = os.path.normpath(filename) |
1057 | 1056 |
1058 # First check the cache to avoid reparsing the same file | 1057 # First check the cache to avoid reparsing the same file |
1059 try: | 1058 try: |
1060 tmpl = self._cache[filename] | 1059 tmpl = self._cache[filename] |