MCPcopy Create free account
hub / github.com/RustPython/RustPython / setFeature

Method setFeature

Lib/xml/sax/expatreader.py:136–164  ·  view source on GitHub ↗
(self, name, state)

Source from the content-addressed store, hash-verified

134 raise SAXNotRecognizedException("Feature '%s' not recognized" % name)
135
136 def setFeature(self, name, state):
137 if self._parsing:
138 raise SAXNotSupportedException("Cannot set features while parsing")
139
140 if name == feature_namespaces:
141 self._namespaces = state
142 elif name == feature_external_ges:
143 self._external_ges = state
144 elif name == feature_string_interning:
145 if state:
146 if self._interning is None:
147 self._interning = {}
148 else:
149 self._interning = None
150 elif name == feature_validation:
151 if state:
152 raise SAXNotSupportedException(
153 "expat does not support validation")
154 elif name == feature_external_pes:
155 if state:
156 raise SAXNotSupportedException(
157 "expat does not read external parameter entities")
158 elif name == feature_namespace_prefixes:
159 if state:
160 raise SAXNotSupportedException(
161 "expat does not report namespace prefixes")
162 else:
163 raise SAXNotRecognizedException(
164 "Feature '%s' not recognized" % name)
165
166 def getProperty(self, name):
167 if name == handler.property_lexical_handler:

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected