Skip to content

Commit

Permalink
Fix node setter issue
Browse files Browse the repository at this point in the history
  • Loading branch information
0x9900 committed Nov 11, 2024
1 parent 030c23c commit 7861080
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -13,6 +13,6 @@ repos:
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.1.1
hooks:
- id: flake8
24 changes: 14 additions & 10 deletions wsjtx.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,16 +594,16 @@ def _encode(self):
self._set_string(self._data['Mode'])
self._set_string(self._data['ReportSent'])
self._set_string(self._data['ReportReceived'])
self._set_string(self._data['TXPower'])
self._set_string(self._data['Comments'])
self._set_string(self._data['Name'])
self._set_string(self._data.get('TXPower'))
self._set_string(self._data.get('Comments'))
self._set_string(self._data.get('Name', ''))
self._set_datetime(self._data['DateTimeOn'])
self._set_string(self._data['OpCall'])
self._set_string(self._data['MyCall'])
self._set_string(self._data['MyGrid'])
self._set_string(self._data['ExSent'])
self._set_string(self._data['ExReceived'])
self._set_string(self._data['PropMode'])
self._set_string(self._data.get('OpCall', ''))
self._set_string(self._data.get('MyCall', ''))
self._set_string(self._data.get('MyGrid', ''))
self._set_string(self._data.get('ExSent', ''))
self._set_string(self._data.get('ExReceived', ''))
self._set_string(self._data.get('PropMode', ''))

@property
def DateTimeOff(self):
Expand Down Expand Up @@ -644,7 +644,11 @@ def Mode(self):

@Mode.setter
def Mode(self, val):
self._data['Mode'] = getattr(Mode, val).value
assert isinstance(val, str)
try:
self._data['Mode'] = getattr(Mode, val).value
except AttributeError:
self._data['Mode'] = val

@property
def ReportSent(self):
Expand Down

0 comments on commit 7861080

Please sign in to comment.