def notify_module_action_aborted(message, useSound=True): """Notifies the user, with a custom message, that the action was not completed. """ print(message) if useSound: sound.play(sound.SND_MESSAGE)
def notify(message="", useSound=True): """Notifies the user, with a custom message, that the action was not completed. """ if message: print(message) if useSound: sound.play(sound.SND_DING)
def cancel_and_sleep(text=None, text2=None): """Used to cancel an ongoing dictation and puts microphone to sleep. This method notifies the user that the dictation was in fact canceled, with a sound and a message in the Natlink feedback window. Then the the microphone is put to sleep. Example: "'random mumbling go to sleep'" => Microphone sleep. """ print("* Dictation canceled. Going to sleep. *") sound.play(sound.SND_DING) setMicState("sleeping")
def disable_all_modules(): """Iterates through the list of all dynamic modules and disables them.""" global moduleMapping disableCount = 0 config = lib.config.get_config() for moduleName, module in moduleMapping.items(): status = module.dynamic_disable() if status: disableCount += 1 config["dynamics.%s" % moduleName] = False notify_module_disabled(moduleName, useSound=False) if disableCount > 0: sound.play(sound.SND_DEACTIVATE) lib.config.save_config() print("----------- All dynamic modules disabled -----------\n")
def notify_module_disabled(moduleName, useSound=True): """Notifies the user that a dynamic module has been disabled.""" print("<-- Dynamic grammar disabled: %s" % moduleName) if useSound: sound.play(sound.SND_DEACTIVATE)
def notify_module_enabled(moduleName, useSound=True): """Notifies the user that a dynamic module has been enabled.""" print("==> Dynamic grammar enabled: %s" % moduleName) if useSound: sound.play(sound.SND_ACTIVATE)
def illegal_command(text): sound.play(sound.SND_ERROR) print("Vim: Illegal command - '%s'" % str(text))
def go_to_sleep(): import natlink natlink.setMicState('sleeping') play(SND_DEACTIVATE)
def cancel_and_sleep(text=None, text2=None): """random mumbling go to sleep'" => Microphone sleep.""" # print("* Dictation canceled. Going to sleep. *") sound.play(sound.SND_DING) dictation_off()