Skip to content

Commit

Permalink
Merge pull request #349 from dictation-toolbox/disable-kaldi-logging-fix
Browse files Browse the repository at this point in the history
Disable Kaldi debug logging workaround for Windows Key action bug
  • Loading branch information
drmfinlay committed Jun 26, 2021
2 parents 10ecc47 + d091452 commit 9087958
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Added

Changed
~~~~~~~
* Disable Kaldi debug logging workaround for Windows Key action bug.
* Make Clipboard class instances comparable based on content difference.

Fixed
Expand Down
17 changes: 10 additions & 7 deletions dragonfly/engines/backend_kaldi/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,6 @@ def __init__(self, model_dir=None, tmp_dir=None, input_device_index=None,
if not os.environ.get('DRAGONFLY_DEVELOP'):
raise EngineError("Incompatible kaldi_active_grammar version")

# Hack to avoid bug processing keyboard actions on Windows
if os.name == 'nt':
action_exec_logger = logging.getLogger('action.exec')
if action_exec_logger.getEffectiveLevel() > logging.DEBUG:
self._log.warning("%s: Enabling logging of actions execution to avoid bug processing keyboard actions on Windows", self)
action_exec_logger.setLevel(logging.DEBUG)

# Handle engine parameters
if input_device_index is not None:
if audio_input_device is not None:
Expand Down Expand Up @@ -219,6 +212,16 @@ def disconnect(self):
def print_mic_list():
MicAudio.print_list()

def _apply_win32_kb_input_logging_fix(self):
# Hack to avoid bug processing keyboard actions on Windows
if os.name == 'nt':
action_exec_logger = logging.getLogger('action.exec')
if action_exec_logger.getEffectiveLevel() > logging.DEBUG:
self._log.warning("%s: Enabling logging of actions "
"execution to avoid bug processing "
"keyboard actions on Windows", self)
action_exec_logger.setLevel(logging.DEBUG)

#-----------------------------------------------------------------------
# Methods for working with grammars.

Expand Down

0 comments on commit 9087958

Please sign in to comment.