GRAYBYTE WORDPRESS FILE MANAGER1513

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/cloudlinux/venv/lib/python3.11/site-packages/pydocstyle/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/pydocstyle//cli.py
"""Command line interface for pydocstyle."""
import logging
import sys

from .checker import check
from .config import ConfigurationParser, IllegalConfiguration
from .utils import log
from .violations import Error

__all__ = ('main',)


class ReturnCode:
    no_violations_found = 0
    violations_found = 1
    invalid_options = 2


def run_pydocstyle():
    log.setLevel(logging.DEBUG)
    conf = ConfigurationParser()
    setup_stream_handlers(conf.get_default_run_configuration())

    try:
        conf.parse()
    except IllegalConfiguration:
        return ReturnCode.invalid_options

    run_conf = conf.get_user_run_configuration()

    # Reset the logger according to the command line arguments
    setup_stream_handlers(run_conf)

    log.debug("starting in debug mode.")

    Error.explain = run_conf.explain
    Error.source = run_conf.source

    errors = []
    try:
        for (
            filename,
            checked_codes,
            ignore_decorators,
            property_decorators,
            ignore_self_only_init,
        ) in conf.get_files_to_check():
            errors.extend(
                check(
                    (filename,),
                    select=checked_codes,
                    ignore_decorators=ignore_decorators,
                    property_decorators=property_decorators,
                    ignore_self_only_init=ignore_self_only_init,
                )
            )
    except IllegalConfiguration as error:
        # An illegal configuration file was found during file generation.
        log.error(error.args[0])
        return ReturnCode.invalid_options

    count = 0
    for error in errors:  # type: ignore
        if hasattr(error, 'code'):
            sys.stdout.write('%s\n' % error)
        count += 1
    if count == 0:
        exit_code = ReturnCode.no_violations_found
    else:
        exit_code = ReturnCode.violations_found
    if run_conf.count:
        print(count)
    return exit_code


def main():
    """Run pydocstyle as a script."""
    try:
        sys.exit(run_pydocstyle())
    except KeyboardInterrupt:
        pass


def setup_stream_handlers(conf):
    """Set up logging stream handlers according to the options."""

    class StdoutFilter(logging.Filter):
        def filter(self, record):
            return record.levelno in (logging.DEBUG, logging.INFO)

    log.handlers = []

    stdout_handler = logging.StreamHandler(sys.stdout)
    stdout_handler.setLevel(logging.WARNING)
    stdout_handler.addFilter(StdoutFilter())
    if conf.debug:
        stdout_handler.setLevel(logging.DEBUG)
    elif conf.verbose:
        stdout_handler.setLevel(logging.INFO)
    else:
        stdout_handler.setLevel(logging.WARNING)
    log.addHandler(stdout_handler)

    stderr_handler = logging.StreamHandler(sys.stderr)
    msg_format = "%(levelname)s: %(message)s"
    stderr_handler.setFormatter(logging.Formatter(fmt=msg_format))
    stderr_handler.setLevel(logging.WARNING)
    log.addHandler(stderr_handler)

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 25 2025 08:31:36
root / root
0755
__pycache__
--
May 15 2025 08:30:34
root / root
0755
data
--
May 15 2025 08:30:34
root / root
0755
__init__.py
0.189 KB
April 17 2025 13:10:58
root / root
0644
__main__.py
0.281 KB
April 17 2025 13:10:58
root / root
0644
_version.py
0.391 KB
April 17 2025 13:10:58
root / root
0644
checker.py
43.832 KB
April 17 2025 13:10:58
root / root
0644
cli.py
2.923 KB
April 17 2025 13:10:58
root / root
0644
config.py
32.703 KB
April 17 2025 13:10:58
root / root
0644
parser.py
27.628 KB
April 17 2025 13:10:58
root / root
0644
utils.py
1.261 KB
April 17 2025 13:10:58
root / root
0644
violations.py
12.12 KB
April 17 2025 13:10:58
root / root
0644
wordlists.py
1.512 KB
April 17 2025 13:10:58
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF