__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
from abc import ABC, abstractmethod
from typing import List, Union

from .text import Text


def _combine_regex(*regexes: str) -> str:
    """Combine a number of regexes in to a single regex.

    Returns:
        str: New regex with all regexes ORed together.
    """
    return "|".join(regexes)


class Highlighter(ABC):
    """Abstract base class for highlighters."""

    def __call__(self, text: Union[str, Text]) -> Text:
        """Highlight a str or Text instance.

        Args:
            text (Union[str, ~Text]): Text to highlight.

        Raises:
            TypeError: If not called with text or str.

        Returns:
            Text: A test instance with highlighting applied.
        """
        if isinstance(text, str):
            highlight_text = Text(text)
        elif isinstance(text, Text):
            highlight_text = text.copy()
        else:
            raise TypeError(f"str or Text instance required, not {text!r}")
        self.highlight(highlight_text)
        return highlight_text

    @abstractmethod
    def highlight(self, text: Text) -> None:
        """Apply highlighting in place to text.

        Args:
            text (~Text): A text object highlight.
        """


class NullHighlighter(Highlighter):
    """A highlighter object that doesn't highlight.

    May be used to disable highlighting entirely.

    """

    def highlight(self, text: Text) -> None:
        """Nothing to do"""


class RegexHighlighter(Highlighter):
    """Applies highlighting from a list of regular expressions."""

    highlights: List[str] = []
    base_style: str = ""

    def highlight(self, text: Text) -> None:
        """Highlight :class:`rich.text.Text` using regular expressions.

        Args:
            text (~Text): Text to highlighted.

        """

        highlight_regex = text.highlight_regex
        for re_highlight in self.highlights:
            highlight_regex(re_highlight, style_prefix=self.base_style)


class ReprHighlighter(RegexHighlighter):
    """Highlights the text typically produced from ``__repr__`` methods."""

    base_style = "repr."
    highlights = [
        r"(?P<tag_start>\<)(?P<tag_name>[\w\-\.\:]*)(?P<tag_contents>[\w\W]*?)(?P<tag_end>\>)",
        r"(?P<attrib_name>[\w_]{1,50})=(?P<attrib_value>\"?[\w_]+\"?)?",
        r"(?P<brace>[\{\[\(\)\]\}])",
        _combine_regex(
            r"(?P<ipv4>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})",
            r"(?P<ipv6>([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})",
            r"(?P<eui64>(?:[0-9A-Fa-f]{1,2}-){7}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{1,2}:){7}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{4}\.){3}[0-9A-Fa-f]{4})",
            r"(?P<eui48>(?:[0-9A-Fa-f]{1,2}-){5}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{1,2}:){5}[0-9A-Fa-f]{1,2}|(?:[0-9A-Fa-f]{4}\.){2}[0-9A-Fa-f]{4})",
            r"(?P<call>[\w\.]*?)\(",
            r"\b(?P<bool_true>True)\b|\b(?P<bool_false>False)\b|\b(?P<none>None)\b",
            r"(?P<ellipsis>\.\.\.)",
            r"(?P<number>(?<!\w)\-?[0-9]+\.?[0-9]*(e[\-\+]?\d+?)?\b|0x[0-9a-fA-F]*)",
            r"(?P<path>\B(\/[\w\.\-\_\+]+)*\/)(?P<filename>[\w\.\-\_\+]*)?",
            r"(?<![\\\w])(?P<str>b?\'\'\'.*?(?<!\\)\'\'\'|b?\'.*?(?<!\\)\'|b?\"\"\".*?(?<!\\)\"\"\"|b?\".*?(?<!\\)\")",
            r"(?P<uuid>[a-fA-F0-9]{8}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{12})",
            r"(?P<url>(file|https|http|ws|wss):\/\/[0-9a-zA-Z\$\-\_\+\!`\(\)\,\.\?\/\;\:\&\=\%\#]*)",
        ),
    ]


class JSONHighlighter(RegexHighlighter):
    """Highlights JSON"""

    base_style = "json."
    highlights = [
        _combine_regex(
            r"(?P<brace>[\{\[\(\)\]\}])",
            r"\b(?P<bool_true>true)\b|\b(?P<bool_false>false)\b|\b(?P<null>null)\b",
            r"(?P<number>(?<!\w)\-?[0-9]+\.?[0-9]*(e[\-\+]?\d+?)?\b|0x[0-9a-fA-F]*)",
            r"(?<![\\\w])(?P<str>b?\".*?(?<!\\)\")",
        ),
        r"(?<![\\\w])(?P<key>b?\".*?(?<!\\)\")\:",
    ]


if __name__ == "__main__":  # pragma: no cover
    from .console import Console

    console = Console()
    console.print("[bold green]hello world![/bold green]")
    console.print("'[bold green]hello world![/bold green]'")

    console.print(" /foo")
    console.print("/foo/")
    console.print("/foo/bar")
    console.print("foo/bar/baz")

    console.print("/foo/bar/baz?foo=bar+egg&egg=baz")
    console.print("/foo/bar/baz/")
    console.print("/foo/bar/baz/egg")
    console.print("/foo/bar/baz/egg.py")
    console.print("/foo/bar/baz/egg.py word")
    console.print(" /foo/bar/baz/egg.py word")
    console.print("foo /foo/bar/baz/egg.py word")
    console.print("foo /foo/bar/ba._++z/egg+.py word")
    console.print("https://example.org?foo=bar#header")

    console.print(1234567.34)
    console.print(1 / 2)
    console.print(-1 / 123123123123)

    console.print(
        "127.0.1.1 bar 192.168.1.4 2001:0db8:85a3:0000:0000:8a2e:0370:7334 foo"
    )

Filemanager

Name Type Size Permission Actions
__init__.py File 5.67 KB 0644
__main__.py File 8.6 KB 0644
_cell_widths.py File 9.86 KB 0644
_emoji_codes.py File 136.95 KB 0644
_emoji_replace.py File 1.04 KB 0644
_extension.py File 265 B 0644
_inspect.py File 7.27 KB 0644
_log_render.py File 3.15 KB 0644
_loop.py File 1.21 KB 0644
_lru_cache.py File 1.22 KB 0644
_palettes.py File 6.9 KB 0644
_pick.py File 423 B 0644
_ratio.py File 5.34 KB 0644
_spinners.py File 25.9 KB 0644
_stack.py File 351 B 0644
_timer.py File 417 B 0644
_windows.py File 2.02 KB 0644
_wrap.py File 1.76 KB 0644
abc.py File 890 B 0644
align.py File 10.18 KB 0644
ansi.py File 6.52 KB 0644
bar.py File 3.19 KB 0644
box.py File 8.86 KB 0644
cells.py File 4.18 KB 0644
color.py File 16.88 KB 0644
color_triplet.py File 1.03 KB 0644
columns.py File 6.96 KB 0644
console.py File 79.33 KB 0644
constrain.py File 1.26 KB 0644
containers.py File 5.37 KB 0644
control.py File 5.17 KB 0644
default_styles.py File 7.44 KB 0644
diagnose.py File 183 B 0644
emoji.py File 2.44 KB 0644
errors.py File 642 B 0644
file_proxy.py File 1.58 KB 0644
filesize.py File 2.45 KB 0644
highlighter.py File 4.78 KB 0644
json.py File 4.93 KB 0644
jupyter.py File 2.95 KB 0644
layout.py File 13.72 KB 0644
live.py File 13.39 KB 0644
live_render.py File 3.58 KB 0644
logging.py File 10.61 KB 0644
markup.py File 7.87 KB 0644
measure.py File 5.13 KB 0644
padding.py File 4.85 KB 0644
pager.py File 838 B 0644
palette.py File 3.32 KB 0644
panel.py File 8.43 KB 0644
pretty.py File 31.81 KB 0644
progress.py File 35.08 KB 0644
progress_bar.py File 7.58 KB 0644
prompt.py File 11.04 KB 0644
protocol.py File 1.37 KB 0644
region.py File 166 B 0644
repr.py File 4.21 KB 0644
rule.py File 4.1 KB 0644
scope.py File 2.78 KB 0644
screen.py File 1.55 KB 0644
segment.py File 23.36 KB 0644
spinner.py File 4.21 KB 0644
status.py File 4.32 KB 0644
style.py File 25.85 KB 0644
styled.py File 1.23 KB 0644
syntax.py File 26.36 KB 0644
table.py File 35.9 KB 0644
tabulate.py File 1.66 KB 0644
terminal_theme.py File 1.42 KB 0644
text.py File 43.38 KB 0644
theme.py File 3.54 KB 0644
themes.py File 102 B 0644
traceback.py File 25.33 KB 0644
tree.py File 8.91 KB 0644
Filemanager