GRAYBYTE WORDPRESS FILE MANAGER8018

Server IP : 198.54.121.189 / Your IP : 216.73.216.224
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/alt/python39/lib64/python3.9/importlib/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/alt/python39/lib64/python3.9/importlib//_common.py
import os
import pathlib
import zipfile
import tempfile
import functools
import contextlib


def from_package(package):
    """
    Return a Traversable object for the given package.

    """
    return fallback_resources(package.__spec__)


def fallback_resources(spec):
    package_directory = pathlib.Path(spec.origin).parent
    try:
        archive_path = spec.loader.archive
        rel_path = package_directory.relative_to(archive_path)
        return zipfile.Path(archive_path, str(rel_path) + '/')
    except Exception:
        pass
    return package_directory


@contextlib.contextmanager
def _tempfile(reader, suffix=''):
    # Not using tempfile.NamedTemporaryFile as it leads to deeper 'try'
    # blocks due to the need to close the temporary file to work on Windows
    # properly.
    fd, raw_path = tempfile.mkstemp(suffix=suffix)
    try:
        os.write(fd, reader())
        os.close(fd)
        yield pathlib.Path(raw_path)
    finally:
        try:
            os.remove(raw_path)
        except FileNotFoundError:
            pass


@functools.singledispatch
@contextlib.contextmanager
def as_file(path):
    """
    Given a Traversable object, return that object as a
    path on the local file system in a context manager.
    """
    with _tempfile(path.read_bytes, suffix=path.name) as local:
        yield local


@as_file.register(pathlib.Path)
@contextlib.contextmanager
def _(path):
    """
    Degenerate behavior for pathlib.Path objects.
    """
    yield path

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 13 2025 08:36:19
root / linksafe
0755
__pycache__
--
May 13 2025 08:36:19
root / linksafe
0755
__init__.py
5.919 KB
April 08 2025 15:21:55
root / linksafe
0644
_bootstrap.py
39.377 KB
April 08 2025 15:21:55
root / linksafe
0644
_bootstrap_external.py
63.425 KB
April 08 2025 15:21:55
root / linksafe
0644
_common.py
1.462 KB
April 08 2025 15:21:55
root / linksafe
0644
abc.py
14.574 KB
April 08 2025 15:21:55
root / linksafe
0644
machinery.py
0.824 KB
April 08 2025 15:21:55
root / linksafe
0644
metadata.py
18.311 KB
April 08 2025 15:21:55
root / linksafe
0644
resources.py
7.04 KB
April 08 2025 15:21:55
root / linksafe
0644
util.py
11.056 KB
April 08 2025 15:21:55
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF