404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.143.239.234: ~ $
import os
import sys
from pathlib import Path
from typing import NoReturn

from . import find_requirements
from .exceptions import RequirementsNotFound
from .formatters import FORMATTERS


def _die(message) -> NoReturn:
    sys.stderr.write("%s\n" % message)
    sys.exit(1)


def run() -> NoReturn:
    if len(sys.argv) > 1:
        path = Path(sys.argv[1])
    else:
        path = Path.cwd()

    if not path.exists():
        _die("%s does not exist" % path)

    if not path.is_dir():
        _die("%s is not a directory" % path)

    try:
        requirements = find_requirements(path)
    except RequirementsNotFound:
        _die("Unable to find requirements at %s" % path)

    format_name = "requirements_file"  # TODO: other output formats such as JSON
    FORMATTERS[format_name](requirements)
    sys.exit(0)


if __name__ == "__main__":
    run()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
poetry_semver Folder 0755
__init__.py File 269 B 0644
__main__.py File 59 B 0644
detect.py File 5.74 KB 0644
exceptions.py File 103 B 0644
formatters.py File 340 B 0644
handle_setup.py File 3.91 KB 0644
requirement.py File 5.42 KB 0644
run.py File 861 B 0644