$56 GRAYBYTE WORDPRESS FILE MANAGER $51

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.217.149
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/isort/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/isort//io.py
"""Defines any IO utilities used by isort"""
import dataclasses
import re
import tokenize
from contextlib import contextmanager
from io import BytesIO, StringIO, TextIOWrapper
from pathlib import Path
from typing import Any, Callable, Iterator, TextIO, Union

from isort.exceptions import UnsupportedEncoding

_ENCODING_PATTERN = re.compile(rb"^[ \t\f]*#.*?coding[:=][ \t]*([-_.a-zA-Z0-9]+)")


@dataclasses.dataclass(frozen=True)
class File:
    stream: TextIO
    path: Path
    encoding: str

    @staticmethod
    def detect_encoding(filename: Union[str, Path], readline: Callable[[], bytes]) -> str:
        try:
            return tokenize.detect_encoding(readline)[0]
        except Exception:
            raise UnsupportedEncoding(filename)

    @staticmethod
    def from_contents(contents: str, filename: str) -> "File":
        encoding = File.detect_encoding(filename, BytesIO(contents.encode("utf-8")).readline)
        return File(stream=StringIO(contents), path=Path(filename).resolve(), encoding=encoding)

    @property
    def extension(self) -> str:
        return self.path.suffix.lstrip(".")

    @staticmethod
    def _open(filename: Union[str, Path]) -> TextIOWrapper:
        """Open a file in read only mode using the encoding detected by
        detect_encoding().
        """
        buffer = open(filename, "rb")
        try:
            encoding = File.detect_encoding(filename, buffer.readline)
            buffer.seek(0)
            text = TextIOWrapper(buffer, encoding, line_buffering=True, newline="")
            text.mode = "r"  # type: ignore
            return text
        except Exception:
            buffer.close()
            raise

    @staticmethod
    @contextmanager
    def read(filename: Union[str, Path]) -> Iterator["File"]:
        file_path = Path(filename).resolve()
        stream = None
        try:
            stream = File._open(file_path)
            yield File(stream=stream, path=file_path, encoding=stream.encoding)
        finally:
            if stream is not None:
                stream.close()


class _EmptyIO(StringIO):
    def write(self, *args: Any, **kwargs: Any) -> None:  # type: ignore # skipcq: PTC-W0049
        pass


Empty = _EmptyIO()


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
9 Apr 2026 8.31 AM
root / root
0755
__pycache__
--
11 Feb 2026 9.30 AM
root / root
0755
_vendored
--
20 Jan 2026 1.01 PM
root / root
0755
deprecated
--
11 Feb 2026 9.30 AM
root / root
0755
stdlibs
--
11 Feb 2026 9.30 AM
root / root
0755
__init__.py
0.851 KB
20 Jan 2026 1.01 PM
root / root
0644
__main__.py
0.035 KB
20 Jan 2026 1.01 PM
root / root
0644
_version.py
0.07 KB
20 Jan 2026 1.01 PM
root / root
0644
api.py
25.508 KB
20 Jan 2026 1.01 PM
root / root
0644
comments.py
0.911 KB
20 Jan 2026 1.01 PM
root / root
0644
core.py
21.997 KB
20 Jan 2026 1.01 PM
root / root
0644
exceptions.py
6.895 KB
20 Jan 2026 1.01 PM
root / root
0644
files.py
1.552 KB
20 Jan 2026 1.01 PM
root / root
0644
format.py
5.354 KB
20 Jan 2026 1.01 PM
root / root
0644
hooks.py
3.26 KB
20 Jan 2026 1.01 PM
root / root
0644
identify.py
8.177 KB
20 Jan 2026 1.01 PM
root / root
0644
io.py
2.164 KB
20 Jan 2026 1.01 PM
root / root
0644
literal.py
3.626 KB
20 Jan 2026 1.01 PM
root / root
0644
logo.py
0.379 KB
20 Jan 2026 1.01 PM
root / root
0644
main.py
45.726 KB
20 Jan 2026 1.01 PM
root / root
0644
output.py
27.152 KB
20 Jan 2026 1.01 PM
root / root
0644
parse.py
24.738 KB
20 Jan 2026 1.01 PM
root / root
0644
place.py
5.05 KB
20 Jan 2026 1.01 PM
root / root
0644
profiles.py
2.094 KB
20 Jan 2026 1.01 PM
root / root
0644
py.typed
0 KB
20 Jan 2026 1.01 PM
root / root
0644
pylama_isort.py
1.277 KB
20 Jan 2026 1.01 PM
root / root
0644
sections.py
0.29 KB
20 Jan 2026 1.01 PM
root / root
0644
settings.py
34.75 KB
20 Jan 2026 1.01 PM
root / root
0644
setuptools_commands.py
2.243 KB
20 Jan 2026 1.01 PM
root / root
0644
sorting.py
4.409 KB
20 Jan 2026 1.01 PM
root / root
0644
utils.py
2.356 KB
20 Jan 2026 1.01 PM
root / root
0644
wrap.py
6.173 KB
20 Jan 2026 1.01 PM
root / root
0644
wrap_modes.py
13.251 KB
20 Jan 2026 1.01 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF