Skip to content

Commit

Permalink
Merge pull request #1 from sq6emm/main
Browse files Browse the repository at this point in the history
  • Loading branch information
8cH9azbsFifZ authored Dec 14, 2023
2 parents 682818b + 9435312 commit 643fd58
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 643fd58

Please sign in to comment.