Skip to content

Commit

Permalink
#78: Fix formatting of BeheadingInterpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
MattPrit committed Aug 8, 2022
1 parent 09e7dec commit 9c1ea3b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tickit/adapters/interpreters/command/command_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,16 @@ class BeheadingInterpreter(Interpreter[AnyStr]):
"""

def __init__(self, interpreter: Interpreter[AnyStr], header_size: int) -> None:
"""
"""A decorator for an interpreter which strips a header from a message.
Args:
interpreter (Interpreter): The interpreter the message is passed on to
after the header is stripped.
header_size (int): The number of characters in the header.
"""
super().__init__()
self.interpreter = interpreter
self.header_size = header_size
self.interpreter: Interpreter[AnyStr] = interpreter
self.header_size: int = header_size

async def handle(
self, adapter: Adapter, message: AnyStr
Expand All @@ -134,5 +135,5 @@ async def handle(
A tuple of the asynchronous iterable of reply messages and a flag
indicating whether an interrupt should be raised by the adapter.
"""
message = message[self.header_size:]
message = message[self.header_size :]
return await self.interpreter.handle(adapter, message)

0 comments on commit 9c1ea3b

Please sign in to comment.