$29 GRAYBYTE WORDPRESS FILE MANAGER $34

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

/opt/alt/python27/lib64/python2.7/xml/dom/

HOME
Current File : /opt/alt/python27/lib64/python2.7/xml/dom//domreg.py
"""Registration facilities for DOM. This module should not be used
directly. Instead, the functions getDOMImplementation and
registerDOMImplementation should be imported from xml.dom."""

from xml.dom.minicompat import *  # isinstance, StringTypes

# This is a list of well-known implementations.  Well-known names
# should be published by posting to xml-sig@python.org, and are
# subsequently recorded in this file.

import sys

well_known_implementations = {
    'minidom':'xml.dom.minidom',
    '4DOM': 'xml.dom.DOMImplementation',
    }

# DOM implementations not officially registered should register
# themselves with their

registered = {}

def registerDOMImplementation(name, factory):
    """registerDOMImplementation(name, factory)

    Register the factory function with the name. The factory function
    should return an object which implements the DOMImplementation
    interface. The factory function can either return the same object,
    or a new one (e.g. if that implementation supports some
    customization)."""

    registered[name] = factory

def _good_enough(dom, features):
    "_good_enough(dom, features) -> Return 1 if the dom offers the features"
    for f,v in features:
        if not dom.hasFeature(f,v):
            return 0
    return 1

def getDOMImplementation(name = None, features = ()):
    """getDOMImplementation(name = None, features = ()) -> DOM implementation.

    Return a suitable DOM implementation. The name is either
    well-known, the module name of a DOM implementation, or None. If
    it is not None, imports the corresponding module and returns
    DOMImplementation object if the import succeeds.

    If name is not given, consider the available implementations to
    find one with the required feature set. If no implementation can
    be found, raise an ImportError. The features list must be a sequence
    of (feature, version) pairs which are passed to hasFeature."""

    import os
    creator = None
    mod = well_known_implementations.get(name)
    if mod:
        mod = __import__(mod, {}, {}, ['getDOMImplementation'])
        return mod.getDOMImplementation()
    elif name:
        return registered[name]()
    elif not sys.flags.ignore_environment and "PYTHON_DOM" in os.environ:
        return getDOMImplementation(name = os.environ["PYTHON_DOM"])

    # User did not specify a name, try implementations in arbitrary
    # order, returning the one that has the required features
    if isinstance(features, StringTypes):
        features = _parse_feature_string(features)
    for creator in registered.values():
        dom = creator()
        if _good_enough(dom, features):
            return dom

    for creator in well_known_implementations.keys():
        try:
            dom = getDOMImplementation(name = creator)
        except StandardError: # typically ImportError, or AttributeError
            continue
        if _good_enough(dom, features):
            return dom

    raise ImportError,"no suitable DOM implementation found"

def _parse_feature_string(s):
    features = []
    parts = s.split()
    i = 0
    length = len(parts)
    while i < length:
        feature = parts[i]
        if feature[0] in "0123456789":
            raise ValueError, "bad feature name: %r" % (feature,)
        i = i + 1
        version = None
        if i < length:
            v = parts[i]
            if v[0] in "0123456789":
                i = i + 1
                version = v
        features.append((feature, version))
    return tuple(features)

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
14 Aug 2025 9.24 PM
root / 996
0755
NodeFilter.py
0.915 KB
8 Jan 2025 5.43 PM
root / 996
0644
NodeFilter.pyc
1.138 KB
8 Jan 2025 5.43 PM
root / 996
0644
NodeFilter.pyo
1.138 KB
8 Jan 2025 5.43 PM
root / 996
0644
__init__.py
3.904 KB
8 Jan 2025 5.43 PM
root / 996
0644
__init__.pyc
6.606 KB
8 Jan 2025 5.43 PM
root / 996
0644
__init__.pyo
6.606 KB
8 Jan 2025 5.43 PM
root / 996
0644
domreg.py
3.444 KB
8 Jan 2025 5.43 PM
root / 996
0644
domreg.pyc
3.368 KB
8 Jan 2025 5.43 PM
root / 996
0644
domreg.pyo
3.368 KB
8 Jan 2025 5.43 PM
root / 996
0644
expatbuilder.py
35.53 KB
8 Jan 2025 5.43 PM
root / 996
0644
expatbuilder.pyc
33.353 KB
8 Jan 2025 5.43 PM
root / 996
0644
expatbuilder.pyo
32.725 KB
8 Jan 2025 5.43 PM
root / 996
0644
minicompat.py
3.278 KB
8 Jan 2025 5.43 PM
root / 996
0644
minicompat.pyc
3.527 KB
8 Jan 2025 5.43 PM
root / 996
0644
minicompat.pyo
3.418 KB
8 Jan 2025 5.43 PM
root / 996
0644
minidom.py
64.722 KB
8 Jan 2025 5.43 PM
root / 996
0644
minidom.pyc
66.962 KB
8 Jan 2025 5.43 PM
root / 996
0644
minidom.pyo
66.833 KB
8 Jan 2025 5.43 PM
root / 996
0644
pulldom.py
11.693 KB
8 Jan 2025 5.43 PM
root / 996
0644
pulldom.pyc
13.305 KB
8 Jan 2025 5.43 PM
root / 996
0644
pulldom.pyo
13.305 KB
8 Jan 2025 5.43 PM
root / 996
0644
xmlbuilder.py
12.048 KB
8 Jan 2025 5.43 PM
root / 996
0644
xmlbuilder.pyc
15.679 KB
8 Jan 2025 5.43 PM
root / 996
0644
xmlbuilder.pyo
15.636 KB
8 Jan 2025 5.43 PM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF