Skip to content

Commit

Permalink
Merge pull request #139 from CharaChorder/ccless-chord-logging
Browse files Browse the repository at this point in the history
Enable chord-logging without CC device
  • Loading branch information
jdestgermain authored Jul 21, 2024
2 parents 071c52f + 8780e6b commit bbbbd75
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ repos:
- --statistics
- --max-line-length=120
- --per-file-ignores=nexus/Freqlog/backends/__init__.py:F401
- --exclude=venv,nexus/ui,resources_rc.py
- --exclude=.git,venv,nexus/ui,resources_rc.py
additional_dependencies: [flake8]
- id: pytest
name: pytest
Expand Down
6 changes: 2 additions & 4 deletions nexus/Freqlog/Freqlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ def _log_chord(self, chord: str, start_time: datetime, end_time: datetime) -> No
:param end_time: Timestamp of end of chord
:returns: True if chord was logged, False if it was banned
"""
if not self.chords:
logging.warning("Chords not loaded, not logging chord")
elif chord not in self.chords: # TODO: handle chord modifications (i.e. tense, plural, case)
if self.chords and chord not in self.chords: # TODO: handle chord modifications (i.e. tense, plural, case)
logging.warning(f"Chord '{chord}' not found in device chords, timing: {start_time} - {end_time}")
elif self.backend.log_chord(chord, end_time):
if self.backend.log_chord(chord, end_time):
logging.info(f"Chord: {chord} - {end_time}")
else:
logging.info(f"Banned chord, {end_time}")
Expand Down
2 changes: 1 addition & 1 deletion nexus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
__author__ = "CharaChorder"
__name__ = "nexus"
__id__ = "com.charachorder.nexus"
__version__ = "0.5.2"
__version__ = "0.5.3"

0 comments on commit bbbbd75

Please sign in to comment.