$27 GRAYBYTE WORDPRESS FILE MANAGER $24

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/

HOME
Current File : /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp//xml_fix.py
# 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("&", "&amp;").replace("<", "&lt;")
  data = data.replace("\"", "&quot;").replace(">", "&gt;")
  if is_attrib:
    data = data.replace(
        "\r", "&#xD;").replace(
        "\n", "&#xA;").replace(
        "\t", "&#x9;")
  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 = attrs.keys()
  a_names.sort()

  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("%s</%s>%s" % (indent, self.tagName, newl))
  else:
    writer.write("/>%s" % newl)


class XmlFix(object):
  """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()

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
1 Jan 1970 8.00 AM
root / root
0
generator
--
31 Aug 2024 8.02 AM
root / root
0755
MSVSNew.py
11.656 KB
10 Mar 2021 9.36 PM
root / root
0644
MSVSProject.py
6.237 KB
10 Mar 2021 9.36 PM
root / root
0644
MSVSSettings.py
44.11 KB
10 Mar 2021 9.36 PM
root / root
0644
MSVSSettings_test.py
64.562 KB
10 Mar 2021 9.36 PM
root / root
0644
MSVSToolFile.py
1.762 KB
10 Mar 2021 9.36 PM
root / root
0644
MSVSUserFile.py
4.967 KB
10 Mar 2021 9.36 PM
root / root
0644
MSVSUtil.py
9.31 KB
10 Mar 2021 9.36 PM
root / root
0644
MSVSVersion.py
17.024 KB
10 Mar 2021 9.36 PM
root / root
0644
__init__.py
21.868 KB
10 Mar 2021 9.36 PM
root / root
0644
common.py
20.579 KB
10 Mar 2021 9.36 PM
root / root
0644
common_test.py
1.918 KB
10 Mar 2021 9.36 PM
root / root
0644
easy_xml.py
4.873 KB
10 Mar 2021 9.36 PM
root / root
0644
easy_xml_test.py
3.249 KB
10 Mar 2021 9.36 PM
root / root
0644
flock_tool.py
1.706 KB
10 Mar 2021 9.36 PM
root / root
0644
input.py
113.647 KB
10 Mar 2021 9.36 PM
root / root
0644
input_test.py
3.11 KB
10 Mar 2021 9.36 PM
root / root
0644
mac_tool.py
22.892 KB
10 Mar 2021 9.36 PM
root / root
0644
msvs_emulation.py
46.759 KB
10 Mar 2021 9.36 PM
root / root
0644
ninja_syntax.py
5.406 KB
10 Mar 2021 9.36 PM
root / root
0644
simple_copy.py
1.302 KB
10 Mar 2021 9.36 PM
root / root
0644
win_tool.py
12.723 KB
10 Mar 2021 9.36 PM
root / root
0644
xcode_emulation.py
64.854 KB
10 Mar 2021 9.36 PM
root / root
0644
xcode_ninja.py
10.32 KB
10 Mar 2021 9.36 PM
root / root
0644
xcodeproj_file.py
117.659 KB
10 Mar 2021 9.36 PM
root / root
0644
xml_fix.py
2.123 KB
10 Mar 2021 9.36 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF