Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Morse-Code-over-IP/protocol-mopp
Browse files Browse the repository at this point in the history
  • Loading branch information
8cH9azbsFifZ committed Dec 17, 2023
2 parents b9df7b4 + 643fd58 commit 53171cb
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions python/mopp/src/mopp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,22 @@ def decode(buffer):
outcode = ""
outchars = ""
for el in buffer:
if el == "01":
outcode += "."
elif el == "10":
outcode += "-"
elif el == "00":

for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
elif el =="11":
for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
outchars = outchars + " "
return outchars
if el == "01":
outcode += "."
elif el == "10":
outcode += "-"
elif el == "00":
for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
elif el == "11":
for letter, code in morse.items():
if code == outcode:
outchars += letter
outcode = ""
outchars = outchars + " "
return outchars


#make own zfill for uPython
Expand Down Expand Up @@ -244,4 +243,5 @@ def return_duration_json(self, message):
data['durations'].append(-self.eow_duration)

updated_json_string = json.dumps(data, indent=2)
return updated_json_string
return updated_json_string

0 comments on commit 53171cb

Please sign in to comment.