Mercurial > genshi > genshi-test
comparison genshi/input.py @ 820:1837f39efd6f experimental-inline
Sync (old) experimental inline branch with trunk@1027.
author | cmlenz |
---|---|
date | Wed, 11 Mar 2009 17:51:06 +0000 |
parents | 0742f421caba |
children | 09cc3627654c |
comparison
equal
deleted
inserted
replaced
500:0742f421caba | 820:1837f39efd6f |
---|---|
15 sources. | 15 sources. |
16 """ | 16 """ |
17 | 17 |
18 from itertools import chain | 18 from itertools import chain |
19 from xml.parsers import expat | 19 from xml.parsers import expat |
20 try: | |
21 frozenset | |
22 except NameError: | |
23 from sets import ImmutableSet as frozenset | |
24 import HTMLParser as html | 20 import HTMLParser as html |
25 import htmlentitydefs | 21 import htmlentitydefs |
26 from StringIO import StringIO | 22 from StringIO import StringIO |
27 | 23 |
28 from genshi.core import Attrs, QName, Stream, stripentities | 24 from genshi.core import Attrs, QName, Stream, stripentities |
130 # (in _handle_other) | 126 # (in _handle_other) |
131 parser.DefaultHandler = self._handle_other | 127 parser.DefaultHandler = self._handle_other |
132 parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS) | 128 parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS) |
133 parser.UseForeignDTD() | 129 parser.UseForeignDTD() |
134 parser.ExternalEntityRefHandler = self._build_foreign | 130 parser.ExternalEntityRefHandler = self._build_foreign |
135 | |
136 # Location reporting is only support in Python >= 2.4 | |
137 if not hasattr(parser, 'CurrentLineNumber'): | |
138 self._getpos = self._getpos_unknown | |
139 | 131 |
140 self.expat = parser | 132 self.expat = parser |
141 self._queue = [] | 133 self._queue = [] |
142 | 134 |
143 def parse(self): | 135 def parse(self): |