def __init__(self, out=None, encoding='iso-8859-1', short_empty_elements=False): xmltodict.XMLGenerator.__bases__.__init__(self) buf = BufferedIOBase() buf.writable = lambda : True buf.write = out.write ioWrapper = TextIOWrapper(buf, encoding=encoding, errors='xmlcharrefreplace', newline='\n') self._write = ioWrapper.write self._flush = ioWrapper.flush self._ns_contexts = [{}] self._current_context = self._ns_contexts[-1] self._undeclared_ns_maps = [] self._encoding = encoding
def __init__(self, out=None, encoding='iso-8859-1', short_empty_elements=False): """ :param out: output object :param encoding: output encoding :param short_empty_elements: unused parameter needed for compatibility """ xmltodict.XMLGenerator.__bases__.__init__(self) buffer = BufferedIOBase() buffer.writable = lambda: True buffer.write = out.write ioWrapper = TextIOWrapper(buffer, encoding=encoding, errors='xmlcharrefreplace', newline='\n') self._write = ioWrapper.write self._flush = ioWrapper.flush self._ns_contexts = [{}] self._current_context = self._ns_contexts[-1] self._undeclared_ns_maps = [] self._encoding = encoding