404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.135.201.101: ~ $
import re


class Directive(object):
    """A representation of a result line directive."""

    skip_pattern = re.compile(
        r"""^SKIP\S*
            (?P<whitespace>\s*) # Optional whitespace.
            (?P<reason>.*)      # Slurp up the rest.""",
        re.IGNORECASE | re.VERBOSE,
    )
    todo_pattern = re.compile(
        r"""^TODO\b             # The directive name
            (?P<whitespace>\s*) # Immediately following must be whitespace.
            (?P<reason>.*)      # Slurp up the rest.""",
        re.IGNORECASE | re.VERBOSE,
    )

    def __init__(self, text):
        r"""Initialize the directive by parsing the text.

        The text is assumed to be everything after a '#\s*' on a result line.
        """
        self._text = text
        self._skip = False
        self._todo = False
        self._reason = None

        match = self.skip_pattern.match(text)
        if match:
            self._skip = True
            self._reason = match.group("reason")

        match = self.todo_pattern.match(text)
        if match:
            if match.group("whitespace"):
                self._todo = True
            else:
                # Catch the case where the directive has no descriptive text.
                if match.group("reason") == "":
                    self._todo = True
            self._reason = match.group("reason")

    @property
    def text(self):
        """Get the entire text."""
        return self._text

    @property
    def skip(self):
        """Check if the directive is a SKIP type."""
        return self._skip

    @property
    def todo(self):
        """Check if the directive is a TODO type."""
        return self._todo

    @property
    def reason(self):
        """Get the reason for the directive."""
        return self._reason

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
tests Folder 0755
__init__.py File 83 B 0644
__main__.py File 48 B 0644
adapter.py File 1.51 KB 0644
directive.py File 1.76 KB 0644
formatter.py File 762 B 0644
line.py File 4.62 KB 0644
loader.py File 2.88 KB 0644
main.py File 2.07 KB 0644
parser.py File 6.7 KB 0644
rules.py File 3.39 KB 0644
runner.py File 5.08 KB 0644
tracker.py File 7.43 KB 0644