diff --git a/src/natlinkcore/config.py b/src/natlinkcore/config.py index e10313b..3ac4aff 100644 --- a/src/natlinkcore/config.py +++ b/src/natlinkcore/config.py @@ -77,7 +77,7 @@ def from_config_parser(config: configparser.ConfigParser, config_path: str) -> ' if config.has_section('settings.debugadapterprotocol'): dap_settings = config['settings.debugadapterprotocol'] dap_enabled = dap_settings.getboolean('dap_enabled', fallback=False) - dap_port = dap_settings.getint('dap_port', fallback=0) + dap_port = dap_settings.getint('dap_port', fallback=7474) dap_wait_for_debugger_attach_on_startup= dap_settings.getboolean('dap_wait_for_debugger_attach_on_startup', fallback=False) ret.dap_enabled,ret.dap_port,ret.dap_wait_for_debugger_attach_on_startup = \ diff --git a/src/natlinkcore/natlinkstatus.py b/src/natlinkcore/natlinkstatus.py index 5f5745d..dfffe41 100644 --- a/src/natlinkcore/natlinkstatus.py +++ b/src/natlinkcore/natlinkstatus.py @@ -603,6 +603,8 @@ def getVocolaGrammarsDirectory(self): key = 'vocolagrammarsdirectory' value = self.natlinkmain.getconfigsetting(section='directories', option=key) + if not value: + return "" voc_grammars_dir = natlinkcore.config.expand_path(value) self.VocolaGrammarsDirectory = voc_grammars_dir return voc_grammars_dir diff --git a/src/natlinkcore/natlinktimer.py b/src/natlinkcore/natlinktimer.py index 1140753..f5abfb7 100644 --- a/src/natlinkcore/natlinktimer.py +++ b/src/natlinkcore/natlinktimer.py @@ -156,7 +156,7 @@ def removeCallback(self, callback, debug=None): # outside in_timer: try: - print('remove 1 timer') + print(f'natlinktimer, remove timer {callback.__name__}') del self.callbacks[callback] except KeyError: pass @@ -361,7 +361,7 @@ def removeTimerCallback(callback, debug=None): callback: the function to be called """ if not natlinktimer: - print(f'no timers active, cannot remove {callback} from natlinktimer') + # print(f'no timers active, cannot remove {callback} from natlinktimer') return if callback is None: diff --git a/src/natlinkcore/natlinkutils.py b/src/natlinkcore/natlinkutils.py index 1dcc1a7..44e1b05 100644 --- a/src/natlinkcore/natlinkutils.py +++ b/src/natlinkcore/natlinkutils.py @@ -42,7 +42,7 @@ import struct import sys import traceback - +import time import natlink from natlinkcore import gramparser @@ -1320,4 +1320,14 @@ def debug_print(msg): """ if debugLoad: print(msg) - \ No newline at end of file + +if __name__ == "__main__": + try: + natlink.natConnect() + buttonClick('right') + time.sleep(1) + natlink.playString('{esc}') + finally: + natlink.natDisconnect() + + \ No newline at end of file diff --git a/tests/test_natlinktimer.py b/tests/test_natlinktimer.py index f5ea785..00a0846 100644 --- a/tests/test_natlinktimer.py +++ b/tests/test_natlinktimer.py @@ -174,6 +174,7 @@ def testStopAtMicOff(): finally: natlinktimer.stopTimerCallback() + natlink.natDisconnect() # def testStopAtMicOff():