!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/cloudlinux/venv/lib/python3.11/site-packages/prospector/tools/pyright/   drwxr-xr-x
Free 291.17 GB of 429.69 GB (67.76%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     __init__.py (2.86 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import json
import subprocess

import pyright

from prospector.message import Location, Message
from prospector.tools import ToolBase

__all__ = ("PyrightTool",)

from prospector.tools.exceptions import BadToolConfig

VALID_OPTIONS = [
    "level",
    "project",
    "pythonplatform",
    "pythonversion",
    "skipunannotated",
    "typeshed-path",
    "venv-path",
]


def format_messages(json_encoded):
    json_decoded = json.loads(json_encoded)
    diagnostics = json_decoded.get("generalDiagnostics", [])
    messages = []
    for diag in diagnostics:
        start_range = diag.get("range", {}).get("start", {})
        location = Location(
            path=diag["file"],
            module=None,
            function=None,
            line=start_range.get("line", -1),
            character=start_range.get("character", -1),
        )
        messages.append(
            Message(source="pyright", code=diag.get("rule", ""), location=location, message=diag.get("message", ""))
        )

    return messages


class PyrightTool(ToolBase):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.checker = pyright
        self.options = ["--outputjson"]

    def configure(self, prospector_config, _):
        options = prospector_config.tool_options("pyright")

        for option_key in options.keys():
            if option_key not in VALID_OPTIONS:
                url = "https://github.com/PyCQA/prospector/blob/master/prospector/tools/pyright/__init__.py"
                raise BadToolConfig(
                    "pyright", f"Option {option_key} is not valid. " f"See the list of possible options: {url}"
                )

        level = options.get("level", None)
        project = options.get("project", None)
        pythonplatform = options.get("pythonplatform", None)
        pythonversion = options.get("pythonversion", None)
        skipunannotated = options.get("skipunannotated", False)
        typeshed_path = options.get("typeshed-path", None)
        venv_path = options.get("venv-path", None)

        if level:
            self.options.extend(["--level", level])
        if project:
            self.options.extend(["--project", project])
        if pythonplatform:
            self.options.extend(["--pythonplatform", pythonplatform])
        if pythonversion:
            self.options.extend(["--pythonversion", pythonversion])
        if skipunannotated:
            self.options.append("--skipunannotated")
        if typeshed_path:
            self.options.extend(["--typeshed-path", typeshed_path])
        if venv_path:
            self.options.extend(["--venv-path", venv_path])

    def run(self, found_files):
        paths = [str(path) for path in found_files.python_modules]
        paths.extend(self.options)
        result = self.checker.run(*paths, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)

        return format_messages(result.stdout)

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0038 ]--