/snap/node/11782/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp
NameSizeModeActions
generator/-0755rm
common.py253130644editdlrm
common_test.py62520755editdlrm
easy_xml.py54870644editdlrm
easy_xml_test.py39410755editdlrm
flock_tool.py18860755editdlrm
input.py1264370644editdlrm
input_test.py34260755editdlrm
mac_tool.py304820755editdlrm
MSVSNew.py131910644editdlrm
MSVSProject.py69400644editdlrm
MSVSSettings.py457470644editdlrm
MSVSSettings_test.py744340755editdlrm
MSVSToolFile.py18300644editdlrm
MSVSUserFile.py53760644editdlrm
MSVSUtil.py103260644editdlrm
MSVSVersion.py198780644editdlrm
msvs_emulation.py540210644editdlrm
ninja_syntax.py56400644editdlrm
simple_copy.py12970644editdlrm
win_tool.py151780755editdlrm
xcodeproj_file.py1362720644editdlrm
xcode_emulation.py824540644editdlrm
xcode_emulation_test.py14890644editdlrm
xcode_ninja.py121320644editdlrm
xml_fix.py22440644editdlrm
__init__.py246530755editdlrm
Edit: /snap/node/11782/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py (2244B)
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.org/issue5752 TODO(bradnelson): Consider dropping this when we drop XP support. """ import xml.dom.minidom def _Replacement_write_data(writer, data, is_attrib=False): """Writes datachars to writer.""" data = data.replace("&", "&").replace("<", "<") data = data.replace('"', """).replace(">", ">") if is_attrib: data = data.replace("\r", " ").replace("\n", " ").replace("\t", " ") writer.write(data) def _Replacement_writexml(self, writer, indent="", addindent="", newl=""): # indent = current indentation # addindent = indentation to add to higher levels # newl = newline string writer.write(indent + "<" + self.tagName) attrs = self._get_attributes() a_names = sorted(attrs.keys()) for a_name in a_names: writer.write(' %s="' % a_name) _Replacement_write_data(writer, attrs[a_name].value, is_attrib=True) writer.write('"') if self.childNodes: writer.write(">%s" % newl) for node in self.childNodes: node.writexml(writer, indent + addindent, addindent, newl) writer.write(f"{indent}{newl}") else: writer.write("/>%s" % newl) class XmlFix: """Object to manage temporary patching of xml.dom.minidom.""" def __init__(self): # Preserve current xml.dom.minidom functions. self.write_data = xml.dom.minidom._write_data self.writexml = xml.dom.minidom.Element.writexml # Inject replacement versions of a function and a method. xml.dom.minidom._write_data = _Replacement_write_data xml.dom.minidom.Element.writexml = _Replacement_writexml def Cleanup(self): if self.write_data: xml.dom.minidom._write_data = self.write_data xml.dom.minidom.Element.writexml = self.writexml self.write_data = None def __del__(self): self.Cleanup()