$82 GRAYBYTE WORDPRESS FILE MANAGER $78

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/lib64/python2.7/site-packages/sqlalchemy/util/

HOME
Current File : /usr/lib64/python2.7/site-packages/sqlalchemy/util//_preloaded.py
# util/_preloaded.py
# Copyright (C) 2005-2024 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php

"""supplies the "preloaded" registry to resolve circular module imports at
runtime.

"""

import sys

from . import compat


class _ModuleRegistry:
    """Registry of modules to load in a package init file.

    To avoid potential thread safety issues for imports that are deferred
    in a function, like https://bugs.python.org/issue38884, these modules
    are added to the system module cache by importing them after the packages
    has finished initialization.

    A global instance is provided under the name :attr:`.preloaded`. Use
    the function :func:`.preload_module` to register modules to load and
    :meth:`.import_prefix` to load all the modules that start with the
    given path.

    While the modules are loaded in the global module cache, it's advisable
    to access them using :attr:`.preloaded` to ensure that it was actually
    registered. Each registered module is added to the instance ``__dict__``
    in the form `<package>_<module>`, omitting ``sqlalchemy`` from the package
    name. Example: ``sqlalchemy.sql.util`` becomes ``preloaded.sql_util``.
    """

    def __init__(self, prefix="sqlalchemy."):
        self.module_registry = set()
        self.prefix = prefix

    def preload_module(self, *deps):
        """Adds the specified modules to the list to load.

        This method can be used both as a normal function and as a decorator.
        No change is performed to the decorated object.
        """
        self.module_registry.update(deps)
        return lambda fn: fn

    def import_prefix(self, path):
        """Resolve all the modules in the registry that start with the
        specified path.
        """
        for module in self.module_registry:
            if self.prefix:
                key = module.split(self.prefix)[-1].replace(".", "_")
            else:
                key = module
            if (
                not path or module.startswith(path)
            ) and key not in self.__dict__:
                compat.import_(module, globals(), locals())
                self.__dict__[key] = sys.modules[module]


preloaded = _ModuleRegistry()
preload_module = preloaded.preload_module

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
23 Sep 2024 10.41 AM
root / root
0755
__init__.py
6.302 KB
5 Sep 2024 10.50 PM
root / root
0644
__init__.pyc
7.756 KB
23 Sep 2024 10.41 AM
root / root
0644
_collections.py
28.456 KB
5 Sep 2024 10.50 PM
root / root
0644
_collections.pyc
47.026 KB
23 Sep 2024 10.41 AM
root / root
0644
_compat_py3k.py
2.144 KB
5 Sep 2024 10.50 PM
root / root
0644
_concurrency_py3k.py
6.395 KB
5 Sep 2024 10.50 PM
root / root
0644
_preloaded.py
2.34 KB
5 Sep 2024 10.50 PM
root / root
0644
_preloaded.pyc
2.892 KB
23 Sep 2024 10.41 AM
root / root
0644
compat.py
17.954 KB
5 Sep 2024 10.50 PM
root / root
0644
compat.pyc
21.016 KB
23 Sep 2024 10.41 AM
root / root
0644
concurrency.py
2.225 KB
5 Sep 2024 10.50 PM
root / root
0644
concurrency.pyc
2.472 KB
23 Sep 2024 10.41 AM
root / root
0644
deprecations.py
13.354 KB
5 Sep 2024 10.50 PM
root / root
0644
deprecations.pyc
12.528 KB
23 Sep 2024 10.41 AM
root / root
0644
langhelpers.py
54.969 KB
5 Sep 2024 10.50 PM
root / root
0644
langhelpers.pyc
60.869 KB
23 Sep 2024 10.41 AM
root / root
0644
queue.py
9.075 KB
5 Sep 2024 10.50 PM
root / root
0644
queue.pyc
10.05 KB
23 Sep 2024 10.41 AM
root / root
0644
tool_support.py
5.991 KB
5 Sep 2024 10.50 PM
root / root
0644
topological.py
2.792 KB
5 Sep 2024 10.50 PM
root / root
0644
topological.pyc
2.474 KB
23 Sep 2024 10.41 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF