$10 GRAYBYTE WORDPRESS FILE MANAGER $13

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/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
..
--
17 Dec 2025 3.08 AM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
_vendored
--
17 Apr 2025 8.10 PM
root / root
0755
deprecated
--
14 Aug 2025 9.24 PM
root / root
0755
stdlibs
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0.851 KB
17 Apr 2025 8.10 PM
root / root
0644
__main__.py
0.035 KB
17 Apr 2025 8.10 PM
root / root
0644
_version.py
0.07 KB
17 Apr 2025 8.10 PM
root / root
0644
api.py
25.508 KB
17 Apr 2025 8.10 PM
root / root
0644
comments.py
0.911 KB
17 Apr 2025 8.10 PM
root / root
0644
core.py
21.997 KB
17 Apr 2025 8.10 PM
root / root
0644
exceptions.py
6.895 KB
17 Apr 2025 8.10 PM
root / root
0644
files.py
1.552 KB
17 Apr 2025 8.10 PM
root / root
0644
format.py
5.354 KB
17 Apr 2025 8.10 PM
root / root
0644
hooks.py
3.26 KB
17 Apr 2025 8.10 PM
root / root
0644
identify.py
8.177 KB
17 Apr 2025 8.10 PM
root / root
0644
io.py
2.164 KB
17 Apr 2025 8.10 PM
root / root
0644
literal.py
3.626 KB
17 Apr 2025 8.10 PM
root / root
0644
logo.py
0.379 KB
17 Apr 2025 8.10 PM
root / root
0644
main.py
45.726 KB
17 Apr 2025 8.10 PM
root / root
0644
output.py
27.152 KB
17 Apr 2025 8.10 PM
root / root
0644
parse.py
24.738 KB
17 Apr 2025 8.10 PM
root / root
0644
place.py
5.05 KB
17 Apr 2025 8.10 PM
root / root
0644
profiles.py
2.094 KB
17 Apr 2025 8.10 PM
root / root
0644
py.typed
0 KB
17 Apr 2025 8.10 PM
root / root
0644
pylama_isort.py
1.277 KB
17 Apr 2025 8.10 PM
root / root
0644
sections.py
0.29 KB
17 Apr 2025 8.10 PM
root / root
0644
settings.py
34.75 KB
17 Apr 2025 8.10 PM
root / root
0644
setuptools_commands.py
2.243 KB
17 Apr 2025 8.10 PM
root / root
0644
sorting.py
4.409 KB
17 Apr 2025 8.10 PM
root / root
0644
utils.py
2.356 KB
17 Apr 2025 8.10 PM
root / root
0644
wrap.py
6.173 KB
17 Apr 2025 8.10 PM
root / root
0644
wrap_modes.py
13.251 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF