Skip to content

Commit

Permalink
adds format check for morse unit
Browse files Browse the repository at this point in the history
  • Loading branch information
huettenhain committed Nov 24, 2024
1 parent ef70ced commit adeba47
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions refinery/units/encoding/morse.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ def __init__(
):
super().__init__(language=Arg.AsOption(language, MorseLanguage))

@classmethod
def handles(self, data: bytearray):
if re.fullmatch(BR'[-.\s]+', data, re.DOTALL):
return True

@unicoded
def process(self, data: str):
language: MorseLanguage = self.args.language
Expand Down

0 comments on commit adeba47

Please sign in to comment.