Ejemplo n.º 1
0
def toggle_status(nexus):
    enabled = settings.SETTINGS["miscellaneous"]["status_window_enabled"]
    if enabled:
        nexus.intermediary.kill()
    else:
        utilities.launch_status()
    settings.SETTINGS["miscellaneous"]["status_window_enabled"] = not enabled
    settings.save_config()
Ejemplo n.º 2
0
 def send_entire_queue(self):
     result = ""
     is_message = False
     
     '''check for messages'''
     if not self.waiting_messages.empty():
         is_message = True
         while not self.waiting_messages.empty():
             message = self.waiting_messages.get(timeout=1)
             if self.waiting_messages.qsize() <= 5:
                 if result == "":
                     result = message
                 else:
                     result += "\n" + message 
         
     '''hints wipe out messages'''
     if not self.waiting_hints.empty():
         is_message = False
         while not self.waiting_hints.empty():
             result = self.waiting_hints.get(timeout=1)
     
     if result == "":
         self.timer.remove_callback(self.send_entire_queue)
         return
     
     if utilities.launch_status():
         sleep(2)
     
     send_function = self.communicator.get_com("status").text
     if not is_message:
         send_function = self.communicator.get_com("status").hint
     
     try:
         send_function(result)
     except Exception:
         print("problem communicating with status window:")
         utilities.simple_log()
Ejemplo n.º 3
0
             ]
    defaults = {"n": 1, "nnv": 1,
               "text": "", "volume_mode": "setsysvolume",
               "enable":-1
               }


grammar = Grammar('general')
grammar.add_rule(MainRule())
grammar.add_rule(Again(_NEXUS))
grammar.add_rule(VanillaAlias(name="vanilla alias"))
grammar.load()

_NEXUS.merger.update_config()
_NEXUS.merger.merge(Inf.BOOT)

if settings.SETTINGS["miscellaneous"]["status_window_enabled"]:
    print("\nWARNING: Status Window is an experimental feature, and there is a known freezing glitch with it.\n")
    utilities.launch_status()

print("*- Starting " + settings.SOFTWARE_NAME + " -*")


if settings.WSR:
    import pythoncom
    print("Windows Speech Recognition is garbage; it is " \
        +"recommended that you not run Caster this way. ")
    while True:
        pythoncom.PumpWaitingMessages()  # @UndefinedVariable
        time.sleep(.1)