]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Python/Python-2.7.10/Lib/xml/sax/__init__.py
edk2: Remove AppPkg, StdLib, StdLibPrivateInternalFiles
[mirror_edk2.git] / AppPkg / Applications / Python / Python-2.7.10 / Lib / xml / sax / __init__.py
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Lib/xml/sax/__init__.py b/AppPkg/Applications/Python/Python-2.7.10/Lib/xml/sax/__init__.py
deleted file mode 100644 (file)
index 2686c38..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-"""Simple API for XML (SAX) implementation for Python.\r
-\r
-This module provides an implementation of the SAX 2 interface;\r
-information about the Java version of the interface can be found at\r
-http://www.megginson.com/SAX/.  The Python version of the interface is\r
-documented at <...>.\r
-\r
-This package contains the following modules:\r
-\r
-handler -- Base classes and constants which define the SAX 2 API for\r
-           the 'client-side' of SAX for Python.\r
-\r
-saxutils -- Implementation of the convenience classes commonly used to\r
-            work with SAX.\r
-\r
-xmlreader -- Base classes and constants which define the SAX 2 API for\r
-             the parsers used with SAX for Python.\r
-\r
-expatreader -- Driver that allows use of the Expat parser with SAX.\r
-"""\r
-\r
-from xmlreader import InputSource\r
-from handler import ContentHandler, ErrorHandler\r
-from _exceptions import SAXException, SAXNotRecognizedException, \\r
-                        SAXParseException, SAXNotSupportedException, \\r
-                        SAXReaderNotAvailable\r
-\r
-\r
-def parse(source, handler, errorHandler=ErrorHandler()):\r
-    parser = make_parser()\r
-    parser.setContentHandler(handler)\r
-    parser.setErrorHandler(errorHandler)\r
-    parser.parse(source)\r
-\r
-def parseString(string, handler, errorHandler=ErrorHandler()):\r
-    try:\r
-        from cStringIO import StringIO\r
-    except ImportError:\r
-        from StringIO import StringIO\r
-\r
-    if errorHandler is None:\r
-        errorHandler = ErrorHandler()\r
-    parser = make_parser()\r
-    parser.setContentHandler(handler)\r
-    parser.setErrorHandler(errorHandler)\r
-\r
-    inpsrc = InputSource()\r
-    inpsrc.setByteStream(StringIO(string))\r
-    parser.parse(inpsrc)\r
-\r
-# this is the parser list used by the make_parser function if no\r
-# alternatives are given as parameters to the function\r
-\r
-default_parser_list = ["xml.sax.expatreader"]\r
-\r
-# tell modulefinder that importing sax potentially imports expatreader\r
-_false = 0\r
-if _false:\r
-    import xml.sax.expatreader\r
-\r
-import os, sys\r
-if "PY_SAX_PARSER" in os.environ:\r
-    default_parser_list = os.environ["PY_SAX_PARSER"].split(",")\r
-del os\r
-\r
-_key = "python.xml.sax.parser"\r
-if sys.platform[:4] == "java" and sys.registry.containsKey(_key):\r
-    default_parser_list = sys.registry.getProperty(_key).split(",")\r
-\r
-\r
-def make_parser(parser_list = []):\r
-    """Creates and returns a SAX parser.\r
-\r
-    Creates the first parser it is able to instantiate of the ones\r
-    given in the list created by doing parser_list +\r
-    default_parser_list.  The lists must contain the names of Python\r
-    modules containing both a SAX parser and a create_parser function."""\r
-\r
-    for parser_name in parser_list + default_parser_list:\r
-        try:\r
-            return _create_parser(parser_name)\r
-        except ImportError,e:\r
-            import sys\r
-            if parser_name in sys.modules:\r
-                # The parser module was found, but importing it\r
-                # failed unexpectedly, pass this exception through\r
-                raise\r
-        except SAXReaderNotAvailable:\r
-            # The parser module detected that it won't work properly,\r
-            # so try the next one\r
-            pass\r
-\r
-    raise SAXReaderNotAvailable("No parsers found", None)\r
-\r
-# --- Internal utility methods used by make_parser\r
-\r
-if sys.platform[ : 4] == "java":\r
-    def _create_parser(parser_name):\r
-        from org.python.core import imp\r
-        drv_module = imp.importName(parser_name, 0, globals())\r
-        return drv_module.create_parser()\r
-\r
-else:\r
-    def _create_parser(parser_name):\r
-        drv_module = __import__(parser_name,{},{},['create_parser'])\r
-        return drv_module.create_parser()\r
-\r
-del sys\r