Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DecodingInterpreter and EncodingInterpreter #91

Closed
wants to merge 1 commit into from

Conversation

MattPrit
Copy link
Collaborator

@MattPrit MattPrit commented Sep 1, 2022

Adds interpreter wrappers that decode/encode messages before passing them on to the wrapped interpreter. This should facilitate the removal of encoding/decoding logic from within RegexCommand.

@codecov
Copy link

codecov bot commented Sep 1, 2022

Codecov Report

Merging #91 (7bbb594) into master (c0e90c0) will increase coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #91      +/-   ##
==========================================
+ Coverage   98.56%   98.58%   +0.01%     
==========================================
  Files          67       68       +1     
  Lines        2097     2120      +23     
==========================================
+ Hits         2067     2090      +23     
  Misses         30       30              
Impacted Files Coverage Δ
tickit/adapters/interpreters/wrappers/__init__.py 100.00% <100.00%> (ø)
...ters/interpreters/wrappers/recoding_interpreter.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines +26 to +28
async def handle(
self, adapter: Adapter, message: AnyStr
) -> Tuple[AsyncIterable[AnyStr], bool]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be typed as:

Suggested change
async def handle(
self, adapter: Adapter, message: AnyStr
) -> Tuple[AsyncIterable[AnyStr], bool]:
async def handle(
self, adapter: Adapter, message: bytes
) -> Tuple[AsyncIterable[str], bool]:

Though it may require us to use a contravarient version of AnyStr in the Interpreter definition

Comment on lines +67 to +69
async def handle(
self, adapter: Adapter, message: AnyStr
) -> Tuple[AsyncIterable[AnyStr], bool]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be typed as:

Suggested change
async def handle(
self, adapter: Adapter, message: AnyStr
) -> Tuple[AsyncIterable[AnyStr], bool]:
async def handle(
self, adapter: Adapter, message: str
) -> Tuple[AsyncIterable[bytes], bool]:

Though it may require us to use a contravarient version of AnyStr in the Interpreter definition

@abbiemery
Copy link
Collaborator

Closing this as not planned. When it becomes desired again raise a new issue, linked to this #177.

@abbiemery abbiemery closed this Aug 8, 2023
@abbiemery abbiemery deleted the add_decoding_encoding_interpreters branch August 8, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants