Skip to content

Commit

Permalink
#93: Remove old code from RegexCommand.parse
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPrit committed Sep 5, 2022
1 parent 396ee38 commit 1e91fee
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions tickit/adapters/interpreters/command/regex_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,6 @@ def __call__(self, func: Callable) -> Callable:
setattr(func, "__command__", self)
return func

# def parse(self, data: AnyStr) -> Optional[Sequence[AnyStr]]:
# """Performs message decoding and regex matching to match and extract args.

# A method which performs message decoding accoridng to the command formatting
# string, checks for a full regular expression match and returns a sequence of
# function arguments if a match is found, otherwise the method returns None.

# Args:
# data (bytes): The message data to be parsed.

# Returns:
# Optional[Sequence[AnyStr]]:
# If a full match is found a sequence of function arguments is returned,
# otherwise the method returns None.
# """
# if isinstance(data, bytes):
# message = cast(bytes, data)
# message_formatted = (
# message.decode(self.format, "ignore").strip() if self.format else data
# )
# else:
# message_formatted = data
# if isinstance(message_formatted, type(self.regex)):
# match = re.fullmatch(self.regex, message_formatted)
# if match:
# return match.groups()
# return None

def parse(self, data: AnyStr) -> Optional[Tuple[Sequence[AnyStr], int, int, int]]:
"""Performs message decoding and regex matching to match and extract arguments.
Expand Down

0 comments on commit 1e91fee

Please sign in to comment.